词法分析实验总结 在这次编译过程中,一开始是个人通过理解课本与网上查阅资料,效果不佳,后来通过和小组成员讨论与分析,最终解决了问题。在编译程序过程中,主要问题是输出关键字和种别码的顺序,输出数字和其种别码的顺序,控制循环次数的变量t和种别码key的关系,遇到非法字符的输出。通过这次程序合作,感受到了...
分类:
其他好文 时间:
2015-10-21 18:59:24
阅读次数:
170
经过几个星期的努力,总算把词法分析的程序给完成了,总的来说这是一个坚苦而又漫长的过程。是啊,读了那么多年的书,编写词法分析程序可是第一次呀!看着劳动成果,很欣慰!虽然这不是我一个人做的,是大家的共同努力得来的。 几个星期前,当听到老师布置给我们的这个题目时,我们都蒙了,这么难的题目我们怎么...
分类:
其他好文 时间:
2015-10-19 22:24:03
阅读次数:
194
#include#includevoid Fenxi(char c,char b);void word(char a[]);void number(char a[]);int i; //定义全局变量iint s=1; //用来记录是否存在非法字符main(){ char a[50]; ...
分类:
其他好文 时间:
2015-10-18 18:06:31
阅读次数:
127
#include#includechar prog[80],token[8];char ch;char *rwtab[6]={"begin","if","then","while","do","end"};int syn,m=0,row,sum=0,p=0,n;main(){ printf(...
分类:
其他好文 时间:
2015-10-15 15:59:55
阅读次数:
156
#include#include//strcmp()用于比较两个字符串#include//getch()#define max 200char pro[max], lin[20];int n,i,syn;char *word[6]={ "begin", "if" , "then", "while",...
分类:
其他好文 时间:
2015-10-15 15:46:13
阅读次数:
300
1 #include 2 #include 3 #define max 1000 4 char a,token[max],word[max]; 5 void main() 6 { 7 int n=0,i=0; 8 char *rwtab[6]={"begin","i...
分类:
其他好文 时间:
2015-10-14 23:32:01
阅读次数:
165
#include#include//strcmp()用于比较两个字符串#include//getch()#define max 200char pro[max], lin[20];int n,i,syn;char *word[6]={ "begin", "if" , "then", "while",...
分类:
其他好文 时间:
2015-10-14 23:27:50
阅读次数:
184
#include#include//strcmp()#include//getch()#define max 200char pro[max], lin[20];int n,i,syn;char *word[6]={ "begin", "if" , "then", "while", "do" ,"e...
分类:
其他好文 时间:
2015-10-14 23:25:25
阅读次数:
194
#include #include #include #define _KEY_WOED_END "waiting for your expanding" //关键字结束标志typedef struct { int typenum; char * word; }WORD;char input[255...
分类:
其他好文 时间:
2015-10-14 21:16:27
阅读次数:
187
#include#include #includemain(){ char a[10000]; char ch,bh; int i,s,t,j,q; s=0; t=0; printf("请输入字符(输入#结束):"); do { sca...
分类:
其他好文 时间:
2015-10-14 19:31:59
阅读次数:
213