编译原理(递归下降分析器) ) ) ) ) ) ) ) ) ) )。
#包含
#包含
#包含
用户命名空间STD;
int i=0;
字符串下一个令牌;
char ch;
void A (;
void A1 (;
void read () )
{
ch=nexttoken雅致白云I;
}
Void错误() )
{
出局了
退出(1;
}
void S () )
{
读取(;
if(ch==' ) )
{
读取(;
a ();
if(ch==' () ) ) goto L;
else错误(;
}
Elseif(ch!='a ' )错误(;
else { read (; a ();
if(ch=='b ' ) goto L;
else错误(; }
返回;
}
void A () )
{
if(ch=='e ' ) {read ); 谷歌; }
If (通道!='d ' )错误(;
s (;
返回;
}
void A1 () ) ) ) ) ) )。
{
ELSEif(ch=='b ' ) goto L1;
ELSEif(ch==' ) goto L1;
else错误(;
}
Void主() )
{
特里
{
出局了
cinnexttoken;
ch=nexttoken[i];
s (;
出局了
}
是catch(char )
{
出局了
}
}
//(aeb )正确