![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编译原理
wodexiaoyuzhou
code for fun
展开
-
简单词法分析c语言实现
/*单词编码方式*/ /* 标识符: token.class=1 */ /* 正整数: token.class=2 */ /* 加号: token.class=3 */ /* 分号: token.class=4 */ /* 冒号: token.class=5 */ /* 赋值号: token.class=6 */ /* 小于号: token.class=7 */ /*小于等于号: token.class=8 */ /*文件结束符'#': token.class=9*/ #inclu原创 2021-11-01 16:35:55 · 200 阅读 · 1 评论 -
实现一个给定文法的递归下降程序c语言实现
#include <stdio.h> #include <stdlib.h> #include <syspes.h> #include <unistd.h> /* 要求实现文法 S->aSe S->B B->bBe B->C C->cCc C->d */ char s[1000];//字符串 int index;//下标 bool ok; void C(char c){ if(c=='d') { .原创 2021-11-01 16:32:35 · 868 阅读 · 3 评论