词法分析器词法分析器词法分析器词法分析器

时间:2013-07-23 01:32:30
【文件属性】:
文件名称:词法分析器词法分析器词法分析器词法分析器
文件大小:216KB
文件格式:RAR
更新时间:2013-07-23 01:32:30
词法分析器词法分析器词法分析器词法分析器词法分析器词法分析器词法分析器词法分析器词法分析器词法分析器 编译原理 词法分析器 词法分析器 int lineno = 0; //行号 FILE * source; FILE * listing; FILE * test; int EchoSource = TRUE; //打印源码标识 int TraceScan = TRUE; //打印二元组标识 int main( int argc, char * argv[] ) { char pgm[120]; //源码文件名 if (argc != 2) { fprintf(stderr,"usage: %s \n",argv[0]); exit(1); } strcpy(pgm,argv[1]) ; if (strchr (pgm, '.') == NULL) strcat(pgm,".lex"); source = fopen(pgm,"r"); test = fopen("test.txt","w"); if (source==NULL) { fprintf(stderr,"File %s not found\n",pgm); exit(1); } listing = stdout; //在屏幕上输出 fprintf(listing,"\nLex Analysis Program: %s\n",pgm); while (getToken()!=ENDFILE); fclose(source); fclose(test); return 0; }
【文件预览】:
LexCompiler
----main.c(926B)
----LexCompiler.opt(49KB)
----使用说明.txt(42B)
----GOLBALS.H(647B)
----SCAN.H(217B)
----SCAN.c(5KB)
----UTIL.c(2KB)
----LexCompiler.dsp(5KB)
----Debug()
--------vc60.pdb(52KB)
--------test.txt(163B)
--------UTIL.obj(6KB)
--------LexCompiler.bsc(121KB)
--------vc60.idb(41KB)
--------LexCompiler.pdb(457KB)
--------LexCompiler.pch(201KB)
--------LexCompiler.exe(184KB)
--------sample.lex.bak(203B)
--------LexCompiler.ilk(203KB)
--------sample.lex(205B)
--------SCAN.obj(11KB)
--------main.obj(5KB)
--------sample.txt(6B)
--------SCAN.sbr(0B)
--------sample2.lex(29B)
--------UTIL.sbr(0B)
--------main.sbr(0B)
----LexCompiler.dsw(530B)
----UTIL.H(123B)
----LexCompiler.plg(256B)
----LexCompiler.ncb(81KB)

网友评论

  • 可以下载。可以使用。值得一看。谢谢分享
  • 代码写的不错,自行修改了些。谢谢
  • 代码不错,能直接运行
  • 代码不错,能直接运行