int const nkw = 27, // key words alng = 10, // identifier length llng = 250, // Line length emax = 308, // Max exponent emin = -308, // min exponent kmax = 15, // max significant digits tmax = 10000, // table size bmax = 1000, // block table size amax = 1000, // array table size c2max = 1000, // size of real constant talbe csmax = 1000, // max number of cases cmax = 100000, // code table size lmax = 100, // max level smax = 100000, // size of string table ermax = 58, // max errors omax = 63, // highest order code xmax = 131071, // 2^17 -1 lineleng = 250, // output line length linelimit = 100000, stacksize = 100000, lnfeedback = 0, // 0 turns off, 1 turns on printt = 1, // print tables 0 turns off inxmax = 127, // max index of ASCII char intfld = 10, // default output field for integer relfld = 22, // default output field for real bolfld = 10, // default output field for boolean chrfld = 1, // default output field for char feedbacklevel = 2; /* feedbacklevel 0 symbols retrieved 1 listcode and variables 2 list generatedcode 3 levels 0 + 1 + 2 + 3 anyother value no trace */ long int const nmax = 281474976710655; // 2^48 -1 int intcon = 1, realcon = 2, charcon = 3, stringt = 4, notsy = 5, plus = 6, minus = 7, times = 8, idiv = 9, rdiv = 10, imod = 11, andsy = 12, orsy = 13, egl = 14, neg = 15, gtr = 16, geg = 17, lss = 18, leg = 19, lparent = 20, rparent = 21, lbrack = 22, rbrack = 23, comma = 24, semicolon = 25, period = 26, colon = 27, becomes = 28, constsy = 29, typesy = 30, varsy = 31, functionsy = 32, proceduresy= 33, arraysy = 34, recordsy = 35, programsy = 36, ident = 37, beginsy = 38, ifsy = 39, casesy = 40, repeatsy = 41, whilesy = 42, forsy = 43, endsy = 44, elsesy = 45, untilsy = 46, ofsy = 47, dosy = 48, tosy = 49, downtosy = 50, thensy = 51; // symbols int konstant = 0, variable = 1, typel = 2, prozedure= 3, funktion = 4; // objects int notyp = 0, ints = 1, reals = 2, bools = 3, chars = 4, arrays = 5, records= 6; // types int const lad = 0, lva = 1, //mnemonics lin = 2, upd = 3, bif = 8, off = 9, jmp = 10, cjp = 11, swt = 12, f1u = 14, f2u = 15, f1d = 16, f2d = 17, mks = 18, cal = 19, ix1 = 20, ix2 = 21, lbl = 22, cbl = 23, lit = 24, lre = 25, flt = 26, rea = 27, wst = 28, wdf = 29, wrf = 30, hlt = 31, xpr = 32, xfn = 33, fid = 34, not = 35, ngt = 36, wff = 37, sto = 38, req = 39, rne = 40, rlt = 41, rle = 42, rgt = 43, rge = 44, ieq = 45, ine = 46, ilt = 47, ile = 48, igt = 49, ige = 50, bor = 51, iad = 52, isb = 53, rad = 54, rsb = 55, bad = 56, iml = 57, idv = 58, imd = 59, rml = 60, rdv = 61, elr = 62, elw = 63; char mnemonics[64][4]; char symbolname[52][15]; typedef char alfa[11]; // 11 = alng + 1 typedef int symset[52]; // 52 = nkw + 1 typedef int typset[8]; // 8 = number of types + 1 typedef int errors[59]; // 59 = ermax + 1 typedef struct item{ int typ; int ref; }item; typedef struct order{ int f; // function int x; // level int y; // adr }order; typedef struct tabrecord{ alfa name; int link, obj, typ, ref, normal, lev, adr; }tabrecord; typedef struct atabrecord{ int inxtyp, eltyp, elref, low, high, elsize, size; }atabrecord; typedef struct btabrecord{ int last, lastpar, psize, vsize; }btabrecord; typedef struct casetabrecord{ int val, lc; }casetabrecord; typedef struct conrec{ int tp; int i; double r; }conrec; typedef union types{ int i; double r; int b; char c; }types; int sy; // Last symbol read by insymbol alfa id; // identifier form insymbol int inum; // integer value from insymbol double rnum; // real value from insymbol int sleng; // string length char ch; // last char read from input char line[251]; // 251 = llng + 1 int cc; // char count int lc; // location counter int ll; // length of current line errors errs; int errpos; alfa progname; int iflag, oflag; symset constbegsys, typebegsys, blockbegsys, facbegsys, statbegsys, addSym; alfa key[52]; // 52 = nkw + 1 key word test array int ksy[52]; // 52 = nkw + 1 key word symbol array int sps[256]; // char symbol array int t, a, b, sx, c1, c2; // table indicies typset stantyps; int display[100]; // 100 = lmax tabrecord tab[10000]; // 10000 = tmax atabrecord atab[1001]; // 1001 = amax + 1 btabrecord btab[1001]; // 1001 = bmax + 1 char stab[100000]; // string table double rconst[1001]; // 1001 = c2max + 1 order code[100000]; // 100000 = cmax char srcfilname[250]; // source file name FILE *srcfil; // source file int inPas = 0; // in running program void nextch(); int checkword(char[], char[]); void fatal(int); void error(int); void test(symset, symset, int); int testsym(symset, int); void skip(symset, int); void emit(int); void emit1(int, int); void emit2(int, int, int); void block(symset, int, int); void typ(symset, int*, int*, int*, int); //void arraytyp(int*, int*); int findindex(symset); void testsemicolon(symset); int checkword(alfa w1, alfa w2){ //if ( lnfeedback == 1 ) printf("\nENTERING CHECKWORD\n"); int i,j; j=0; for (i=0;i<=alng;i++){ if (w1[i]w2[i]) return 1; } if (j==0) return 0; }/* end checkword */ void insymbol(){ int i, j, k, e, stop, stop2; void readscale(){ int s, sign; nextch(); sign = 1; s = 0; if (ch == '+') nextch(); else if (ch == '-') { nextch(); sign = -1; } while ((ch >= '0') && (ch <= '9')){ s = 10*s + ch - '0'; nextch(); } e = s*sign + e; }// end readscale void adjustscale(){ int s; double d, t; if(k+e > emax) error(21); else if(k+e < emin) rnum = 0; else { s = (e >0 ? e : -e); t = 1.0; d = 10.0; do { while(!s%2){ s = s/2; d = sqrt(d); } s = s - 1; t = d * t; }while (s); if(e >= 0) rnum = rnum * t; else rnum = rnum/t; } }//end adjustscale // begin in symbol stop = 0; stop2 = 0; while(!stop){ while((ch == 9) || (ch == 10) || (ch == 13) || (ch == 32))nextch(); // whitespace if(((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))){// word k = 0; strcpy(id, " "); do { if(k < alng){ id[k] = ch; k = k + 1; } nextch(); }while((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z')); i = 1; j = nkw; do { k = (i + j) / 2; if(checkword(id, key[k]) <= 0) { j = k - 1; } if(checkword(id, key[k]) >= 0) { i = k + 1; } }while( j >= i); if( i - 1 > j) sy = ksy[k]; else sy = ident; stop = 1; }// end word else if ((ch >= '0') && (ch <= '9')){// number k = 0; inum = 0; sy = intcon; do { inum = (inum *10) + (ch - '0'); k = k + 1; nextch(); }while(ch >= '0' && ch <= '9'); if ((k > kmax) || (inum > nmax)){ printf("k = %d > kmax = %d or inum = %d > nmax = %ld\n",k, kmax, inum, nmax); error(21); inum = 0; k = 0; } if(ch == '.'){ nextch(); if(ch == '.') ch = ':'; else{ sy = realcon; rnum = inum; e = 0; while ((ch >= '0') && (ch <= '9')){ e = e-1; rnum = 10.0 * rnum + ch - '0'; nextch(); } if (ch == 'e') readscale(); if (e) adjustscale(); } } else if(ch == 'e'){ sy = realcon; rnum = inum; e = 0; readscale(); if(e) adjustscale(); } stop=1; }// end number else switch(ch){ case ':': nextch(); if(ch == '='){ sy = becomes; nextch(); } else sy = colon; stop = 1; break; case '<': nextch(); if(ch == '=') {sy = leg;nextch();} else if(ch == '>') {sy = neg;nextch();} else sy = lss; stop = 1; break; case '>': nextch(); if (ch == '=') {sy = geg; nextch();}else sy = gtr; stop = 1; break; case '.': nextch(); if (ch == '.'){sy = colon; nextch();} else sy = period; stop = 1; break; case '\'': k = 0; while(!stop2){ nextch(); if (ch == '\''){ nextch(); if(ch != '\''){ break; } } if (sx + k == smax) fatal(7); stab[sx + k] = ch; k = k + 1; if (cc == 1) { k = 0; stop2 = 1; } } if(k == 1) { sy = charcon; inum = stab[sx]; } else if (k == 0) { error(38); sy = charcon; inum = 0; } else { sy = stringt; inum = sx; sleng = k; sx = sx + k; } stop = 1; break; case '(': nextch(); if (ch != '*') sy = lparent; else {// comment nextch(); do{ while(ch != '*') nextch(); nextch(); }while( ch !=')'); nextch(); continue; } stop = 1; break; case '+': case '-': case '*': case '/': case ')': case '=': case ',': case '[': case ']': case '#': case '&': case ';': sy = sps[ch]; nextch(); stop = 1; break; default : error(24); exit(1); nextch(); break; } }// end while true to emulate goto 1 if(feedbacklevel == 0 || feedbacklevel ==3) printf("\t\tsy=%s\n",symbolname[sy]); }// end insymbol void enterarray(int tp, int l, int h){ if ( lnfeedback == 1 ) printf("\n\t\t\t\tENTERING enterarray - 2\n"); if (l > h) error(27); if((abs(l) > xmax) || (abs(h) > xmax)){ error(27); l = 0; h = 0; } if (a == amax) fatal(4); else { a = a+1; atab[a].inxtyp = tp; atab[a].low = l; atab[a].high = h; } }// end enterarray void enterblock(){ if ( lnfeedback == 1 ) printf("\n\t\t\t\tENTERING enterblock - 3\n"); if (b == bmax)fatal(2); else { b = b + 1; btab[b].last = 0; btab[b].lastpar = 0; } }// end enterblock void enterreal(double x){ if ( lnfeedback == 1 ) printf("\n\t\t\t\tENTERING enterreal - 4\n"); if (c2 = c2max - 1) fatal(3); else { rconst[c2 + 1] = x ; c1 = 1; while(rconst[c1] != x) c1 = c1 +1; if (c1 > c2) c2 = c1; } }// end enterreal void enter(alfa id, int k, int level){ int j, l; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING enter - 14\n"); if (t == tmax) fatal(1); else { strcpy(tab[0].name, id); j = btab[display[level]].last; l = j; while (strcmp(tab[j].name, id)) j = tab[j].link; if(j) error(1); else{ t = t + 1; strcpy(tab[t].name, id); tab[t].link = l; tab[t].obj = k; tab[t].typ = notyp; tab[t].ref = 0; tab[t].lev = level; tab[t].adr = 0; btab[display[level]].last = t; } } }// end enter int loc(alfa id, int level){// locate id in table int i, j; //if ( lnfeedback == 1 ) printf("\nENTERING loc - 15\n"); i = level; strcpy(tab[0].name, id); do { j = btab[display[i]].last; //printf(" J before = %d\n", j); while(checkword(tab[j].name, id)) j = tab[j].link; i = i - 1; //printf(" J after = %d\n", j); }while(!((i < 0 ) || (j != 0))); if (j == 0) error(0); return j; }// end loc void entervariable(int level){ if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING entervariable - 16\n"); if(sy == ident) { enter(id, variable, level); insymbol(); } else error(2); }// end entervariable void constant(symset fsys, conrec *c, int level){ int x, it, sign; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING constant - 17\n"); c->tp = notyp; c->i = 0; test(constbegsys, fsys, 50); if(testsym(constbegsys, sy)){ if(sy == charcon){ c->tp = chars; c->i = inum; insymbol(); } else{ sign = 1; if(sy == plus || sy == minus){ if(sy == minus)sign = -1; insymbol(); } if(sy == ident){ x = loc(id,level); if(x) if(tab[x].obj != konstant) error(25); else{ c->tp = tab[x].typ; if(c->tp == reals) c->r = sign * rconst[tab[x].adr]; else c->i = sign * tab[x].adr; } insymbol(); } else if(sy == intcon){ c->tp = ints; c->i = sign * inum; insymbol(); } else if(sy == realcon){ c->tp = reals; c->r = sign * inum; insymbol(); } else skip(fsys, 50); } for(it = 1; it < 52; it++)addsym[it] = 0; test(fsys, addsym, 6); } }// end constant void parameterlist(int level, symset fsys, int *dx){ // formal parameters int tp, rf, sz, x, t0, valpar, it; symset addsym1, addsym2; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING parameterlist - 20\n"); insymbol(); tp = notyp; rf = 0; sz = 0; for(it = 0; it < 52; it ++){ addsym1[it] = 0; addsym2[it] = fsys[it]; } addsym1[1] = ident;addsym1[2] = varsy; if(!testsym(addsym2, rparent)) addsym2[findindex(addsym2)] = rparent; test(addsym1, addsym2, 7); while(sy == ident || sy == varsy){ if (sy != varsy) valpar = 1; else{ insymbol();valpar = 0; } t0 = t; entervariable(level); while(sy == comma){ insymbol();entervariable(level); } if(sy == colon){ insymbol(); if(sy != ident)error(2); else{ x = loc(id,level); insymbol(); if(x){ if(tab[x].obj != typel) error(29); else{ tp = tab[x].typ; rf = tab[x].ref; if(valpar) sz = tab[x].adr; else sz = 1; } } } for(it = 0; it < 52; it ++){ addsym1[it] = 0; addsym2[it] = fsys[it]; } addsym1[1] = semicolon; addsym1[2] = rparent; if(!testsym(addsym2, comma)) addsym2[findindex(addsym2)] = comma; if(!testsym(addsym2, ident)) addsym2[findindex(addsym2)] = ident; test(addsym1, addsym2, 14); } else error(5); while(t0 < t){ t0 = t0 + 1; tab[t0].typ = tp; tab[t0].ref = rf; tab[t0].normal = valpar; tab[t0].adr = *dx;tab[t0].lev = level; *dx = *dx + sz; } if(sy != rparent){ if(sy == semicolon) insymbol(); else{ error(14); if(sy == comma) insymbol(); } for(it=0; it < 52; it ++){ addsym1[it] = 0; addsym2[it] = fsys[it]; } addsym1[1] = ident; addsym1[2] = varsy; if(!testsym(addsym2, rparent)) addsym2[findindex(addsym2)] = rparent; test(addsym1, addsym2, 6); } } if(sy == rparent){ insymbol(); for(it=0; it < 52; it ++) addsym1[it] = 0; addsym1[1] = semicolon; addsym1[2] = colon; test(addsym1, fsys, 6); } else error(4); }// end parameters void constantdeclaration(int level, symset fsys){ conrec c; int it; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING constantdeclaration - 21\n"); insymbol(); for( it = 0; it < 52; it++) addsym[it] = 0; addsym[1] = ident; test(addsym, blockbegsys,2); while(sy == ident){ enter(id, konstant, level); insymbol(); if(sy == egl) insymbol(); else{ error(16); if(sy == becomes) insymbol(); } for( it = 0; it < 52; it++) addsym[it] = fsys[it]; if(!testsym(addsym, semicolon)) addsym[findindex(addsym)] = semicolon; if(!testsym(addsym, comma)) addsym[findindex(addsym)] = comma; if(!testsym(addsym, ident)) addsym[findindex(addsym)] = ident; constant(addsym, &c, level); tab[t].typ = c.tp; tab[t].ref = 0; if(c.tp == reals){ enterreal(c.r); tab[t].adr = c1; } else tab[t].adr = c.i; testsemicolon(fsys); } }// end constantdeclaration void typedeclaration(int level, symset fsys){ int tp; int rf,sz,t1,it; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING typedeclaration - 22\n"); insymbol(); for(it=0; it<52 ;it++)addsym[it] = 0; addsym[1] = ident; test(addsym, blockbegsys, 2); while(sy == ident){ enter(id, typel, level); t1 = t; insymbol(); if(sy == egl)insymbol(); else{ error(16); if(sy == becomes) insymbol(); } for(it=0; it<52; it++)addsym[it] = fsys[it]; if(!testsym(addsym, semicolon))addsym[findindex(addsym)] = semicolon; if(!testsym(addsym, comma))addsym[findindex(addsym)] = comma; if(!testsym(addsym, ident))addsym[findindex(addsym)] = ident; typ(addsym, &tp, &rf, &sz, level); tab[t1].typ = tp; tab[t1].ref = rf; tab[t1].adr = sz; testsemicolon(fsys); } }// end typedeclaration void variabledeclaration(int level, symset fsys, int *dx){ int t0, t1, rf, sz, it; int tp; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING variabledeclaration - 23\n"); insymbol(); while(sy == ident){ t0 = t; entervariable(level); while(sy == comma){ insymbol(); entervariable(level); } if(sy == colon) insymbol(); else error(5); t1 = t; for(it=0; it<52 ; it++)addsym[it] = fsys[it]; if(!testsym(addsym, semicolon))addsym[findindex(addsym)] = semicolon; if(!testsym(addsym, comma))addsym[findindex(addsym)] = comma; if(!testsym(addsym, ident))addsym[findindex(addsym)] = ident; typ(addsym, &tp, &rf, &sz, level); while (t0 < t1){ t0 = t0 +1; tab[t0].typ = tp; tab[t0].ref = rf; tab[t0].lev = level; tab[t0].adr = *dx; tab[t0].normal = 1; *dx = *dx + sz; if(feedbacklevel == 3 || feedbacklevel == 1) printf("\t\t\tvariable name: %s, typ: %d, ref: %d, level: %d, adr: %d, normal: %d\n", tab[t0].name, tab[t0].typ, tab[t0].ref, tab[t0].lev, tab[t0].adr, tab[t0].normal); } testsemicolon(fsys); } }// end variabledeclaration void procdeclaration(int level, symset fsys){ int isfun, it; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING procdeclaration - 24\n"); isfun = (sy == functionsy); insymbol(); if(sy != ident){ error(2); strcpy(id, " "); } if(isfun) enter(id, funktion, level); else enter(id, prozedure, level); tab[t].normal = 1; insymbol(); for(it = 0; it<52 ; it++)addsym[it] = fsys[it]; if(!testsym(addsym, semicolon))addsym[findindex(addsym)] = semicolon; block(addsym, isfun, level+1); if(sy == semicolon)insymbol(); else error(14); emit(32+isfun);//exit }// end procdeclaration void typ(symset fsys, int *tp, int *rf, int *sz, int level){ int x, it; int eltp, elrf; int elsz, offset, t0, t1; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\tENTERING typ - 18\n"); void arraytyp(int *aref, int *arsz){ int eltp, it; conrec low, high; int elrf, elsz; symset addsym; if ( lnfeedback == 1 ) printf("\n\t\t\t\t\t\tENTERING arraytyp - 19\n"); for(it = 0; it < 52; it++)addsym[it] = fsys[it]; if(!testsym(addsym, colon)) addsym[findindex(addsym)] = colon; if(!testsym(addsym, rbrack)) addsym[findindex(addsym)] = rbrack; if(!testsym(addsym, rparent)) addsym[findindex(addsym)] = rparent; if(!testsym(addsym, ofsy)) addsym[findindex(addsym)] = ofsy; constant(addsym, &low, level); if(low.tp == reals){ error(27); low.tp = ints; low.i = 0; } if(sy == colon) insymbol(); else error(13); for(it = 0; it < 52; it++)addsym[it] = fsys[it]; if(!testsym(addsym, comma)) addsym[findindex(addsym)] = comma; if(!testsym(addsym, rbrack)) addsym[findindex(addsym)] = rbrack; if(!testsym(addsym, rparent)) addsym[findindex(addsym)] = rparent; if(!testsym(addsym, ofsy)) addsym[findindex(addsym)] = ofsy; constant(addsym, &high, level); if(high.tp != low.tp) { error(27); high.i = low.i; } enterarray(low.tp, low.i, high.i); *aref = a; if(sy == comma){ insymbol(); eltp = arrays; arraytyp(&elrf, &elsz); } else{ if(sy == rbrack) insymbol(); else{ error(12); if(sy == rparent) insymbol(); } if(sy == ofsy) insymbol(); else error(8); typ(fsys, &eltp, &elrf, &elsz, level); } *arsz = (atab[*aref].high - atab[*aref].low + 1)* elsz; atab[*aref].size = *arsz; atab[*aref].eltyp = eltp; atab[*aref].elref = elrf; atab[*aref].elsize = elsz; }// end arraytyp // start typ *tp = notyp; *rf = 0; *sz = 0; test(typebegsys, fsys, 10); if(testsym(typebegsys, sy)){ if(sy == ident){ x = loc(id,level); if(x){ if(tab[x].obj != typel) error(29); else{ *tp = tab[x].typ; *rf = tab[x].ref; *sz = tab[x].adr; if(*tp == notyp) error(30); } insymbol(); } } else if(sy == arraysy){ insymbol(); if(sy == lbrack)insymbol(); else{ error(11); if(sy == lparent) insymbol(); } *tp = arrays; arraytyp(rf, sz); } else{// record insymbol(); enterblock(); *tp = records; *rf = b; if (level == lmax) fatal(5); level = level + 1; display[level] = b; offset = 0; while(sy != endsy){ if(sy == ident){// fields t0 = t; entervariable(level); while(sy == comma) { insymbol(); entervariable(level); } if(sy == colon) insymbol(); else error(5); t1 = t; for(it=0; it < 52; it++)addsym[it] = fsys[it]; if(!testsym(addsym, semicolon)) addsym[findindex(addsym)] = semicolon; if(!testsym(addsym, endsy)) addsym[findindex(addsym)] = endsy; if(!testsym(addsym, comma)) addsym[findindex(addsym)] = comma; if(!testsym(addsym, ident)) addsym[findindex(addsym)] = ident; typ(addsym, &eltp, &elrf, &elsz, level); while(t0 < t1){ t0 = t0 + 1; tab[t0].typ = eltp; tab[t0].ref = elrf; tab[t0].normal = 1; tab[t0].adr = offset; offset = offset + elsz; } } if(sy != endsy){ if(sy == semicolon) insymbol(); else{ error(14); if(sy == comma) insymbol(); } for(it=0; it< 52; it++)addsym[it] = 0; addsym[1] = ident; addsym[2] = endsy; addsym[3] = semicolon; test(addsym, fsys, 6); } } btab[*rf].vsize = offset; *sz = offset; btab[*rf].psize = 0; insymbol(); level = level -1; } for(it=0; it < 52; it++)addsym[it] = 0; test(fsys, addsym, 6); } }// end typ void printtables(){ int i; int o; printf("identifiers link obj typ ref nrm lev adr\n\n"); for(i = btab[1].last + 1 ; i <= t; i++) printf("%d %s%5d%5d%5d%5d%5d%5d%5d\n", i, tab[i].name, tab[i].link, tab[i].obj, tab[i].typ, tab[i].ref, tab[i].normal, tab[i].lev, tab[i].adr); printf("blocks last lpar psze vsze\n\n"); for(i = 1; i <= b; i++) printf("%10d%5d%5d%5d%5d\n",i, btab[i].last, btab[i].lastpar, btab[i].psize, btab[i].vsize); printf("arrays xtyp etyp eref low high elsz size\n\n"); for(i = 1; i<= a; i++) printf("%6d %5d%5d%5d%5d%5d%5d%5d\n", i, atab[i].inxtyp, atab[i].eltyp, atab[i].elref, atab[i].low, atab[i].high, atab[i].elsize, atab[i].size); printf("\n"); printf("code:\n\n"); for(i = 0; i <= lc - 1; i++){ printf("Line: %5d)",i); printf(" func: %5d", code[i].f); if((code[i].f <31) || (code[i].f == 36)) if(code[i].f < 4)printf(" parm: %2d y: %5d",code[i].x, code[i].y); else /*printf(" option: %7d",code[i].y);*/ printf(" parm: %2d y: %5d",code[i].x, code[i].y); else printf(" "); printf("\n"); } printf("\n"); }// end printtables