BUFLEN 50 #define TEMPLEN 2*BUFLEN int type=0; char val[TEMPLEN]; FILE *infile; //.pas FILE *outfile; //.dyd FILE *errfile; //.err char buf[BUFLEN]; //读入缓冲区 char temp[TEMPLEN]; char reserve[2]; /****** 判别是否字母*****/ int isletter( char c) {if(((c>= 'a' )&&(c<= 'z' ))||((c>= 'A' )&&(c<= 'Z' ))) return 1; else return 0; }/******** 判别是否数字********/ int isdigital( char c) {if(c>= '0' &&c<= '9' )return 1; return 0; }/******** 匹配保留字******/ int match_reserve( char *p) {memset(val,0,TEMPLEN); if(!(strcmp(p, "begin" ))) {type=BEGIN; strcpy(val, "begin" ); to_outfile(); return 1; }else if(!(strcmp(p, "end" ))) {type=END; strcpy(val, "end" ); to_outfile(); return 1; }else if(!(strcmp(p, "integer" ))) {type=INTEGER; strcpy(val, "integer" ); to_outfile(); return 1; }else if(!(strcmp(p, "if" ))) {type=IF;