编译原理 我没看懂 100分

编译原理 我没看懂 100分
#include
#include
#include
#include
using namespace std;
char cbuffer;
char * key[21]={"and","begin","const","div","do","else","end","function","if",
"integer","not","or","procedure","program","read","real","then","type","var","while","write"};
char * border[8]={",",";",":",".","(",")","[","]"};
char * relation[14]={"+","-","*","/","=","","","=",":=","{","}","#"};
ifstream ifile;
int search( char searchchar[],int wordtype)
{
int i=0;
switch(wordtype)
{
case 1:{for(i=0;i
其他人气:884 ℃时间:2020-08-07 10:38:15
优质解答
+739227481 你是要解释,还是要啥?要求完善的那部分的解释 原理char otherprocess(char buffer){//请完善该部分程序。 int atype; char other[4];//缓存前2个字符外加一个\0,另外剩下一个字符边界哨兵牌 /*while((isalpha(buffer))||(isdigit(buffer))) {other[++i]=buffer;buffer=ifile.get(); } */ other[0]=buffer;//当前字符存入other[0] buffer=ifile.get();//下一个字符获取, other[1]=buffer;//存入other[1] other[2]='\0';//结束该次获取字符if(search(other,3))//检测该次获取的字符串是否为第三类,也就是在relation数组里的关键字 {atype=search(other,3);//如果是,则返回该字符串的类型cout<
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版