合工大编译原理实验报告,后面附代码,孩纸,只能参考不能抄袭哦,好好学习天天向上,
row++; while(IsDigit(ch)) {st+=ch; ch=in.get(); } in.seekg(-1,ios::cur); cout<<st<<"\t("<<st<<","<<3<<")"<<'\t'<<'\t'<<"常数"<<'\t'<<"("<<line<<","<<row<<")"<<endl; // break; } else {st=""; st+=ch; if(IsOptr(st)) //运算符处理 { row++; cout<<st<<"\t("<<st<<","<<4<<")"<<'\t'<<'\t'<<"运算符"<<"("<<line<<","<<row<<")"<<endl;
} else
if(IsSeparator(st))//分隔符处理 { row++;
cout<<st<<"\t("<<st<<","<<5<<")"<<'\t'<<'\t'<<"分界符"<<'\t'<<"("<<line<<","<<row<<")"<<endl; }
else{ switch(ch){row++;
case'=' : {row++;cout<<"="<<"\t("<<"="<<","<<"6"<<")"<<'\t'<<"\t关系运算符"<<'\t'<<"("<<line<<","<<row<<")"<<endl;} case'>' :{row++;ch=in.get(); if(ch=='=')
cout<<">="<<'\t'<<"("<<">="<<","<<"6"<<")"<<'\t'<<"\t关系运算符"<<'\t'<<"("<<line<<","<<row<<")"<<endl;
else {cout<<">"<<"\t("<<">"<<","<<"6"<<")"<<'\t'<<"\t关系运算符"<<'\t'<<"("<<line<<","<<row<<")"<<endl;
in.seekg(-1,ios::cur);} } break;
case'<' :{row++;ch=in.get();
if(ch=='=')cout<<"<="<<'\t'<<"("<<"="<<","<<"6"<<")"<<"\t关系运算符"<<'\t'<<"("<<line<<","<<row<<")"<<endl;
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新高等教育编译原理实验报告-合肥工业大学版(11)全文阅读和word下载服务。
相关推荐: