1: #include "lex.h" 2: 3: /* 4: * State tables for operator recognition. 5: */ 6: 7: struct optab state0[] = { /* initial state */ 8: { ',', A_IMMRET, (int) &toktab[ 59] }, /* "," */ 9: { '.', A_IMMRET, (int) &toktab[ 63] }, /* "." */ 10: { '[', A_IMMRET, (int) &toktab[ 70] }, /* "[" */ 11: { ']', A_IMMRET, (int) &toktab[ 99] }, /* "]" */ 12: { '(', A_IMMRET, (int) &toktab[ 79] }, /* "(" */ 13: { ')', A_IMMRET, (int) &toktab[100] }, /* ")" */ 14: { ';', A_IMMRET, (int) &toktab[101] }, /* ";" */ 15: { '{', A_IMMRET, (int) &toktab[ 69] }, /* "{" */ 16: { '}', A_IMMRET, (int) &toktab[ 98] }, /* "}" */ 17: { '!', A_IMMRET, (int) &toktab[ 54] }, /* "!" */ 18: { '\\', A_IMMRET, (int) &toktab[ 53] }, /* "\\" */ 19: { ':', A_GOTO, (int) state1 }, /* ":" ... */ 20: { '<', A_GOTO, (int) state2 }, /* "<" ... */ 21: { '>', A_GOTO, (int) state4 }, /* ">" ... */ 22: { '=', A_GOTO, (int) state5 }, /* "=" ... */ 23: { '|', A_GOTO, (int) state3 }, /* "|" ... */ 24: { '+', A_GOTO, (int) state7 }, /* "+" ... */ 25: { '-', A_GOTO, (int) state8 }, /* "-" ... */ 26: { '*', A_GOTO, (int) state9 }, /* "*" ... */ 27: { '^', A_GOTO, (int) state6 }, /* "^" ... */ 28: { '~', A_GOTO, (int) state29 }, /* "~" ... */ 29: { '/', A_GOTO, (int) state21 }, /* "/" ... */ 30: { '%', A_GOTO, (int) state30 }, /* "%" ... */ 31: { '?', A_GOTO, (int) state36 }, /* "?" ... */ 32: { '&', A_GOTO, (int) state38 }, /* "&" ... */ 33: { '@', A_GOTO, (int) state40 }, /* "@" ... */ 34: { 0, A_ERROR, 0 } 35: }; 36: 37: struct optab state1[] = { /* ":" */ 38: { '=', A_GOTO, (int) state10 }, /* ":=" ... */ 39: { 0, A_RETURN, (int) &toktab[ 58] } /* ":" */ 40: }; 41: 42: struct optab state2[] = { /* "<" */ 43: { '-', A_GOTO, (int) state11 }, /* "<-" ... */ 44: { '<', A_GOTO, (int) state32 }, /* "<<" ... */ 45: { ':', A_GOTO, (int) state46 }, /* "<:" ... */ 46: { '=', A_GOTO, (int) state56 }, /* "<=" ... */ 47: { 0, A_RETURN, (int) &toktab[ 90] } /* "<" */ 48: }; 49: 50: struct optab state3[] = { /* "|" */ 51: { '|', A_GOTO, (int) state22 }, /* "||" ... */ 52: { 0, A_RETURN, (int) &toktab[ 55] } /* "|" */ 53: }; 54: 55: struct optab state4[] = { /* ">" */ 56: { '>', A_GOTO, (int) state33 }, /* ">>" ... */ 57: { ':', A_GOTO, (int) state44 }, /* ">:" ... */ 58: { '=', A_GOTO, (int) state57 }, /* ">=" ... */ 59: { 0, A_RETURN, (int) &toktab[ 88] } /* ">" */ 60: }; 61: 62: struct optab state5[] = { /* "=" */ 63: { '=', A_GOTO, (int) state12 }, /* "==" ... */ 64: { ':', A_GOTO, (int) state42 }, /* "=:" ... */ 65: { 0, A_RETURN, (int) &toktab[ 86] } /* "=" */ 66: }; 67: 68: struct optab state6[] = { /* "^" */ 69: { ':', A_GOTO, (int) state23 }, /* "^:" ... */ 70: { 0, A_RETURN, (int) &toktab[ 56] } /* "^" */ 71: }; 72: 73: struct optab state7[] = { /* "+" */ 74: { ':', A_GOTO, (int) state15 }, /* "+:" ... */ 75: { '+', A_GOTO, (int) state16 }, /* "++" ... */ 76: { 0, A_RETURN, (int) &toktab[ 93] } /* "+" */ 77: }; 78: 79: struct optab state8[] = { /* "-" */ 80: { ':', A_GOTO, (int) state17 }, /* "-:" ... */ 81: { '-', A_GOTO, (int) state18 }, /* "--" ... */ 82: { 0, A_RETURN, (int) &toktab[ 81] } /* "-" */ 83: }; 84: 85: struct optab state9[] = { /* "*" */ 86: { ':', A_GOTO, (int) state19 }, /* "*:" ... */ 87: { '*', A_GOTO, (int) state20 }, /* "**" ... */ 88: { 0, A_RETURN, (int) &toktab[105] } /* "*" */ 89: }; 90: 91: struct optab state10[] = { /* ":=" */ 92: { ':', A_IMMRET, (int) &toktab[107] }, /* ":=:" */ 93: { 0, A_RETURN, (int) &toktab[ 35] } /* ":=" */ 94: }; 95: 96: struct optab state11[] = { /* "<-" */ 97: { '>', A_IMMRET, (int) &toktab[ 97] }, /* "<->" */ 98: { 0, A_RETURN, (int) &toktab[ 96] } /* "<-" */ 99: }; 100: 101: struct optab state12[] = { /* "==" */ 102: { '=', A_GOTO, (int) state61 }, /* "===" ... */ 103: { ':', A_GOTO, (int) state48 }, /* "==:" ... */ 104: { 0, A_RETURN, (int) &toktab[ 73] } /* "==" */ 105: }; 106: 107: struct optab state13[] = { /* "~=" */ 108: { '=', A_GOTO, (int) state14 }, /* "~==" ... */ 109: { ':', A_GOTO, (int) state43 }, /* "~=:" ... */ 110: { 0, A_RETURN, (int) &toktab[ 91] } /* "~=" */ 111: }; 112: 113: struct optab state14[] = { /* "~==" */ 114: { ':', A_GOTO, (int) state49 }, /* "~==:" ... */ 115: { '=', A_GOTO, (int) state60 }, /* "~===" ... */ 116: { 0, A_RETURN, (int) &toktab[ 78] } /* "~==" */ 117: }; 118: 119: struct optab state15[] = { /* "+:" */ 120: { '=', A_IMMRET, (int) &toktab[ 94] }, /* "+:=" */ 121: { 0, A_RETURN, (int) &toktab[ 92] } /* "+:" */ 122: }; 123: 124: struct optab state16[] = { /* "++" */ 125: { ':', A_GOTO, (int) state24 }, /* "++:" ... */ 126: { 0, A_RETURN, (int) &toktab[109] } /* "++" */ 127: }; 128: 129: struct optab state17[] = { /* "-:" */ 130: { '=', A_IMMRET, (int) &toktab[ 82] }, /* "-:=" */ 131: { 0, A_RETURN, (int) &toktab[ 80] } /* "-:" */ 132: }; 133: 134: struct optab state18[] = { /* "--" */ 135: { ':', A_GOTO, (int) state25 }, /* "--:" ... */ 136: { 0, A_RETURN, (int) &toktab[ 64] } /* "--" */ 137: }; 138: 139: struct optab state19[] = { /* "*:" */ 140: { '=', A_IMMRET, (int) &toktab[106] }, /* "*:=" */ 141: { 0, A_ERROR, 0 } 142: }; 143: 144: struct optab state20[] = { /* "**" */ 145: { ':', A_GOTO, (int) state26 }, /* "**:" ... */ 146: { 0, A_RETURN, (int) &toktab[ 67] } /* "**" */ 147: }; 148: 149: struct optab state21[] = { /* "/" */ 150: { ':', A_GOTO, (int) state27 }, /* "/:" ... */ 151: { 0, A_RETURN, (int) &toktab[103] } /* "/" */ 152: }; 153: 154: struct optab state22[] = { /* "||" */ 155: { ':', A_GOTO, (int) state28 }, /* "||:" ... */ 156: { '|', A_GOTO, (int) state34 }, /* "|||" ... */ 157: { 0, A_RETURN, (int) &toktab[ 60] } /* "||" */ 158: }; 159: 160: struct optab state23[] = { /* "^:" */ 161: { '=', A_IMMRET, (int) &toktab[ 57] }, /* "^:=" */ 162: { 0, A_ERROR, 0 } 163: }; 164: 165: struct optab state24[] = { /* "++:" */ 166: { '=', A_IMMRET, (int) &toktab[110] }, /* "++:=" */ 167: { 0, A_ERROR, 0 } 168: }; 169: 170: struct optab state25[] = { /* "--:" */ 171: { '=', A_IMMRET, (int) &toktab[ 65] }, /* "--:=" */ 172: { 0, A_ERROR, 0 } 173: }; 174: 175: struct optab state26[] = { /* "**:" */ 176: { '=', A_IMMRET, (int) &toktab[ 68] }, /* "**:=" */ 177: { 0, A_ERROR, 0 } 178: }; 179: 180: struct optab state27[] = { /* "/:" */ 181: { '=', A_IMMRET, (int) &toktab[104] }, /* "/:=" */ 182: { 0, A_ERROR, 0 } 183: }; 184: 185: struct optab state28[] = { /* "||:" */ 186: { '=', A_IMMRET, (int) &toktab[ 61] }, /* "||:=" */ 187: { 0, A_ERROR, 0 } 188: }; 189: 190: struct optab state29[] = { /* "~" */ 191: { '=', A_GOTO, (int) state13 }, /* "~=" ... */ 192: { 0, A_RETURN, (int) &toktab[108] } /* "~" */ 193: }; 194: 195: struct optab state30[] = { /* "%" */ 196: { ':', A_GOTO, (int) state31 }, /* "%:" ... */ 197: { 0, A_RETURN, (int) &toktab[ 83] } /* "%" */ 198: }; 199: 200: struct optab state31[] = { /* "%:" */ 201: { '=', A_IMMRET, (int) &toktab[ 84] }, /* "%:=" */ 202: { 0, A_ERROR, 0 } 203: }; 204: 205: struct optab state32[] = { /* "<<" */ 206: { ':', A_GOTO, (int) state52 }, /* "<<:" ... */ 207: { '=', A_GOTO, (int) state58 }, /* "<<=" ... */ 208: { 0, A_RETURN, (int) &toktab[ 77] } /* "<<" */ 209: }; 210: 211: struct optab state33[] = { /* ">>" */ 212: { ':', A_GOTO, (int) state50 }, /* ">>:" ... */ 213: { '=', A_GOTO, (int) state59 }, /* ">>=" ... */ 214: { 0, A_RETURN, (int) &toktab[ 75] } /* ">>" */ 215: }; 216: 217: struct optab state34[] = { /* "|||" */ 218: { ':', A_GOTO, (int) state35 }, /* "|||:" ... */ 219: { 0, A_RETURN, (int) &toktab[ 71] } /* "|||" */ 220: }; 221: 222: struct optab state35[] = { /* "|||:" */ 223: { '=', A_IMMRET, (int) &toktab[ 72] }, /* "|||:=" */ 224: { 0, A_ERROR, 0 } 225: }; 226: 227: struct optab state36[] = { /* "?" */ 228: { ':', A_GOTO, (int) state37 }, /* "?:" ... */ 229: { 0, A_RETURN, (int) &toktab[ 95] } /* "?" */ 230: }; 231: 232: struct optab state37[] = { /* "?:" */ 233: { '=', A_IMMRET, (int) &toktab[102] }, /* "?:=" */ 234: { 0, A_ERROR, 0 } 235: }; 236: 237: struct optab state38[] = { /* "&" */ 238: { ':', A_GOTO, (int) state39 }, /* "&:" ... */ 239: { 0, A_RETURN, (int) &toktab[ 62] } /* "&" */ 240: }; 241: 242: struct optab state39[] = { /* "&:" */ 243: { '=', A_IMMRET, (int) &toktab[ 38] }, /* "&:=" */ 244: { 0, A_ERROR, 0 } 245: }; 246: 247: struct optab state40[] = { /* "@" */ 248: { ':', A_GOTO, (int) state41 }, /* "@:" ... */ 249: { 0, A_RETURN, (int) &toktab[ 36] } /* "@" */ 250: }; 251: 252: struct optab state41[] = { /* "@:" */ 253: { '=', A_IMMRET, (int) &toktab[ 37] }, /* "@:=" */ 254: { 0, A_ERROR, 0 } 255: }; 256: 257: struct optab state42[] = { /* "=:" */ 258: { '=', A_IMMRET, (int) &toktab[ 39] }, /* "=:=" */ 259: { 0, A_ERROR, 0 } 260: }; 261: 262: struct optab state43[] = { /* "~=:" */ 263: { '=', A_IMMRET, (int) &toktab[ 45] }, /* "~=:=" */ 264: { 0, A_ERROR, 0 } 265: }; 266: 267: struct optab state44[] = { /* ">:" */ 268: { '=', A_IMMRET, (int) &toktab[ 42] }, /* ">:=" */ 269: { 0, A_ERROR, 0 } 270: }; 271: 272: struct optab state45[] = { /* ">=:" */ 273: { '=', A_IMMRET, (int) &toktab[ 41] }, /* ">=:=" */ 274: { 0, A_ERROR, 0 } 275: }; 276: 277: struct optab state46[] = { /* "<:" */ 278: { '=', A_IMMRET, (int) &toktab[ 44] }, /* "<:=" */ 279: { 0, A_ERROR, 0 } 280: }; 281: 282: struct optab state47[] = { /* "<=:" */ 283: { '=', A_IMMRET, (int) &toktab[ 43] }, /* "<=:=" */ 284: { 0, A_ERROR, 0 } 285: }; 286: 287: struct optab state48[] = { /* "==:" */ 288: { '=', A_IMMRET, (int) &toktab[ 47] }, /* "==:=" */ 289: { 0, A_ERROR, 0 } 290: }; 291: 292: struct optab state49[] = { /* "~==:" */ 293: { '=', A_IMMRET, (int) &toktab[ 52] }, /* "~==:=" */ 294: { 0, A_ERROR, 0 } 295: }; 296: 297: struct optab state50[] = { /* ">>:" */ 298: { '=', A_IMMRET, (int) &toktab[ 49] }, /* ">>:=" */ 299: { 0, A_ERROR, 0 } 300: }; 301: 302: struct optab state51[] = { /* ">>=:" */ 303: { '=', A_IMMRET, (int) &toktab[ 48] }, /* ">>=:=" */ 304: { 0, A_ERROR, 0 } 305: }; 306: 307: struct optab state52[] = { /* "<<:" */ 308: { '=', A_IMMRET, (int) &toktab[ 51] }, /* "<<:=" */ 309: { 0, A_ERROR, 0 } 310: }; 311: 312: struct optab state53[] = { /* "<<=:" */ 313: { '=', A_IMMRET, (int) &toktab[ 50] }, /* "<<=:=" */ 314: { 0, A_ERROR, 0 } 315: }; 316: 317: struct optab state54[] = { /* "===:" */ 318: { '=', A_IMMRET, (int) &toktab[ 40] }, /* "===:=" */ 319: { 0, A_ERROR, 0 } 320: }; 321: 322: struct optab state55[] = { /* "~===:" */ 323: { '=', A_IMMRET, (int) &toktab[ 46] }, /* "~===:=" */ 324: { 0, A_ERROR, 0 } 325: }; 326: 327: struct optab state56[] = { /* "<=" */ 328: { ':', A_GOTO, (int) state47 }, /* "<=:" ... */ 329: { 0, A_RETURN, (int) &toktab[ 89] } /* "<=" */ 330: }; 331: 332: struct optab state57[] = { /* ">=" */ 333: { ':', A_GOTO, (int) state45 }, /* ">=:" ... */ 334: { 0, A_RETURN, (int) &toktab[ 87] } /* ">=" */ 335: }; 336: 337: struct optab state58[] = { /* "<<=" */ 338: { ':', A_GOTO, (int) state53 }, /* "<<=:" ... */ 339: { 0, A_RETURN, (int) &toktab[ 76] } /* "<<=" */ 340: }; 341: 342: struct optab state59[] = { /* ">>=" */ 343: { ':', A_GOTO, (int) state51 }, /* ">>=:" ... */ 344: { 0, A_RETURN, (int) &toktab[ 74] } /* ">>=" */ 345: }; 346: 347: struct optab state60[] = { /* "~===" */ 348: { ':', A_GOTO, (int) state55 }, /* "~===:" ... */ 349: { 0, A_RETURN, (int) &toktab[ 85] } /* "~===" */ 350: }; 351: 352: struct optab state61[] = { /* "===" */ 353: { ':', A_GOTO, (int) state54 }, /* "===:" ... */ 354: { 0, A_RETURN, (int) &toktab[ 66] } /* "===" */ 355: };