语法分析器 源程序:
#include<string.h> #include<iostream> using namespace std; char prog[100],token[10]; char ch;
int syn,p,m=0,n,row,sum=0;
char *rwtab[20]={"dim","if","do","stop","end" ,"and","begin","bool","case","char", "false","for","int","not","or","set","then","true","until","while" };
void scaner() { for(n=0;n<9;n++) token[n]=NULL; ch=prog[p++]; while(ch==' ') { ch=prog[p]; p++; } if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))