void errormsg(){ int k, i; alfa msg[59]; strcpy(msg[ 0], "undef id "); strcpy(msg[ 1], "multi def "); strcpy(msg[ 2], "identifier"); strcpy(msg[ 3], "program "); strcpy(msg[ 4], ") "); strcpy(msg[ 5], ": "); strcpy(msg[ 6], "syntax "); strcpy(msg[ 7], "ident, var"); strcpy(msg[ 8], "of "); strcpy(msg[ 9], "( "); strcpy(msg[10], "id, array "); strcpy(msg[11], "[ "); strcpy(msg[12], "] "); strcpy(msg[13], ".. "); strcpy(msg[14], "; "); strcpy(msg[15], "func. type"); strcpy(msg[16], "= "); strcpy(msg[17], "boolean "); strcpy(msg[18], "convar typ"); strcpy(msg[19], "type "); strcpy(msg[20], "prog.param"); strcpy(msg[21], "too big "); strcpy(msg[22], ". "); strcpy(msg[23], "typ (case)"); strcpy(msg[24], "character "); strcpy(msg[25], "const id "); strcpy(msg[26], "index type"); strcpy(msg[27], "indexbound"); strcpy(msg[28], "no array "); strcpy(msg[29], "type id "); strcpy(msg[30], "undef type"); strcpy(msg[31], "no record "); strcpy(msg[32], "boole type"); strcpy(msg[33], "arith type"); strcpy(msg[34], "integer "); strcpy(msg[35], "types "); strcpy(msg[36], "param type"); strcpy(msg[37], "variab id "); strcpy(msg[38], "string "); strcpy(msg[39], "no.of pars"); strcpy(msg[40], "type "); strcpy(msg[41], "type "); strcpy(msg[42], "real type "); strcpy(msg[43], "integer "); strcpy(msg[44], "var, const"); strcpy(msg[45], "var, proc "); strcpy(msg[46], "types (:=)"); strcpy(msg[47], "typ (case)"); strcpy(msg[48], "type "); strcpy(msg[49], "store ovfl"); strcpy(msg[50], "constant "); strcpy(msg[51], ":= "); strcpy(msg[52], "then "); strcpy(msg[53], "until "); strcpy(msg[54], "do "); strcpy(msg[55], "to downto "); strcpy(msg[56], "begin "); strcpy(msg[57], "end "); strcpy(msg[58], "factor "); printf("\n"); printf(" key words\n"); for(k = 0; k< 59; k++){ for (i = 0; i<=ermax; i++){ if(errs[i] ==k){ printf("%d %s\n", k, msg[k]); errs[i]= -1; } } } }// end errormsg void nextch(){ int it; if (cc == ll){ if(ch == EOF){ printf("\n program incomplete\n"); errormsg(); exit(1); } if(errpos != 0){ printf("\n"); errpos = 0; } if(!inPas){ if(feedbacklevel == 0 || feedbacklevel == 3) printf("\n%5d ", lc); else printf("%5d ", lc); } ll = 0; cc = 0; do { ll = ll + 1; ch = fgetc(srcfil); if(!inPas)printf("%c", ch); line[ll] = ch; }while(ch != '\n'); } cc = cc + 1; ch = line[cc]; }// end nextch