1: #include "awk.def" 2: obj nullproc(); 3: extern obj program(); 4: extern obj boolop(); 5: extern obj relop(); 6: extern obj array(); 7: extern obj indirect(); 8: extern obj substr(); 9: extern obj sindex(); 10: extern obj asprintf(); 11: extern obj arith(); 12: extern obj incrdecr(); 13: extern obj cat(); 14: extern obj pastat(); 15: extern obj dopa2(); 16: extern obj matchop(); 17: extern obj aprintf(); 18: extern obj print(); 19: extern obj split(); 20: extern obj assign(); 21: extern obj ifstat(); 22: extern obj whilestat(); 23: extern obj forstat(); 24: extern obj instat(); 25: extern obj jump(); 26: extern obj fncn(); 27: obj (*proctab[75])() { 28: /*FIRSTTOKEN*/ nullproc, 29: /*FINAL*/ nullproc, 30: /*FATAL*/ nullproc, 31: /*LT*/ relop, 32: /*LE*/ relop, 33: /*GT*/ relop, 34: /*GE*/ relop, 35: /*EQ*/ relop, 36: /*NE*/ relop, 37: /*MATCH*/ matchop, 38: /*NOTMATCH*/ matchop, 39: /*APPEND*/ nullproc, 40: /*ADD*/ arith, 41: /*MINUS*/ arith, 42: /*MULT*/ arith, 43: /*DIVIDE*/ arith, 44: /*MOD*/ arith, 45: /*UMINUS*/ arith, 46: /*ASSIGN*/ assign, 47: /*ADDEQ*/ assign, 48: /*SUBEQ*/ assign, 49: /*MULTEQ*/ assign, 50: /*DIVEQ*/ assign, 51: /*MODEQ*/ assign, 52: /*JUMP*/ nullproc, 53: /*XBEGIN*/ nullproc, 54: /*XEND*/ nullproc, 55: /*NL*/ nullproc, 56: /*PRINT*/ print, 57: /*PRINTF*/ aprintf, 58: /*SPRINTF*/ asprintf, 59: /*SPLIT*/ split, 60: /*IF*/ ifstat, 61: /*ELSE*/ nullproc, 62: /*WHILE*/ whilestat, 63: /*FOR*/ forstat, 64: /*IN*/ instat, 65: /*NEXT*/ jump, 66: /*EXIT*/ jump, 67: /*BREAK*/ jump, 68: /*CONTINUE*/ jump, 69: /*PROGRAM*/ program, 70: /*PASTAT*/ pastat, 71: /*PASTAT2*/ dopa2, 72: /*ASGNOP*/ nullproc, 73: /*BOR*/ boolop, 74: /*AND*/ boolop, 75: /*NOT*/ boolop, 76: /*NUMBER*/ nullproc, 77: /*VAR*/ nullproc, 78: /*ARRAY*/ array, 79: /*FNCN*/ fncn, 80: /*SUBSTR*/ substr, 81: /*LSUBSTR*/ nullproc, 82: /*INDEX*/ sindex, 83: /*RELOP*/ nullproc, 84: /*MATCHOP*/ nullproc, 85: /*OR*/ nullproc, 86: /*STRING*/ nullproc, 87: /*DOT*/ nullproc, 88: /*CCL*/ nullproc, 89: /*NCCL*/ nullproc, 90: /*CHAR*/ nullproc, 91: /*CAT*/ cat, 92: /*STAR*/ nullproc, 93: /*PLUS*/ nullproc, 94: /*QUEST*/ nullproc, 95: /*POSTINCR*/ incrdecr, 96: /*PREINCR*/ incrdecr, 97: /*POSTDECR*/ incrdecr, 98: /*PREDECR*/ incrdecr, 99: /*INCR*/ nullproc, 100: /*DECR*/ nullproc, 101: /*FIELD*/ nullproc, 102: /*INDIRECT*/ indirect, 103: }; 104: char *printname[75] { 105: /*FIRSTTOKEN*/ "(null)", 106: /*FINAL*/ "(null)", 107: /*FATAL*/ "(null)", 108: /*LT*/ " < ", 109: /*LE*/ " <= ", 110: /*GT*/ " > ", 111: /*GE*/ " >= ", 112: /*EQ*/ " == ", 113: /*NE*/ " != ", 114: /*MATCH*/ " ~ ", 115: /*NOTMATCH*/ " !~ ", 116: /*APPEND*/ "(null)", 117: /*ADD*/ " + ", 118: /*MINUS*/ " - ", 119: /*MULT*/ " * ", 120: /*DIVIDE*/ " / ", 121: /*MOD*/ " % ", 122: /*UMINUS*/ " -", 123: /*ASSIGN*/ " = ", 124: /*ADDEQ*/ " += ", 125: /*SUBEQ*/ " -= ", 126: /*MULTEQ*/ " *= ", 127: /*DIVEQ*/ " /= ", 128: /*MODEQ*/ " %= ", 129: /*JUMP*/ "(null)", 130: /*XBEGIN*/ "(null)", 131: /*XEND*/ "(null)", 132: /*NL*/ "(null)", 133: /*PRINT*/ "print", 134: /*PRINTF*/ "printf", 135: /*SPRINTF*/ "sprintf ", 136: /*SPLIT*/ "split", 137: /*IF*/ "if(", 138: /*ELSE*/ "(null)", 139: /*WHILE*/ "while(", 140: /*FOR*/ "for(", 141: /*IN*/ "instat", 142: /*NEXT*/ "next", 143: /*EXIT*/ "exit", 144: /*BREAK*/ "break", 145: /*CONTINUE*/ "continue", 146: /*PROGRAM*/ "(null)", 147: /*PASTAT*/ "(null)", 148: /*PASTAT2*/ "(null)", 149: /*ASGNOP*/ "(null)", 150: /*BOR*/ " || ", 151: /*AND*/ " && ", 152: /*NOT*/ " !", 153: /*NUMBER*/ "(null)", 154: /*VAR*/ "(null)", 155: /*ARRAY*/ "(null)", 156: /*FNCN*/ "fncn", 157: /*SUBSTR*/ "substr", 158: /*LSUBSTR*/ "(null)", 159: /*INDEX*/ "sindex", 160: /*RELOP*/ "(null)", 161: /*MATCHOP*/ "(null)", 162: /*OR*/ "(null)", 163: /*STRING*/ "(null)", 164: /*DOT*/ "(null)", 165: /*CCL*/ "(null)", 166: /*NCCL*/ "(null)", 167: /*CHAR*/ "(null)", 168: /*CAT*/ " ", 169: /*STAR*/ "(null)", 170: /*PLUS*/ "(null)", 171: /*QUEST*/ "(null)", 172: /*POSTINCR*/ "++", 173: /*PREINCR*/ "++", 174: /*POSTDECR*/ "--", 175: /*PREDECR*/ "--", 176: /*INCR*/ "(null)", 177: /*DECR*/ "(null)", 178: /*FIELD*/ "(null)", 179: /*INDIRECT*/ "$(", 180: };