?? main.cpp
字號:
#include "csshi.h"
main()
{
csshi cs;
cs.input();
cout<<"產(chǎn)生式是:"<<endl;
cs.output();
cout<<"產(chǎn)生式的開始字符是:"<<cs.getbgch()<<endl;
shuzu sz;
initshuzu(sz);
cout<<"產(chǎn)生式的右部是"<<endl;
for (int i=1;i<=cs.getpro();i++)
{ sz=cs.getrch(i);
cout<<sz.ch[1]<<"的右部是:";
for (int j=2;j<=sz.chang+1;j++)
cout<<sz.ch[j];
cout<<endl;
}
///////////////////////////////
cout<<"終結(jié)字符是:"<<endl;
sz=cs.getEndch();
for (i=1;i<=sz.chang;i++)
cout<<sz.ch[i];
cout<<endl;
//////////////////////////
cout<<"非終結(jié)字符是:"<<endl;
sz=cs.getunEndch();
for (i=1;i<=sz.chang;i++)
cout<<sz.ch[i];
cout<<endl;
//////////////////////////
cs.getfirst();
cout<<"first'group:"<<endl;
cs.outfirst();
//////////////////////////
cs.getfollow();
cout<<"follow'group:"<<endl;
cs.outfollow();
//////////////////////////
//////////////////////////
cs.getselect();
cout<<"select'group:"<<endl;
cs.outselect();
//////////////////////////
cs.getchart();
cs.outchart();
//分析字符串開始
bool pd=true;char c;
while (pd)
{
cs.mainfuction();
bool pd1=true;
while (pd1)
{
pd1=false;
cout<<"do you test again?y or n:";
cin>>c;
if (c=='y')
pd=true;
else if (c=='n')
pd=false;
else
pd1=true;
}
}
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -