编译原理课程设计-词法分析器设计(C语言)答:char prog[80]={'\0'},token[8]; /*存放构成单词符号的字符串*/ char ch;int syn, /*存放单词字符的种别码*/ n,sum, /*存放整数型单词*/ m,p; /*p是缓冲区prog的指针,m是token的指针*/ char *rwtab[6]={"begin","if","then","while","do","end"};void scan...
跪求C语言编写的简单词法分析器答:int i,j,k,flag,number,status;/*status which is use to judge the string is keywords or not!*/ char ch;char words[10] = {" "};char program[500];int Scan(char program[]){ char *keywords[13] = {"void","main","if","then","break","int","char","float","include"...