全文预览

江雪琴27号实验1 了解编译.doc

上传者:梦&殇 |  格式:doc  |  页数:5 |  大小:0KB

文档介绍
etc(fin); if(ch=='*') { char ch1; ch1=getc(fin); do { ch=ch1;ch1=getc(fin); }while((ch!='*'||ch1!='/')&&ch1!=EOF); ch=getc(fin); }else { token[0]='/';token[1]='\0'; fprintf(fout,"%s\t%s\n",token,token); } }else { token[0]=ch;token[1]='\0'; ch=getc(fin); es=3; fprintf(fout,"%s\t%s\n","ERROR",token); }} fclose(fin); fclose(fout); return(es); } #include<stdio.h> #include<ctype.h> extern int Tscan(); char Scanin[300],Scanout[300]; FILE *fin,*fout; void main() { int es=0; es=Tscan(); if(es>0)printf("Lexical analysis pile stop!"); else printf("Lexical analysis ess!\n"); getch(); } 输入{ int a; a=10; } 输出 Please input source program file name(including path):D:\Test.txt Please input output filename lexical analysis(including path):D:\outp.txt {{ int int IDa;; IDa== NUM 10 ;;}} Lexical analysis ess!

收藏

分享

举报
下载此文档