1: # define CSETLIT 257 2: # define EOFX 258 3: # define IDENT 259 4: # define INTLIT 260 5: # define REALLIT 261 6: # define STRINGLIT 262 7: # define BREAK 263 8: # define BY 264 9: # define CASE 265 10: # define CREATE 266 11: # define DEFAULT 267 12: # define DO 268 13: # define DYNAMIC 269 14: # define ELSE 270 15: # define END 271 16: # define EVERY 272 17: # define FAIL 273 18: # define GLOBAL 274 19: # define IF 275 20: # define INITIAL 276 21: # define LINK 277 22: # define LOCAL 278 23: # define NEXT 279 24: # define NOT 280 25: # define OF 281 26: # define PROCEDURE 282 27: # define RECORD 283 28: # define REPEAT 284 29: # define RETURN 285 30: # define STATIC 286 31: # define SUSPEND 287 32: # define THEN 288 33: # define TO 289 34: # define UNTIL 290 35: # define WHILE 291 36: # define ASSIGN 292 37: # define AT 293 38: # define AUGACT 294 39: # define AUGAND 295 40: # define AUGEQ 296 41: # define AUGEQV 297 42: # define AUGGE 298 43: # define AUGGT 299 44: # define AUGLE 300 45: # define AUGLT 301 46: # define AUGNE 302 47: # define AUGNEQV 303 48: # define AUGSEQ 304 49: # define AUGSGE 305 50: # define AUGSGT 306 51: # define AUGSLE 307 52: # define AUGSLT 308 53: # define AUGSNE 309 54: # define BACKSLASH 310 55: # define BANG 311 56: # define BAR 312 57: # define CARET 313 58: # define CARETASGN 314 59: # define COLON 315 60: # define COMMA 316 61: # define CONCAT 317 62: # define CONCATASGN 318 63: # define CONJUNC 319 64: # define DIFF 320 65: # define DIFFASGN 321 66: # define DOT 322 67: # define EQUIV 323 68: # define INTER 324 69: # define INTERASGN 325 70: # define LBRACE 326 71: # define LBRACK 327 72: # define LCONCAT 328 73: # define LCONCATASGN 329 74: # define LEXEQ 330 75: # define LEXGE 331 76: # define LEXGT 332 77: # define LEXLE 333 78: # define LEXLT 334 79: # define LEXNE 335 80: # define LPAREN 336 81: # define MCOLON 337 82: # define MINUS 338 83: # define MINUSASGN 339 84: # define MOD 340 85: # define MODASGN 341 86: # define NOTEQUIV 342 87: # define NUMEQ 343 88: # define NUMGE 344 89: # define NUMGT 345 90: # define NUMLE 346 91: # define NUMLT 347 92: # define NUMNE 348 93: # define PCOLON 349 94: # define PLUS 350 95: # define PLUSASGN 351 96: # define QMARK 352 97: # define RBRACE 353 98: # define RBRACK 354 99: # define REVASSIGN 355 100: # define REVSWAP 356 101: # define RPAREN 357 102: # define SCANASGN 358 103: # define SEMICOL 359 104: # define SLASH 360 105: # define SLASHASGN 361 106: # define STAR 362 107: # define STARASGN 363 108: # define SWAP 364 109: # define TILDE 365 110: # define UNION 366 111: # define UNIONASGN 367 112: 113: # line 123 "icon.g" 114: #include "itran.h" 115: #include "sym.h" 116: #include "tree.h" 117: #include "../h/keyword.h" 118: #define YYSTYPE nodeptr 119: #define YYMAXDEPTH 500 120: #define yyclearin yychar = -1 121: #define yyerrok yyerrflag = 0 122: extern int yychar; 123: extern short yyerrflag; 124: #ifndef YYMAXDEPTH 125: #define YYMAXDEPTH 150 126: #endif 127: #ifndef YYSTYPE 128: #define YYSTYPE int 129: #endif 130: YYSTYPE yylval, yyval; 131: 132: # line 134 "icon.g" 133: int argcnt; 134: int idflag; 135: int i; 136: #ifdef XPX 137: int cstack[50]; /* context stack expression lists */ 138: int stacktop = 0; /* stack top */ 139: nodeptr cswitch(); 140: #endif XPX 141: # define YYERRCODE 256 142: 143: # line 469 "icon.g" 144: 145: 146: #ifdef XPX 147: pushcs(val) 148: int val; 149: { 150: stacktop = stacktop + 1; 151: cstack[stacktop] = val; 152: } 153: 154: popcs() 155: { 156: stacktop = stacktop - 1; 157: } 158: 159: nodeptr cswitch(x,y) 160: nodeptr x, y; 161: { 162: if (cstack[stacktop]) return(CREATENODE(y,x)); 163: else return(x); 164: } 165: #endif XPX 166: short yyexca[] ={ 167: -1, 1, 168: 0, -1, 169: -2, 0, 170: -1, 21, 171: 359, 32, 172: -2, 30, 173: -1, 104, 174: 359, 32, 175: -2, 30, 176: -1, 111, 177: 359, 32, 178: -2, 30, 179: }; 180: # define YYNPROD 204 181: # define YYLAST 642 182: short yyact[]={ 183: 184: 32, 89, 170, 60, 86, 87, 88, 62, 207, 94, 185: 59, 281, 287, 112, 175, 240, 97, 90, 288, 93, 186: 172, 21, 111, 61, 45, 285, 275, 270, 98, 91, 187: 177, 92, 169, 249, 96, 95, 284, 44, 112, 277, 188: 254, 239, 233, 256, 208, 113, 103, 112, 171, 166, 189: 176, 251, 174, 252, 85, 68, 46, 73, 290, 266, 190: 167, 47, 112, 66, 69, 258, 67, 81, 74, 243, 191: 64, 65, 48, 283, 79, 246, 278, 257, 245, 80, 192: 63, 244, 76, 112, 184, 262, 84, 77, 182, 181, 193: 207, 242, 78, 25, 70, 289, 83, 250, 183, 110, 194: 253, 280, 100, 247, 72, 198, 71, 112, 236, 75, 195: 82, 32, 89, 101, 60, 86, 87, 88, 62, 197, 196: 94, 59, 112, 26, 20, 112, 112, 97, 90, 112, 197: 93, 3, 112, 180, 61, 45, 194, 40, 17, 98, 198: 91, 18, 92, 209, 38, 96, 95, 109, 44, 31, 199: 179, 37, 28, 178, 106, 39, 107, 210, 16, 35, 200: 255, 279, 274, 235, 108, 85, 68, 46, 73, 273, 201: 24, 234, 47, 30, 66, 69, 264, 67, 81, 74, 202: 99, 64, 65, 48, 102, 79, 12, 196, 2, 9, 203: 80, 63, 14, 76, 13, 10, 237, 84, 77, 261, 204: 193, 58, 57, 78, 56, 70, 55, 83, 54, 53, 205: 52, 51, 50, 49, 43, 72, 41, 71, 173, 168, 206: 75, 82, 89, 165, 60, 86, 87, 88, 62, 150, 207: 94, 59, 36, 191, 115, 4, 114, 97, 90, 34, 208: 93, 105, 23, 104, 61, 45, 27, 11, 19, 98, 209: 91, 12, 92, 22, 9, 96, 95, 211, 44, 13, 210: 10, 15, 215, 212, 214, 8, 7, 201, 202, 203, 211: 204, 205, 206, 42, 6, 85, 68, 46, 73, 222, 212: 213, 5, 47, 1, 66, 69, 0, 67, 81, 74, 213: 0, 64, 65, 48, 0, 79, 0, 0, 0, 0, 214: 80, 63, 224, 76, 0, 0, 0, 84, 77, 223, 215: 225, 227, 0, 78, 0, 70, 228, 83, 185, 186, 216: 187, 188, 189, 190, 226, 72, 0, 71, 0, 119, 217: 75, 82, 121, 0, 118, 117, 135, 136, 137, 138, 218: 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 219: 0, 0, 248, 149, 134, 232, 0, 0, 124, 33, 220: 0, 126, 0, 0, 163, 131, 0, 0, 0, 125, 221: 0, 151, 152, 153, 154, 155, 156, 263, 238, 129, 222: 0, 133, 0, 164, 157, 158, 159, 160, 161, 162, 223: 291, 128, 0, 241, 0, 123, 122, 0, 116, 0, 224: 29, 132, 0, 130, 120, 0, 0, 127, 0, 0, 225: 0, 0, 0, 271, 0, 0, 265, 0, 267, 268, 226: 269, 0, 0, 0, 0, 0, 0, 0, 0, 272, 227: 0, 259, 260, 0, 0, 0, 0, 0, 0, 0, 228: 282, 192, 0, 195, 0, 0, 0, 0, 0, 0, 229: 0, 0, 286, 229, 230, 0, 0, 0, 0, 0, 230: 0, 0, 282, 292, 293, 0, 0, 0, 0, 0, 231: 199, 200, 0, 216, 217, 218, 219, 220, 221, 0, 232: 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 233: 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240: 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 245: 0, 0, 0, 0, 0, 0, 0, 0, 0, 195, 246: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248: 0, 276 }; 249: short yypact[]={ 250: 251: -125,-1000, -23,-1000,-1000,-1000,-1000,-1000,-1000,-121, 252: -1000,-235,-1000,-1000, -88,-223,-1000,-1000,-1000,-136, 253: -1000,-145,-157,-146,-1000,-121,-290,-122,-172,-337, 254: -236,-307,-1000,-1000, 40,-1000, 41,-268,-318,-310, 255: -1000,-160,-1000,-238, -35, -35, -35, -35, -35, -35, 256: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-145, 257: -1000,-1000,-145,-1000,-145,-1000,-154,-1000,-1000,-1000, 258: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 259: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 260: -1000,-145,-145,-145,-145,-145,-145,-145,-145,-226, 261: -1000,-292,-1000,-157,-145,-157,-145,-1000,-1000,-1000, 262: -1000,-145, -35, -35, -35, -35, -35, -35, -35, -35, 263: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 264: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 265: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, -35, 266: -35,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 267: -1000,-1000,-1000,-1000,-1000, -35,-1000,-1000, -35,-1000, 268: -1000,-1000,-1000, -35,-1000,-1000,-1000,-1000, -35, -35, 269: -35,-145,-311,-1000,-151,-1000,-1000,-1000,-1000,-1000, 270: -1000,-236,-1000,-145,-312,-344,-145,-1000,-1000,-1000, 271: -1000,-197,-212,-187,-190,-193,-236,-156,-157,-324, 272: -226,-174,-308,-306,-1000,-307,-1000,-1000,-1000,-1000, 273: -1000,-1000,-164,-1000,-268,-318,-310,-1000,-1000,-1000, 274: -1000,-314,-272,-1000,-145,-145,-1000,-231,-1000,-1000, 275: -145,-231,-145,-267,-145,-145,-145,-1000,-330,-1000, 276: -1000,-1000,-1000, -35,-1000,-145,-1000,-1000,-1000,-231, 277: -231,-331,-145,-1000,-315,-194,-256,-236,-236,-236, 278: -1000,-1000,-281,-317,-332,-1000,-1000,-1000,-145,-341, 279: -1000,-220,-257,-1000,-1000,-1000,-236,-1000,-256,-145, 280: -145,-1000,-236,-236 }; 281: short yypgo[]={ 282: 283: 0, 283, 188, 281, 274, 266, 265, 261, 158, 253, 284: 157, 248, 143, 247, 246, 243, 152, 242, 241, 173, 285: 378, 149, 359, 239, 236, 234, 159, 232, 151, 229, 286: 144, 223, 155, 219, 137, 218, 216, 273, 214, 213, 287: 212, 211, 210, 209, 208, 206, 204, 202, 201, 200, 288: 196, 199, 136, 187, 176, 171, 169, 163, 162, 161, 289: 101, 160 }; 290: short yyr1[]={ 291: 292: 0, 1, 2, 2, 3, 3, 3, 3, 7, 7, 293: 8, 8, 9, 6, 11, 4, 5, 17, 13, 12, 294: 12, 10, 10, 14, 14, 18, 18, 18, 15, 15, 295: 16, 16, 20, 20, 19, 19, 21, 21, 22, 22, 296: 22, 22, 22, 22, 24, 24, 24, 24, 25, 25, 297: 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 298: 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 299: 25, 25, 25, 23, 23, 23, 26, 26, 27, 27, 300: 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 301: 29, 29, 29, 29, 28, 28, 31, 31, 30, 30, 302: 33, 33, 33, 33, 32, 32, 35, 35, 35, 35, 303: 34, 34, 36, 36, 36, 37, 37, 37, 37, 37, 304: 37, 37, 39, 39, 39, 39, 39, 39, 39, 39, 305: 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 306: 39, 38, 38, 38, 38, 38, 38, 38, 38, 38, 307: 38, 38, 38, 38, 49, 51, 38, 38, 53, 54, 308: 38, 38, 38, 55, 56, 38, 57, 58, 38, 38, 309: 38, 38, 45, 45, 46, 46, 47, 47, 48, 42, 310: 42, 42, 43, 43, 44, 59, 59, 60, 60, 50, 311: 50, 40, 40, 40, 40, 41, 61, 61, 61, 52, 312: 52, 1, 5, 19 }; 313: short yyr2[]={ 314: 315: 0, 2, 0, 2, 1, 1, 1, 2, 1, 3, 316: 1, 1, 0, 3, 0, 6, 6, 0, 6, 0, 317: 1, 1, 3, 0, 4, 1, 1, 1, 0, 3, 318: 0, 3, 0, 1, 1, 3, 1, 3, 1, 3, 319: 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 320: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 321: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 322: 1, 1, 1, 1, 3, 5, 1, 3, 1, 3, 323: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 324: 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 325: 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 326: 1, 3, 1, 3, 3, 1, 2, 2, 2, 2, 327: 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 328: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 329: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 330: 2, 1, 1, 2, 0, 0, 5, 3, 0, 0, 331: 5, 4, 3, 0, 0, 6, 0, 0, 6, 3, 332: 2, 2, 2, 4, 2, 4, 2, 4, 2, 1, 333: 2, 2, 4, 6, 6, 1, 3, 3, 3, 1, 334: 3, 1, 1, 1, 1, 6, 1, 1, 1, 1, 335: 3, 3, 4, 1 }; 336: short yychk[]={ 337: 338: -1000, -1, -2, 256, 258, -3, -4, -5, -6, 277, 339: 283, -13, 274, 282, -2, -7, -8, 259, 262, -11, 340: 359, 256, -9, -17, 258, 316, 259, -14, -16, -20, 341: -19, -21, 256, -22, -23, -26, -27, -28, -30, -32, 342: -34, -36, -37, -38, 293, 280, 312, 317, 328, -39, 343: -40, -41, -42, -43, -44, -45, -46, -47, -48, 266, 344: 259, 279, 263, 336, 326, 327, 319, 322, 311, 320, 345: 350, 362, 360, 313, 324, 365, 338, 343, 348, 330, 346: 335, 323, 366, 352, 342, 310, 260, 261, 262, 257, 347: 273, 285, 287, 275, 265, 291, 290, 272, 284, -10, 348: 259, 259, -8, 336, -15, -18, 276, 278, 286, 269, 349: 271, 359, 319, 352, -24, -25, 358, 295, 294, 289, 350: 364, 292, 356, 355, 318, 329, 321, 367, 351, 339, 351: 363, 325, 361, 341, 314, 296, 297, 298, 299, 300, 352: 301, 302, 303, 304, 305, 306, 307, 308, 309, 312, 353: -29, 330, 331, 332, 333, 334, 335, 343, 344, 345, 354: 346, 347, 348, 323, 342, -31, 317, 328, -33, 350, 355: 320, 366, 338, -35, 362, 324, 360, 340, 313, 310, 356: 293, 327, 326, 336, 322, -37, -37, -37, -37, -37, 357: -37, -19, -20, -49, -52, -20, -53, 273, 259, -20, 358: -20, -19, -19, -19, -19, -19, -19, 316, 336, -12, 359: -10, -16, -10, -19, -16, -21, -22, -22, -22, -22, 360: -22, -22, -26, -26, -28, -30, -32, -34, -34, -37, 361: -37, -20, -19, 353, -55, -57, 259, -50, -20, 353, 362: 359, -50, 288, 281, 268, 268, 268, 259, -12, 357, 363: 271, 359, 359, 264, 354, -61, 315, 349, 337, -50, 364: -50, -51, 316, -52, -54, -19, 326, -19, -19, -19, 365: 357, -26, -19, -56, -58, 357, -20, 354, 270, -59, 366: -60, 267, -19, 354, 353, 357, -19, 353, 359, 315, 367: 315, -60, -19, -19 }; 368: short yydef[]={ 369: 370: 2, -2, 0, 2, 1, 3, 4, 5, 6, 0, 371: 14, 0, 12, 17, 0, 7, 8, 10, 11, 0, 372: 23, -2, 0, 0, 201, 0, 0, 28, 0, 0, 373: 33, 34, 203, 36, 38, 73, 76, 78, 94, 98, 374: 104, 110, 112, 115, 0, 0, 0, 0, 0, 0, 375: 141, 142, 143, 144, 145, 146, 147, 148, 149, 0, 376: 151, 152, 32, 154, 32, 158, 0, 122, 123, 124, 377: 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 378: 135, 136, 137, 138, 139, 140, 191, 192, 193, 194, 379: 179, 32, 32, 0, 0, 0, 0, 0, 0, 13, 380: 21, 0, 9, 19, -2, 0, 0, 25, 26, 27, 381: 202, -2, 0, 0, 0, 0, 0, 0, 0, 0, 382: 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 383: 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 384: 64, 65, 66, 67, 68, 69, 70, 71, 72, 0, 385: 0, 80, 81, 82, 83, 84, 85, 86, 87, 88, 386: 89, 90, 91, 92, 93, 0, 96, 97, 0, 100, 387: 101, 102, 103, 0, 106, 107, 108, 109, 0, 0, 388: 0, 32, 163, 166, 0, 116, 117, 118, 119, 120, 389: 121, 150, 153, 32, 0, 199, 32, 170, 171, 180, 390: 181, 0, 0, 172, 174, 176, 178, 0, 19, 0, 391: 20, 0, 0, 0, 31, 35, 37, 39, 40, 41, 392: 42, 43, 74, 77, 79, 95, 99, 105, 111, 113, 393: 114, 0, 33, 162, 32, 32, 169, 155, 189, 157, 394: 32, 159, 0, 0, 0, 0, 0, 22, 0, 15, 395: 16, 24, 29, 0, 161, 0, 196, 197, 198, 164, 396: 167, 0, 32, 200, 0, 182, 0, 173, 175, 177, 397: 18, 75, 0, 0, 0, 156, 190, 160, 0, 0, 398: 185, 0, 0, 195, 165, 168, 183, 184, 0, 0, 399: 0, 186, 187, 188 }; 400: #ifndef lint 401: static char yaccpar_sccsid[] = "@(#)yaccpar 4.1 (Berkeley) 2/11/83"; 402: #endif not lint 403: 404: # 405: # define YYFLAG -1000 406: # define YYERROR goto yyerrlab 407: # define YYACCEPT return(0) 408: # define YYABORT return(1) 409: 410: /* parser for yacc output */ 411: 412: #ifdef YYDEBUG 413: int yydebug = 0; /* 1 for debugging */ 414: #endif 415: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ 416: int yychar = -1; /* current input token number */ 417: int yynerrs = 0; /* number of errors */ 418: short yyerrflag = 0; /* error recovery flag */ 419: 420: yyparse() { 421: 422: short yys[YYMAXDEPTH]; 423: short yyj, yym; 424: register YYSTYPE *yypvt; 425: register short yystate, *yyps, yyn; 426: register YYSTYPE *yypv; 427: register short *yyxi; 428: 429: yystate = 0; 430: yychar = -1; 431: yynerrs = 0; 432: yyerrflag = 0; 433: yyps= &yys[-1]; 434: yypv= &yyv[-1]; 435: 436: yystack: /* put a state and value onto the stack */ 437: 438: #ifdef YYDEBUG 439: if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); 440: #endif 441: if( ++yyps> &yys[YYMAXDEPTH] ) { syserr( "yacc stack overflow" ); return(1); } 442: *yyps = yystate; 443: ++yypv; 444: *yypv = yyval; 445: 446: yynewstate: 447: 448: yyn = yypact[yystate]; 449: 450: if( yyn<= YYFLAG ) goto yydefault; /* simple state */ 451: 452: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; 453: if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; 454: 455: if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ 456: yychar = -1; 457: yyval = yylval; 458: yystate = yyn; 459: if( yyerrflag > 0 ) --yyerrflag; 460: goto yystack; 461: } 462: 463: yydefault: 464: /* default state action */ 465: 466: if( (yyn=yydef[yystate]) == -2 ) { 467: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; 468: /* look through exception table */ 469: 470: for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ 471: 472: while( *(yyxi+=2) >= 0 ){ 473: if( *yyxi == yychar ) break; 474: } 475: if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ 476: } 477: 478: if( yyn == 0 ){ /* error */ 479: /* error ... attempt to resume parsing */ 480: 481: switch( yyerrflag ){ 482: 483: case 0: /* brand new error */ 484: 485: yyerror( yychar, yylval, yystate ); 486: yyerrlab: 487: ++yynerrs; 488: 489: case 1: 490: case 2: /* incompletely recovered error ... try again */ 491: 492: yyerrflag = 3; 493: 494: /* find a state where "error" is a legal shift action */ 495: 496: while ( yyps >= yys ) { 497: yyn = yypact[*yyps] + YYERRCODE; 498: if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ 499: yystate = yyact[yyn]; /* simulate a shift of "error" */ 500: goto yystack; 501: } 502: yyn = yypact[*yyps]; 503: 504: /* the current yyps has no shift onn "error", pop stack */ 505: 506: #ifdef YYDEBUG 507: if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); 508: #endif 509: --yyps; 510: --yypv; 511: } 512: 513: /* there is no state on the stack with an error shift ... abort */ 514: 515: yyabort: 516: return(1); 517: 518: 519: case 3: /* no shift yet; clobber input char */ 520: 521: #ifdef YYDEBUG 522: if( yydebug ) printf( "error recovery discards char %d\n", yychar ); 523: #endif 524: 525: if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ 526: yychar = -1; 527: goto yynewstate; /* try again in the same state */ 528: 529: } 530: 531: } 532: 533: /* reduction by production yyn */ 534: 535: #ifdef YYDEBUG 536: if( yydebug ) printf("reduce %d\n",yyn); 537: #endif 538: yyps -= yyr2[yyn]; 539: yypvt = yypv; 540: yypv -= yyr2[yyn]; 541: yyval = yypv[1]; 542: yym=yyn; 543: /* consult goto table to find next state */ 544: yyn = yyr1[yyn]; 545: yyj = yypgo[yyn] + *yyps + 1; 546: if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; 547: switch(yym){ 548: 549: case 1: 550: # line 144 "icon.g" 551: {gout(globfile);} break; 552: case 4: 553: # line 149 "icon.g" 554: { 555: if (!nocode) 556: rout(globfile, STR0(yypvt[-0])); 557: nocode = 0; 558: loc_init(); 559: } break; 560: case 5: 561: # line 155 "icon.g" 562: { 563: if (!nocode) 564: codegen(yypvt[-0]); 565: nocode = 0; 566: treeinit(); 567: loc_init(); 568: } break; 569: case 10: 570: # line 168 "icon.g" 571: {addlfile(STR0(yypvt[-0]));} break; 572: case 11: 573: # line 169 "icon.g" 574: {addlfile(STR0(yypvt[-0]));} break; 575: case 12: 576: # line 171 "icon.g" 577: {idflag = F_GLOBAL;} break; 578: case 14: 579: # line 173 "icon.g" 580: {idflag = F_ARGUMENT;} break; 581: case 15: 582: # line 173 "icon.g" 583: { 584: install(STR0(yypvt[-3]),F_RECORD|F_GLOBAL,(int)yypvt[-1]); 585: yyval = yypvt[-3]; 586: } break; 587: case 16: 588: # line 178 "icon.g" 589: { 590: yyval = (nodeptr)PROCNODE(yypvt[-5],yypvt[-2],yypvt[-1],yypvt[-0]); 591: } break; 592: case 17: 593: # line 182 "icon.g" 594: {idflag = F_ARGUMENT;} break; 595: case 18: 596: # line 182 "icon.g" 597: { 598: yyval = yypvt[-3]; 599: install(STR0(yypvt[-3]),F_PROC|F_GLOBAL,(int)yypvt[-1]); 600: } break; 601: case 19: 602: # line 187 "icon.g" 603: {yyval = (int)0;} break; 604: case 20: 605: # line 188 "icon.g" 606: {yyval = (nodeptr)yypvt[-0];} break; 607: case 21: 608: # line 191 "icon.g" 609: { 610: install(STR0(yypvt[-0]),idflag,0); 611: yyval = (nodeptr)1; 612: } break; 613: case 22: 614: # line 195 "icon.g" 615: { 616: install(STR0(yypvt[-0]),idflag,0); 617: yyval = (nodeptr)((int)yypvt[-2] + 1); 618: } break; 619: case 25: 620: # line 203 "icon.g" 621: {idflag = F_DYNAMIC;} break; 622: case 26: 623: # line 204 "icon.g" 624: {idflag = F_STATIC;} break; 625: case 27: 626: # line 205 "icon.g" 627: {idflag = F_DYNAMIC;} break; 628: case 28: 629: # line 207 "icon.g" 630: {yyval = EMPTYNODE;} break; 631: case 29: 632: # line 208 "icon.g" 633: {yyval = yypvt[-1];} break; 634: case 30: 635: # line 210 "icon.g" 636: {yyval = EMPTYNODE;} break; 637: case 31: 638: # line 211 "icon.g" 639: {yyval = SLISTNODE(yypvt[-1], yypvt[-2], yypvt[-0]);} break; 640: case 32: 641: # line 213 "icon.g" 642: {yyval = EMPTYNODE;} break; 643: case 35: 644: # line 217 "icon.g" 645: {yyval = CONJNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 646: case 37: 647: # line 220 "icon.g" 648: {yyval = SCANNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 649: case 39: 650: # line 223 "icon.g" 651: {binop: yyval = BINOPNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 652: case 40: 653: # line 224 "icon.g" 654: {yyval = AUGOPNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 655: case 41: 656: # line 225 "icon.g" 657: {yyval = SCANNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 658: case 42: 659: # line 226 "icon.g" 660: {yyval = CONJNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 661: case 43: 662: # line 227 "icon.g" 663: {yyval = ACTIVNODE(yypvt[-1],yypvt[-0],yypvt[-2]);} break; 664: case 74: 665: # line 261 "icon.g" 666: {yyval = TONODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 667: case 75: 668: # line 262 "icon.g" 669: {yyval = TOBYNODE(yypvt[-3],yypvt[-4],yypvt[-2],yypvt[-0]);} break; 670: case 77: 671: # line 265 "icon.g" 672: {yyval = ALTNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 673: case 79: 674: # line 268 "icon.g" 675: {goto binop;} break; 676: case 95: 677: # line 286 "icon.g" 678: {goto binop;} break; 679: case 99: 680: # line 292 "icon.g" 681: {goto binop;} break; 682: case 105: 683: # line 300 "icon.g" 684: {goto binop;} break; 685: case 111: 686: # line 308 "icon.g" 687: {goto binop;} break; 688: case 113: 689: # line 311 "icon.g" 690: {yyval = LIMITNODE(yypvt[-2],yypvt[-0]);} break; 691: case 114: 692: # line 312 "icon.g" 693: {yyval = ACTIVNODE(yypvt[-1], yypvt[-0], yypvt[-2]);} break; 694: case 116: 695: # line 315 "icon.g" 696: {yyval = ACTIVNODE(yypvt[-1], yypvt[-0], EMPTYNODE);} break; 697: case 117: 698: # line 316 "icon.g" 699: {yyval = NOTNODE(yypvt[-0]);} break; 700: case 118: 701: # line 317 "icon.g" 702: {yyval = BARNODE(yypvt[-0]);} break; 703: case 119: 704: # line 318 "icon.g" 705: {yyval = BARNODE(yypvt[-0]);} break; 706: case 120: 707: # line 319 "icon.g" 708: {yyval = BARNODE(yypvt[-0]);} break; 709: case 121: 710: # line 320 "icon.g" 711: {yyval = UNOPNODE(yypvt[-1],yypvt[-0]);} break; 712: case 150: 713: # line 351 "icon.g" 714: {yyval = CREATENODE(yypvt[-1],yypvt[-0]);} break; 715: case 151: 716: # line 352 "icon.g" 717: {VAL0(yypvt[-0]) = putloc(STR0(yypvt[-0]),0);} break; 718: case 152: 719: # line 353 "icon.g" 720: {yyval = NEXTNODE(yypvt[-0]);} break; 721: case 153: 722: # line 354 "icon.g" 723: {yyval = BREAKNODE(yypvt[-1],yypvt[-0]);} break; 724: case 154: 725: # line 355 "icon.g" 726: { 727: #ifdef XPX 728: pushcs(0); 729: #endif XPX 730: } break; 731: case 155: 732: # line 359 "icon.g" 733: { 734: #ifdef XPX 735: popcs(); 736: #endif XPX 737: } break; 738: case 156: 739: # line 363 "icon.g" 740: { 741: if ((yypvt[-2])->n_type == N_ELIST) 742: yyval = INVOKNODE(yypvt[-4],EMPTYNODE,yypvt[-2]); 743: else 744: yyval = yypvt[-2]; } break; 745: case 157: 746: # line 368 "icon.g" 747: {yyval = yypvt[-1];} break; 748: case 158: 749: # line 369 "icon.g" 750: { 751: #ifdef XPX 752: pushcs(0); 753: #endif XPX 754: } break; 755: case 159: 756: # line 373 "icon.g" 757: { 758: #ifdef XPX 759: popcs(); 760: #endif XPX 761: } break; 762: case 160: 763: # line 377 "icon.g" 764: { 765: yyval = LISTNODE(yypvt[-4],yypvt[-2]);} break; 766: case 161: 767: # line 379 "icon.g" 768: {yyval = BINOPNODE(yypvt[-2],yypvt[-3],yypvt[-1]);} break; 769: case 162: 770: # line 380 "icon.g" 771: {yyval = INVOKNODE(yypvt[-1],yypvt[-2],LISTNODE(yypvt[-1],EMPTYNODE));} break; 772: case 163: 773: # line 381 "icon.g" 774: { 775: #ifdef XPX 776: pushcs(1); 777: #endif XPX 778: } break; 779: case 164: 780: # line 385 "icon.g" 781: { 782: #ifdef XPX 783: popcs(); 784: #else XPX 785: err("missing semicolon or operator", 0); 786: #endif XPX 787: } break; 788: case 165: 789: # line 391 "icon.g" 790: { 791: yyval = INVOKNODE(yypvt[-4],yypvt[-5],LISTNODE(yypvt[-4],yypvt[-2])); 792: } break; 793: case 166: 794: # line 394 "icon.g" 795: { 796: #ifdef XPX 797: pushcs(0); 798: #endif XPX 799: } break; 800: case 167: 801: # line 398 "icon.g" 802: { 803: #ifdef XPX 804: popcs(); 805: #endif XPX 806: } break; 807: case 168: 808: # line 402 "icon.g" 809: { 810: yyval = INVOKNODE(yypvt[-4],yypvt[-5],yypvt[-2]); 811: } break; 812: case 169: 813: # line 405 "icon.g" 814: {yyval = FIELDNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 815: case 170: 816: # line 406 "icon.g" 817: {yyval = KEYNODE(yypvt[-1], K_FAIL);} break; 818: case 171: 819: # line 407 "icon.g" 820: { 821: if ((i = klocate(STR0(yypvt[-0]))) == NULL) 822: err("invalid keyword",STR0(yypvt[-0])); 823: yyval = KEYNODE(yypvt[-1], i); 824: } break; 825: case 172: 826: # line 413 "icon.g" 827: {yyval = LOOPNODE(yypvt[-1],yypvt[-0],EMPTYNODE);} break; 828: case 173: 829: # line 414 "icon.g" 830: {yyval = LOOPNODE(yypvt[-3],yypvt[-2],yypvt[-0]);} break; 831: case 174: 832: # line 416 "icon.g" 833: {yyval = LOOPNODE(yypvt[-1],yypvt[-0],EMPTYNODE);} break; 834: case 175: 835: # line 417 "icon.g" 836: {yyval = LOOPNODE(yypvt[-3],yypvt[-2],yypvt[-0]);} break; 837: case 176: 838: # line 419 "icon.g" 839: {yyval = LOOPNODE(yypvt[-1],yypvt[-0],EMPTYNODE);} break; 840: case 177: 841: # line 420 "icon.g" 842: {yyval = LOOPNODE(yypvt[-3],yypvt[-2],yypvt[-0]);} break; 843: case 178: 844: # line 422 "icon.g" 845: {yyval = LOOPNODE(yypvt[-1],yypvt[-0],EMPTYNODE);} break; 846: case 179: 847: # line 424 "icon.g" 848: {yyval = RETNODE(yypvt[-0],EMPTYNODE);} break; 849: case 180: 850: # line 425 "icon.g" 851: {yyval = RETNODE(yypvt[-1],yypvt[-0]);} break; 852: case 181: 853: # line 426 "icon.g" 854: {yyval = SUSPNODE(yypvt[-1],yypvt[-0]);} break; 855: case 182: 856: # line 428 "icon.g" 857: {yyval = IFNODE(yypvt[-3],yypvt[-2],yypvt[-0],EMPTYNODE);} break; 858: case 183: 859: # line 429 "icon.g" 860: {yyval = IFNODE(yypvt[-5],yypvt[-4],yypvt[-2],yypvt[-0]);} break; 861: case 184: 862: # line 431 "icon.g" 863: {yyval = CASENODE(yypvt[-5],yypvt[-4],yypvt[-1]);} break; 864: case 186: 865: # line 434 "icon.g" 866: {yyval = CLISTNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 867: case 187: 868: # line 436 "icon.g" 869: {yyval = CCLSNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 870: case 188: 871: # line 437 "icon.g" 872: {yyval = CCLSNODE(yypvt[-1],yypvt[-2],yypvt[-0]);} break; 873: case 189: 874: # line 439 "icon.g" 875: { 876: #ifdef XPX 877: yyval = cswitch(yypvt[-0],yypvt[-0]); 878: #endif XPX 879: } break; 880: case 190: 881: # line 444 "icon.g" 882: { 883: #ifdef XPX 884: yyval = ELISTNODE(yypvt[-1],yypvt[-2],cswitch(yypvt[-0],yypvt[-1])); 885: #else XPX 886: yyval = ELISTNODE(yypvt[-1],yypvt[-2],yypvt[-0]); 887: #endif XPX 888: } break; 889: case 191: 890: # line 452 "icon.g" 891: {VAL0(yypvt[-0]) = putlit(STR0(yypvt[-0]),F_INTLIT,0);} break; 892: case 192: 893: # line 453 "icon.g" 894: {VAL0(yypvt[-0]) = putlit(STR0(yypvt[-0]),F_REALLIT,0);} break; 895: case 193: 896: # line 454 "icon.g" 897: {VAL0(yypvt[-0]) = putlit(STR0(yypvt[-0]),F_STRLIT,VAL1(yypvt[-0]));} break; 898: case 194: 899: # line 455 "icon.g" 900: {VAL0(yypvt[-0]) = putlit(STR0(yypvt[-0]),F_CSETLIT,VAL1(yypvt[-0]));} break; 901: case 195: 902: # line 457 "icon.g" 903: {yyval = (nodeptr)SECTNODE(yypvt[-2],yypvt[-5],yypvt[-3],yypvt[-1]);} break; 904: case 200: 905: # line 464 "icon.g" 906: {yyval = SLISTNODE(yypvt[-1], yypvt[-2], yypvt[-0]);} break; 907: } 908: goto yystack; /* stack new state and value */ 909: 910: }