1. 首页
  2. 课程学习
  3. C++/C
  4. 编译原理 词法分析源代码 C 验收

编译原理 词法分析源代码 C 验收

上传者: 2018-12-27 04:06:03上传 RAR文件 2.8KB 热度 35次
#include #include #include #include #include"biao.h" char Alp(char a); int s(char m,int n); int F(char bb[]); int B(char bb[]); void main() //void main() { FILE *fp,*fc,*f1,*f2; char Word[50]; char ch=' '; char f='b'; int s1=0,i=0,j=0; int m=0,n=0,k=1; quzx(); fp=fopen("temp.txt","r"); fc=fopen("bb.txt","w"); f1=fopen("变量表","w"); f2=fopen("数据表","w"); while(ch! =EOF) { ch=fgetc(fp); Word[i++]=ch; //putchar(ch); if(ch=='\n') { printf("\n"); k++; } if(Alp(ch)=='0'&&ch!=EOF) { printf("\n第%d行 输入非法字符:%c",k,ch); fseek(fp,1L,1); i--; continue; } //printf("思古"); s1=s(Alp(ch),s1); =EOF) { ch=fgetc(fp); Word[i++]=ch; //putchar(ch); if(ch=='\n') { printf("\n"); k++; } if(Alp(ch)=='0'&&ch!=EOF) { printf("\n第%d行 输入非法字符:%c",k,ch); fseek(fp,1L,1); i--; continue; } //printf("思古"); s1=s(Alp(ch),s1);
用户评论