} }
if(isVT&&isNull) //处理像E->ABaβ的产生式的情况 AddChar(select[i],proNode[i].rightSym[j]); if(j == proNode[i].length) {
//若α=X1X2 ? Xnα′,其中Xi∈VN , 1≤i≤n; //若对于一切1≤i≤n,ε∈FIRST(Xi),则将follow(α)加入select集合
int leftSymLoc = GetUTLoaction(UnTerminate,proNode[i].leftSym);
AddCharToChar(select[i],unTInfo[leftSymLoc].follow); } } } }
void SetSheet(ProNode proNode[],UnTInfo unTInfo[]) { //构造分析表 int selLen ;
int rowLoc,colLoc;
for(int i = 0; i < proNum ; i++) { selLen = strlen(select[i]);
for(int j = 0 ; j < selLen ; j++) {
rowLoc = GetUTLoaction(UnTerminate,proNode[i].leftSym); colLoc = GetTLocaction(Terminate,select[i][j]); sheet[rowLoc][colLoc] = proNode[i]; } } }
void InputSym() { //输入字符串函数 InitQueue(Remain);
cout<<\请输入要分析的字符串(以'#'结束):\ char tmpChar; int i = 0 ;
cin>>tmpChar;
while(tmpChar != '#') {
EnQueue(Remain,tmpChar); cin>>tmpChar; }
EnQueue(Remain,tmpChar); }
void Scan() { //分析扫描的主控程序 int i = 0 ; int step = 1; int rightLoc; int leftLoc; char a; char x;
bool flag = true; //SymStack[i] = '#';
//SymStack[++i] = UnTerminate[0]; //'#' 、开始符号入栈 //SqStack s;
SqStack SymStack; //符号栈 InitStack(SymStack);
cout<<\步骤\符号栈\读入符号\剩余符号串\使用产生式\
25
cout< Push(SymStack,UnTerminate[0]); //'#' 、开始符号入栈 PrintSym(SymStack);

