编译原理
void main() {
printf("please input the sentence,end with '#'"); p=0;
do //先将#以前的所有字符读入prog[p]数组 { p++; scanf("%c",&prog[p]); }while(prog[p]!='#'); //!!!!!!!!由于上面采用的是do..while所以读入的第一个 p=1; for(i=0;i<20;i++) token[i]=NULL; i=0; get();
while(ch!='#') { if(ch==' ') get(); else { switch(ch) { case'a': case'b': case'c': case'd': case'e': case'f': case'g': case'h': case'i': case'j': case'k': case'l': case'm': case'n': case'o': case'p': case'q': case'r': case's': case't': case'u': case'v': case'w':
//字符时存在p=1的,所以先要使p=1,这是必须的 //清空token[]数组