全文预览

编译原理论文

上传者:相惜 |  格式:doc  |  页数:13 |  大小:231KB

文档介绍
ch=='.'&&IsDigit(fgetc(fpin))){Р arr=arr+ch;Р ch=fgetc(fpin);Р }Р fseek(fpin,-1L,SEEK_CUR);Р cout<<arr<<"\t$无符号实数"<<endl; Р }Р else switch(ch){ //标识符分类识别Р case'+':Р case'-' :Р case'*' :Р case'/' :cout<<ch<<"\t$运算符"<<endl;break;Рcase'=' :Р case'(' :Р case')' :Р case'[' :Р case']' : Р case'{' :Рcase'}' :cout<<ch<<"\t$界符"<<endl;break;Рcase';' :Р case',' :Рcase':' :{ch=fgetc(fpin);Р if(ch=='=') cout<<":="<<"\t$运算符"<<endl;Р else {cout<<"="<<"\t$运算符"<<endl;;Р fseek(fpin,-1L,SEEK_CUR);}Р }break;Рcase'.' :Р case'<' :{ch=fgetc(fpin);Р if(ch=='=')cout<<"<="<<"\t$运算符"<<endl;Р else if(ch=='<')cout<<"<<"<<"\t$输出控制符"<<endl;Р else if(ch=='>') cout<<"<>"<<"\t$运算符"<<endl;Р else{cout<<"<"<<"\t$运算符"<<endl;Р fseek(fpin,-1L,SEEK_CUR);}Р }break;Рcase'>' :{ch=fgetc(fpin);Р if(ch=='=') cout<<">="<<"\t$运算符"<<endl;

收藏

分享

举报
下载此文档