#line 2 "a.y" /* been modded. *NOT* autogenerated in unix */ #include #include #include "../qc/q.out.h" #include "a.h" #line 8 "a.y" typedef union { Sym *sym; long lval; double dval; char sval[8]; Gen gen; } YYSTYPE; extern int yyerrflag; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif YYSTYPE yylval; YYSTYPE yyval; #define LMOVW 57346 #define LMOVB 57347 #define LABS 57348 #define LLOGW 57349 #define LADDW 57350 #define LCMP 57351 #define LCROP 57352 #define LBRA 57353 #define LFMOV 57354 #define LFCONV 57355 #define LFCMP 57356 #define LFADD 57357 #define LFMA 57358 #define LTRAP 57359 #define LXORW 57360 #define LNOP 57361 #define LEND 57362 #define LRETT 57363 #define LWORD 57364 #define LTEXT 57365 #define LDATA 57366 #define LRETRN 57367 #define LCONST 57368 #define LSP 57369 #define LSB 57370 #define LFP 57371 #define LPC 57372 #define LCREG 57373 #define LFLUSH 57374 #define LREG 57375 #define LFREG 57376 #define LR 57377 #define LCR 57378 #define LF 57379 #define LFPSCR 57380 #define LLR 57381 #define LCTR 57382 #define LSPR 57383 #define LSPREG 57384 #define LSEG 57385 #define LMSR 57386 #define LSCHED 57387 #define LXLD 57388 #define LXST 57389 #define LXOP 57390 #define LXMV 57391 #define LRLWM 57392 #define LMOVMW 57393 #define LMOVEM 57394 #define LMOVFL 57395 #define LMTFSB 57396 #define LFCONST 57397 #define LSCONST 57398 #define LNAME 57399 #define LLAB 57400 #define LVAR 57401 #define YYEOFCODE 1 #define YYERRCODE 2 short yyexca[] = {-1, 1, 1, -1, -2, 0, }; #define YYNPROD 180 #define YYPRIVATE 57344 /* #define yydebug 1*/ #undef yydebug #define YYLAST 814 short yyact[] = { 44, 88, 404, 50, 55, 97, 92, 53, 100, 48, 78, 77, 83, 166, 52, 93, 95, 96, 415, 51, 108, 2, 46, 157, 263, 116, 118, 120, 54, 123, 125, 122, 128, 92, 85, 87, 132, 75, 103, 232, 231, 230, 228, 229, 223, 224, 225, 226, 227, 268, 121, 63, 124, 126, 141, 428, 72, 60, 73, 72, 61, 73, 427, 140, 142, 58, 58, 58, 49, 72, 76, 73, 98, 104, 416, 99, 122, 92, 79, 394, 393, 58, 91, 94, 386, 385, 130, 366, 109, 135, 135, 72, 92, 73, 117, 365, 192, 43, 355, 354, 122, 131, 56, 353, 47, 352, 351, 189, 350, 348, 269, 347, 303, 78, 77, 267, 387, 89, 161, 193, 194, 111, 191, 192, 92, 112, 113, 114, 115, 192, 346, 213, 170, 171, 172, 276, 129, 155, 218, 162, 75, 165, 164, 163, 234, 243, 244, 183, 241, 252, 254, 239, 258, 259, 260, 261, 247, 158, 242, 424, 220, 221, 156, 238, 423, 256, 236, 250, 422, 246, 255, 257, 240, 76, 280, 283, 284, 42, 99, 421, 420, 79, 419, 378, 377, 295, 297, 299, 300, 375, 374, 373, 372, 371, 301, 370, 282, 369, 58, 304, 308, 58, 290, 319, 321, 322, 323, 110, 325, 368, 329, 367, 237, 270, 362, 248, 361, 271, 272, 273, 275, 360, 359, 278, 279, 156, 358, 345, 58, 344, 217, 327, 111, 330, 58, 214, 210, 292, 209, 127, 208, 133, 207, 302, 137, 307, 311, 334, 335, 336, 337, 338, 249, 294, 341, 342, 343, 206, 262, 205, 204, 58, 203, 202, 201, 78, 77, 274, 200, 199, 198, 320, 332, 197, 333, 195, 326, 328, 190, 188, 187, 285, 286, 287, 288, 186, 331, 293, 296, 298, 185, 357, 75, 184, 182, 262, 179, 64, 313, 178, 314, 356, 107, 315, 316, 317, 318, 177, 159, 176, 175, 363, 174, 173, 154, 364, 196, 153, 152, 45, 84, 86, 151, 105, 106, 76, 150, 101, 149, 41, 102, 148, 147, 79, 146, 119, 211, 212, 145, 215, 216, 144, 143, 38, 39, 40, 78, 77, 425, 376, 78, 77, 381, 37, 181, 383, 291, 62, 382, 388, 389, 390, 391, 379, 380, 72, 417, 73, 392, 60, 253, 349, 61, 75, 395, 408, 407, 75, 219, 340, 414, 60, 413, 277, 61, 60, 339, 64, 61, 400, 401, 402, 107, 72, 8, 73, 78, 77, 409, 168, 169, 384, 418, 139, 74, 138, 76, 1, 74, 180, 76, 59, 68, 90, 79, 59, 251, 98, 79, 71, 307, 430, 431, 75, 433, 434, 64, 405, 405, 70, 72, 107, 73, 265, 264, 266, 67, 66, 0, 80, 0, 403, 406, 0, 0, 410, 411, 412, 0, 72, 60, 73, 235, 61, 74, 245, 76, 265, 264, 266, 312, 59, 0, 72, 79, 73, 225, 226, 227, 0, 161, 0, 398, 399, 64, 0, 72, 432, 73, 107, 64, 170, 281, 60, 0, 107, 61, 0, 289, 9, 265, 264, 266, 57, 435, 0, 72, 0, 73, 305, 309, 10, 11, 16, 15, 14, 24, 17, 18, 12, 20, 23, 21, 22, 19, 324, 31, 33, 0, 32, 34, 35, 36, 0, 429, 0, 78, 77, 134, 136, 78, 77, 232, 231, 230, 228, 229, 223, 224, 225, 226, 227, 6, 27, 28, 30, 29, 25, 26, 0, 0, 13, 0, 75, 4, 3, 5, 75, 64, 7, 72, 60, 73, 65, 61, 62, 81, 82, 67, 66, 69, 80, 78, 77, 167, 0, 168, 169, 78, 426, 0, 0, 0, 0, 74, 0, 76, 0, 105, 106, 76, 59, 0, 63, 79, 397, 0, 0, 79, 75, 233, 0, 78, 77, 64, 75, 72, 0, 73, 65, 0, 0, 81, 82, 67, 66, 69, 80, 78, 77, 0, 0, 78, 77, 78, 77, 0, 0, 0, 75, 74, 0, 76, 0, 180, 160, 74, 59, 76, 92, 79, 62, 0, 99, 0, 75, 79, 0, 0, 75, 0, 75, 72, 0, 73, 0, 0, 0, 78, 77, 74, 0, 76, 0, 81, 82, 0, 59, 0, 92, 79, 78, 77, 0, 396, 0, 74, 0, 76, 0, 105, 106, 76, 99, 76, 75, 79, 310, 0, 99, 79, 0, 79, 78, 77, 0, 0, 0, 75, 0, 78, 77, 0, 0, 0, 72, 0, 73, 0, 0, 0, 78, 77, 0, 0, 0, 105, 106, 76, 0, 75, 0, 0, 306, 0, 0, 79, 75, 0, 0, 0, 76, 0, 0, 0, 0, 99, 0, 75, 79, 232, 231, 230, 228, 229, 223, 224, 225, 226, 227, 160, 74, 0, 76, 0, 0, 291, 0, 99, 0, 76, 79, 0, 0, 0, 99, 0, 0, 79, 74, 0, 76, 0, 0, 0, 0, 99, 0, 0, 79, 231, 230, 228, 229, 223, 224, 225, 226, 227, 230, 228, 229, 223, 224, 225, 226, 227, 228, 229, 223, 224, 225, 226, 227, 0, 0, 0, 0, 222, 223, 224, 225, 226, 227 }; short yypact[] = { -1000, 487,-1000, 283, 273, 274, 257,-1000, 105, 25, 517, 387, 337, -70, 16, 350, 350, 104, 256, 48, 325, 325, 325, 325, 350, 16, 609, 2, 350, 26, 2, 13, -25, 159, 702, 702, 159,-1000,-1000, 104, 104,-1000,-1000,-1000, 269, 268, 265, 261, 259, 258, 255, 253, 249, 245, 244, 241,-1000,-1000, 63, 662, -1000, 83,-1000, 684,-1000, 65,-1000, 69,-1000, 68, -1000,-1000,-1000, 67, 567,-1000,-1000, 104, 104, 104, -1000,-1000,-1000, 240, 239, 237, 236, 234, 226, 223, 344, 221, 104, 220, 217, 212, 207, 206,-1000, 104, -1000,-1000, 615, 205, 49, 567, 390, 65, 202, 200, -1000,-1000, 197, 196, 195, 191, 190, 189, 187, 186, 184, 169, 350, 167, 165, 163,-1000,-1000, 159, 159, 406, 159, 159,-1000, 157, 64, 366,-1000, 487, 487, 736,-1000, 528, 563, 350, 350, 593, 439, 322, 350, 385, 433, 350, 350, 350, 453, 40, 35, 104,-1000, -1000, 63, 104, 104, 662, 104, 61, 375, 104, 104, -1000,-1000,-1000, 387, 350, 350, 325, 325, 325, 341, -1000, 291, 104,-1000, 16, 350, 350, 350, 104, 37, 649, 613, 420, 61,-1000, 350,-1000, 350, 325, 325, 325, 325, 16, 350, 350, 350, 702, 16, -43, 350, 2,-1000,-1000,-1000,-1000,-1000,-1000, 1, 396, 104, -1000,-1000,-1000, 104, 104, 104, 104, 104, 379, 371, 104, 104, 104,-1000,-1000,-1000,-1000, 156,-1000,-1000, -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 154,-1000, -1000,-1000,-1000, 56,-1000,-1000,-1000,-1000,-1000,-1000, -1000,-1000, 36, 34,-1000,-1000,-1000,-1000, 350,-1000, 33, 31, 30, 28, 24, 23, 396, 390,-1000,-1000, -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, -1000,-1000,-1000, 153, 149,-1000, 148,-1000, 143,-1000, -1000,-1000, 141,-1000,-1000,-1000, 615, 55,-1000,-1000, 615, 22, 12,-1000,-1000,-1000, 138, 136, 124, 122, 120, 119, 118,-1000,-1000,-1000, 117,-1000, 116,-1000, -1000, 279, 111, 110, 455, 455,-1000,-1000,-1000, 104, 104, 790, 783, 775, 312, 309, 104,-1000,-1000, 10, -1000,-1000,-1000,-1000,-1000,-1000, 9, 42, 350, 350, 350, 350, 104, 5, 4, 521,-1000, 325, 325, 346, 346, 346, 1, 1, 350, 2, -70, -70, -58, 800, 800,-1000,-1000,-1000, -1,-1000,-1000, 328,-1000,-1000, -1000,-1000,-1000,-1000,-1000,-1000,-1000, 615,-1000, 109, -1000,-1000,-1000, 107, 106, 95, 91, 86,-1000,-1000, -1000, 278,-1000,-1000,-1000, 569,-1000, -13, -20, 325, 350, 350, 104, 350, 350, -70, 691,-1000,-1000,-1000, -1000,-1000,-1000,-1000,-1000,-1000 }; short yypgo[] = { 0, 54, 23, 24, 13, 102, 308, 0, 22, 493, 19, 104, 4, 429, 419, 68, 3, 1, 8, 14, 7, 5, 9, 416, 28, 412, 2, 407, 21, 405, 403, 394, 207 }; short yyr1[] = { 0, 27, 27, 29, 28, 30, 28, 28, 28, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 18, 18, 18, 7, 12, 12, 13, 20, 14, 25, 19, 19, 19, 24, 24, 22, 23, 11, 11, 10, 10, 21, 26, 16, 16, 17, 17, 15, 5, 5, 8, 8, 6, 6, 9, 9, 9, 32, 32, 4, 4, 4, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; short yyr2[] = { 0, 0, 2, 0, 4, 0, 4, 4, 4, 2, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 6, 4, 4, 6, 6, 6, 4, 4, 6, 4, 4, 2, 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 6, 4, 4, 6, 6, 6, 8, 4, 4, 3, 2, 4, 4, 6, 8, 4, 6, 4, 4, 6, 6, 8, 8, 8, 8, 4, 4, 4, 6, 4, 6, 4, 4, 2, 2, 3, 3, 3, 3, 3, 3, 2, 4, 6, 6, 8, 6, 6, 6, 2, 4, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 4, 1, 4, 1, 4, 1, 4, 1, 3, 2, 2, 2, 3, 2, 1, 4, 3, 5, 1, 4, 4, 5, 7, 0, 1, 0, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 3, 1, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3 }; short yychk[] = { -1000, -27, -28, 68, 67, 69, 55, 72, -31, 2, 14, 15, 22, 64, 18, 17, 16, 20, 21, 27, 23, 25, 26, 24, 19, 60, 61, 56, 57, 59, 58, 29, 32, 30, 33, 34, 35, 70, 70, 71, 71, 72, 72, 72, -7, -6, -8, -11, -22, -15, -16, -10, -19, -20, -24, -12, -5, -9, -1, 74, 44, 47, 48, 76, 41, 46, 52, 51, -25, 53, -13, -14, 43, 45, 67, 36, 69, 10, 9, 77, 54, 49, 50, -7, -6, -8, -6, -8, -17, -11, 76, -15, 76, -7, -15, -7, -7, -21, -1, 74, -18, -6, 74, -10, -1, 67, 68, 46, -7, -15, -32, 73, -11, -11, -11, -11, -7, -15, -7, -6, -7, -8, 74, -7, -8, -7, -8, -32, -7, -11, 73, -15, -16, -32, -9, -1, -9, -32, -29, -30, -2, -1, -2, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 74, -5, -2, 74, -6, 66, -1, 74, 74, 74, 74, -4, 7, 9, 10, -1, -1, -1, 73, 73, 73, 73, 73, 73, 73, 65, 10, 73, -1, 73, 73, 73, 73, 73, -12, 73, 73, 74, -4, -4, 73, -32, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, -32, -32, -7, -11, -32, -32, 73, 74, 12, -28, -28, 72, 9, 10, 11, 12, 13, 7, 8, 6, 5, 4, 72, -7, -6, -8, -15, -10, -20, -24, -12, -19, -7, -7, -6, -8, -22, -15, -11, -10, -23, -7, 48, -7, -10, -19, -10, -7, -7, -7, -7, -5, -3, 38, 37, 39, 75, 9, 75, -1, -1, -1, -1, -5, -1, 74, 8, -1, -1, -7, -6, -8, -7, -7, -11, -11, -11, -11, -6, -8, 65, -1, -5, -15, -7, -5, -7, -5, -7, -7, -21, -1, 75, -18, -6, 74, -1, -18, -6, 74, -1, 40, -5, -5, -11, -11, -11, -11, -7, -15, -7, -7, -7, -6, -7, -15, -8, -15, -7, -8, -15, -1, -1, -2, -2, -2, -2, -2, 7, 8, -2, -2, -2, 73, 73, 74, 75, 75, -5, 75, 75, 75, 75, 75, 75, -3, -4, 73, 73, 73, 73, 73, -12, -12, 73, 75, 73, 73, 73, 73, 73, 73, 73, 73, 73, 70, 73, 73, -2, -2, -20, 46, -22, -1, 75, 75, 74, -7, -7, -7, -7, -21, 75, 75, -18, -6, 74, -11, -11, -10, -10, -10, -15, -26, -1, -15, -26, -7, -8, -15, -15, -15, -16, -17, 76, 75, 38, -12, 73, 73, 73, 73, 73, 73, 70, 10, 75, 75, -11, -7, -7, -1, -7, -7, -15 }; short yydef[] = { 1, -2, 2, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 155, 0, 0, 155, 3, 5, 0, 0, 9, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 150, 0, 0, 135, 0, 133, 0, 137, 125, 128, 0, 130, 0, 122, 123, 146, 0, 157, 163, 164, 0, 0, 0, 127, 124, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 139, 0, 63, 64, 0, 0, 0, 157, 157, 0, 155, 0, 78, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 102, 155, 155, 156, 155, 155, 109, 0, 0, 0, 117, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, 145, 0, 0, 0, 0, 0, 0, 0, 0, 165, 166, 167, 0, 0, 0, 0, 0, 0, 0, 143, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 120, 156, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 104, 105, 106, 107, 108, 0, 0, 0, 4, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 13, 25, 26, 0, 38, 39, 58, 60, 62, 14, 15, 29, 30, 32, 0, 31, 34, 35, 49, 0, 50, 53, 61, 54, 56, 55, 57, 59, 0, 0, 160, 161, 162, 148, 0, 168, 0, 0, 0, 0, 0, 0, 0, 157, 158, 159, 16, 27, 28, 17, 18, 19, 20, 21, 22, 23, 24, 144, 36, 121, 0, 43, 121, 44, 121, 46, 47, 51, 139, 65, 66, 67, 0, 0, 69, 70, 0, 0, 0, 75, 76, 79, 80, 0, 83, 85, 86, 0, 0, 93, 94, 95, 0, 97, 0, 99, 100, 110, 0, 0, 170, 171, 172, 173, 174, 0, 0, 177, 178, 179, 0, 0, 0, 151, 152, 0, 136, 138, 129, 131, 132, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 175, 176, 37, 125, 33, 0, 149, 153, 0, 40, 42, 41, 45, 52, 68, 71, 72, 73, 0, 81, 0, 84, 87, 88, 0, 0, 0, 0, 0, 96, 98, 112, 111, 114, 115, 116, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 74, 82, 89, 90, 140, 91, 92, 113 }; short yytok1[] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 13, 6, 0, 74, 75, 11, 9, 73, 10, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 72, 7, 71, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 77 }; short yytok2[] = { 2, 3, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 }; long yytok3[] = { 0 }; #define YYFLAG -1000 #define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 #ifdef yydebug #include "y.debug" #else #define yydebug 0 char* yytoknames[1]; /* for debugging */ char* yystates[1]; /* for debugging */ #endif /* parser for yacc output */ int yynerrs = 0; /* number of errors */ int yyerrflag = 0; /* error recovery flag */ extern int fprint(int, char*, ...); extern int sprint(char*, char*, ...); char* yytokname(int yyc) { static char x[10]; if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0])) if(yytoknames[yyc-1]) return yytoknames[yyc-1]; sprint(x, "<%d>", yyc); return x; } char* yystatname(int yys) { static char x[10]; if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0])) if(yystates[yys]) return yystates[yys]; sprint(x, "<%d>\n", yys); return x; } long yylex1(void) { long yychar; long *t3p; int c; yychar = yylex(); if(yychar <= 0) { c = yytok1[0]; goto out; } if(yychar < sizeof(yytok1)/sizeof(yytok1[0])) { c = yytok1[yychar]; goto out; } if(yychar >= YYPRIVATE) if(yychar < YYPRIVATE+sizeof(yytok2)/sizeof(yytok2[0])) { c = yytok2[yychar-YYPRIVATE]; goto out; } for(t3p=yytok3;; t3p+=2) { c = t3p[0]; if(c == yychar) { c = t3p[1]; goto out; } if(c == 0) break; } c = 0; out: if(c == 0) c = yytok2[1]; /* unknown char */ if(yydebug >= 3) fprint(2, "lex %.4lux %s\n", yychar, yytokname(c)); return c; } int yyparse(void) { struct { YYSTYPE yyv; int yys; } yys[YYMAXDEPTH], *yyp, *yypt; short *yyxi; int yyj, yym, yystate, yyn, yyg; long yychar; YYSTYPE save1, save2; int save3, save4; save1 = yylval; save2 = yyval; save3 = yynerrs; save4 = yyerrflag; yystate = 0; yychar = -1; yynerrs = 0; yyerrflag = 0; yyp = &yys[-1]; goto yystack; ret0: yyn = 0; goto ret; ret1: yyn = 1; goto ret; ret: yylval = save1; yyval = save2; yynerrs = save3; yyerrflag = save4; return yyn; yystack: /* put a state and value onto the stack */ if(yydebug >= 4) fprint(2, "char %s in %s", yytokname(yychar), yystatname(yystate)); yyp++; if(yyp >= &yys[YYMAXDEPTH]) { yyerror("yacc stack overflow"); goto ret1; } yyp->yys = yystate; yyp->yyv = yyval; yynewstate: yyn = yypact[yystate]; if(yyn <= YYFLAG) goto yydefault; /* simple state */ if(yychar < 0) yychar = yylex1(); yyn += yychar; if(yyn < 0 || yyn >= YYLAST) goto yydefault; yyn = yyact[yyn]; if(yychk[yyn] == yychar) { /* valid shift */ yychar = -1; yyval = yylval; yystate = yyn; if(yyerrflag > 0) yyerrflag--; goto yystack; } yydefault: /* default state action */ yyn = yydef[yystate]; if(yyn == -2) { if(yychar < 0) yychar = yylex1(); /* look through exception table */ for(yyxi=yyexca;; yyxi+=2) if(yyxi[0] == -1 && yyxi[1] == yystate) break; for(yyxi += 2;; yyxi += 2) { yyn = yyxi[0]; if(yyn < 0 || yyn == yychar) break; } yyn = yyxi[1]; if(yyn < 0) goto ret0; } if(yyn == 0) { /* error ... attempt to resume parsing */ switch(yyerrflag) { case 0: /* brand new error */ yyerror("syntax error"); yynerrs++; if(yydebug >= 1) { fprint(2, "%s", yystatname(yystate)); fprint(2, "saw %s\n", yytokname(yychar)); } case 1: case 2: /* incompletely recovered error ... try again */ yyerrflag = 3; /* find a state where "error" is a legal shift action */ while(yyp >= yys) { yyn = yypact[yyp->yys] + YYERRCODE; if(yyn >= 0 && yyn < YYLAST) { yystate = yyact[yyn]; /* simulate a shift of "error" */ if(yychk[yystate] == YYERRCODE) goto yystack; } /* the current yyp has no shift onn "error", pop stack */ if(yydebug >= 2) fprint(2, "error recovery pops state %d, uncovers %d\n", yyp->yys, (yyp-1)->yys ); yyp--; } /* there is no state on the stack with an error shift ... abort */ goto ret1; case 3: /* no shift yet; clobber input char */ if(yydebug >= 2) fprint(2, "error recovery discards %s\n", yytokname(yychar)); if(yychar == YYEOFCODE) goto ret1; yychar = -1; goto yynewstate; /* try again in the same state */ } } /* reduction by production yyn */ if(yydebug >= 2) fprint(2, "reduce %d in:\n\t%s", yyn, yystatname(yystate)); yypt = yyp; yyp -= yyr2[yyn]; yyval = (yyp+1)->yyv; yym = yyn; /* consult goto table to find next state */ yyn = yyr1[yyn]; yyg = yypgo[yyn]; yyj = yyg + yyp->yys + 1; if(yyj >= YYLAST || yychk[yystate=yyact[yyj]] != -yyn) yystate = yyact[yyg]; switch(yym) { case 3: #line 42 "a.y" { if(yypt[-1].yyv.sym->value != pc) yyerror("redeclaration of %s", yypt[-1].yyv.sym->name); yypt[-1].yyv.sym->value = pc; } break; case 5: #line 49 "a.y" { yypt[-1].yyv.sym->type = LLAB; yypt[-1].yyv.sym->value = pc; } break; case 7: #line 55 "a.y" { yypt[-3].yyv.sym->type = LVAR; yypt[-3].yyv.sym->value = yypt[-1].yyv.lval; } break; case 8: #line 60 "a.y" { if(yypt[-3].yyv.sym->value != yypt[-1].yyv.lval) yyerror("redeclaration of %s", yypt[-3].yyv.sym->name); yypt[-3].yyv.sym->value = yypt[-1].yyv.lval; } break; case 9: #line 66 "a.y" { nosched = yypt[-1].yyv.lval; } break; case 13: #line 78 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 14: #line 82 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 15: #line 86 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 16: #line 90 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 17: #line 94 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 18: #line 98 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 19: #line 105 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 20: #line 109 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 21: #line 113 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 22: #line 117 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 23: #line 121 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 24: #line 125 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 25: #line 132 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 26: #line 136 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 27: #line 140 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 28: #line 144 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 29: #line 151 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 30: #line 155 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 31: #line 162 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 32: #line 166 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 33: #line 170 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 34: #line 174 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 35: #line 178 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 36: #line 182 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, yypt[-0].yyv.lval, &nullgen); } break; case 37: #line 189 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 38: #line 193 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 39: #line 197 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 40: #line 206 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 41: #line 210 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 42: #line 214 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 43: #line 218 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 44: #line 222 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 45: #line 226 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 46: #line 230 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 47: #line 234 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 48: #line 238 "a.y" { outcode(yypt[-1].yyv.lval, &yypt[-0].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 49: #line 245 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 50: #line 249 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 51: #line 256 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, yypt[-0].yyv.gen.reg, &yypt[-0].yyv.gen); } break; case 52: #line 260 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 53: #line 268 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 54: #line 272 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 55: #line 276 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 56: #line 280 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 57: #line 284 "a.y" { int r; r = yypt[-2].yyv.gen.offset; yypt[-2].yyv.gen.offset = 0; outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, r, &yypt[-0].yyv.gen); } break; case 58: #line 291 "a.y" { int r; r = yypt[-0].yyv.gen.offset; yypt[-0].yyv.gen.offset = 0; outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, r, &yypt[-0].yyv.gen); } break; case 59: #line 298 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 60: #line 302 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 61: #line 306 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 62: #line 310 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 63: #line 319 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &yypt[-0].yyv.gen); } break; case 64: #line 323 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &yypt[-0].yyv.gen); } break; case 65: #line 327 "a.y" { outcode(yypt[-3].yyv.lval, &nullgen, NREG, &yypt[-1].yyv.gen); } break; case 66: #line 331 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 67: #line 335 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 68: #line 339 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-1].yyv.gen); } break; case 69: #line 343 "a.y" { outcode(yypt[-3].yyv.lval, &nullgen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 70: #line 347 "a.y" { outcode(yypt[-3].yyv.lval, &nullgen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 71: #line 351 "a.y" { outcode(yypt[-5].yyv.lval, &nullgen, yypt[-4].yyv.lval, &yypt[-1].yyv.gen); } break; case 72: #line 355 "a.y" { Gen g; g = nullgen; g.type = D_CONST; g.offset = yypt[-4].yyv.lval; outcode(yypt[-5].yyv.lval, &g, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 73: #line 363 "a.y" { Gen g; g = nullgen; g.type = D_CONST; g.offset = yypt[-4].yyv.lval; outcode(yypt[-5].yyv.lval, &g, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 74: #line 371 "a.y" { Gen g; g = nullgen; g.type = D_CONST; g.offset = yypt[-6].yyv.lval; outcode(yypt[-7].yyv.lval, &g, yypt[-4].yyv.lval, &yypt[-1].yyv.gen); } break; case 75: #line 382 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, yypt[-0].yyv.lval, &nullgen); } break; case 76: #line 386 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, yypt[-0].yyv.lval, &nullgen); } break; case 77: #line 390 "a.y" { outcode(yypt[-2].yyv.lval, &yypt[-1].yyv.gen, NREG, &nullgen); } break; case 78: #line 394 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &nullgen); } break; case 79: #line 401 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 80: #line 405 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 81: #line 409 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.gen.reg, &yypt[-0].yyv.gen); } break; case 82: #line 413 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.gen.reg, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 83: #line 417 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 84: #line 421 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-0].yyv.gen.reg, &yypt[-2].yyv.gen); } break; case 85: #line 428 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 86: #line 432 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 87: #line 436 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-0].yyv.gen.reg, &yypt[-2].yyv.gen); } break; case 88: #line 440 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-0].yyv.gen.reg, &yypt[-2].yyv.gen); } break; case 89: #line 447 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.gen.reg, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 90: #line 451 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.gen.reg, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 91: #line 455 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.gen.reg, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 92: #line 459 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.gen.reg, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 93: #line 466 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 94: #line 470 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 95: #line 478 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 96: #line 482 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 97: #line 486 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 98: #line 490 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-2].yyv.gen, &yypt[-0].yyv.gen); } break; case 99: #line 494 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 100: #line 498 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 101: #line 502 "a.y" { outcode(yypt[-1].yyv.lval, &yypt[-0].yyv.gen, NREG, &nullgen); } break; case 102: #line 509 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &nullgen); } break; case 103: #line 513 "a.y" { outcode(yypt[-2].yyv.lval, &yypt[-1].yyv.gen, NREG, &nullgen); } break; case 104: #line 517 "a.y" { outcode(yypt[-2].yyv.lval, &yypt[-1].yyv.gen, NREG, &nullgen); } break; case 105: #line 521 "a.y" { outcode(yypt[-2].yyv.lval, &nullgen, NREG, &yypt[-0].yyv.gen); } break; case 106: #line 525 "a.y" { outcode(yypt[-2].yyv.lval, &nullgen, NREG, &yypt[-0].yyv.gen); } break; case 107: #line 532 "a.y" { outcode(yypt[-2].yyv.lval, &yypt[-1].yyv.gen, NREG, &nullgen); } break; case 108: #line 536 "a.y" { outcode(yypt[-2].yyv.lval, &yypt[-1].yyv.gen, NREG, &nullgen); } break; case 109: #line 543 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &nullgen); } break; case 110: #line 550 "a.y" { outcode(yypt[-3].yyv.lval, &yypt[-2].yyv.gen, NREG, &yypt[-0].yyv.gen); } break; case 111: #line 554 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 112: #line 558 "a.y" { outgcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, NREG, &yypt[-0].yyv.gen, &yypt[-2].yyv.gen); } break; case 113: #line 562 "a.y" { outgcode(yypt[-7].yyv.lval, &yypt[-6].yyv.gen, yypt[-4].yyv.lval, &yypt[-0].yyv.gen, &yypt[-2].yyv.gen); } break; case 114: #line 569 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 115: #line 573 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 116: #line 577 "a.y" { outcode(yypt[-5].yyv.lval, &yypt[-4].yyv.gen, yypt[-2].yyv.lval, &yypt[-0].yyv.gen); } break; case 117: #line 584 "a.y" { outcode(yypt[-1].yyv.lval, &nullgen, NREG, &nullgen); } break; case 118: #line 590 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_BRANCH; yyval.gen.offset = yypt[-3].yyv.lval + pc; } break; case 119: #line 596 "a.y" { yyval.gen = nullgen; if(pass == 2) yyerror("undefined label: %s", yypt[-1].yyv.sym->name); yyval.gen.type = D_BRANCH; yyval.gen.sym = yypt[-1].yyv.sym; yyval.gen.offset = yypt[-0].yyv.lval; } break; case 120: #line 605 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_BRANCH; yyval.gen.sym = yypt[-1].yyv.sym; yyval.gen.offset = yypt[-1].yyv.sym->value + yypt[-0].yyv.lval; } break; case 121: #line 614 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_REG; yyval.gen.reg = yypt[-0].yyv.lval; } break; case 124: #line 626 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SPR; yyval.gen.offset = yypt[-0].yyv.lval; } break; case 125: #line 634 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_CREG; yyval.gen.reg = NREG; /* whole register */ } break; case 126: #line 642 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SPR; yyval.gen.offset = yypt[-0].yyv.lval; } break; case 127: #line 650 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_MSR; } break; case 128: #line 657 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SPR; yyval.gen.offset = yypt[-0].yyv.lval; } break; case 129: #line 663 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SPR; yyval.gen.offset = yypt[-1].yyv.lval; } break; case 131: #line 672 "a.y" { if(yypt[-1].yyv.lval < 0 || yypt[-1].yyv.lval > 15) yyerror("segment register number out of range"); yyval.gen = nullgen; yyval.gen.type = D_SREG; yyval.gen.reg = yypt[-1].yyv.lval; yyval.gen.offset = NREG; } break; case 132: #line 681 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SREG; yyval.gen.reg = NREG; yyval.gen.offset = yypt[-1].yyv.lval; } break; case 133: #line 690 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FPSCR; yyval.gen.reg = NREG; } break; case 134: #line 698 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FPSCR; yyval.gen.reg = yypt[-1].yyv.lval; } break; case 135: #line 706 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FREG; yyval.gen.reg = yypt[-0].yyv.lval; } break; case 136: #line 712 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FREG; yyval.gen.reg = yypt[-1].yyv.lval; } break; case 137: #line 720 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_CREG; yyval.gen.reg = yypt[-0].yyv.lval; } break; case 138: #line 726 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_CREG; yyval.gen.reg = yypt[-1].yyv.lval; } break; case 139: #line 734 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_REG; yyval.gen.reg = yypt[-0].yyv.lval; } break; case 140: #line 742 "a.y" { int mb, me; ulong v; yyval.gen = nullgen; yyval.gen.type = D_CONST; mb = yypt[-2].yyv.lval; me = yypt[-0].yyv.lval; if(mb < 0 || mb > 31 || me < 0 || me > 31){ yyerror("illegal mask start/end value(s)"); mb = me = 0; } if(mb <= me) v = ((ulong)~0L>>mb) & (~0L<<(31-me)); else v = ~(((ulong)~0L>>(me+1)) & (~0L<<(31-(mb-1)))); yyval.gen.offset = v; } break; case 141: #line 763 "a.y" { yyval.gen = yypt[-0].yyv.gen; yyval.gen.type = D_CONST; } break; case 142: #line 768 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_SCONST; memcpy(yyval.gen.sval, yypt[-0].yyv.sval, sizeof(yyval.gen.sval)); } break; case 143: #line 776 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FCONST; yyval.gen.dval = yypt[-0].yyv.dval; } break; case 144: #line 782 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_FCONST; yyval.gen.dval = -yypt[-0].yyv.dval; } break; case 145: #line 789 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_CONST; yyval.gen.offset = yypt[-0].yyv.lval; } break; case 147: #line 798 "a.y" { if(yyval.lval < 0 || yyval.lval >= NREG) print("register value out of range\n"); yyval.lval = yypt[-1].yyv.lval; } break; case 148: #line 806 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.reg = yypt[-1].yyv.lval; yyval.gen.offset = 0; } break; case 149: #line 813 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.reg = yypt[-3].yyv.lval; yyval.gen.xreg = yypt[-1].yyv.lval; yyval.gen.offset = 0; } break; case 151: #line 824 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.reg = yypt[-1].yyv.lval; yyval.gen.offset = yypt[-3].yyv.lval; } break; case 152: #line 833 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.name = yypt[-1].yyv.lval; yyval.gen.sym = S; yyval.gen.offset = yypt[-3].yyv.lval; } break; case 153: #line 841 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.name = yypt[-1].yyv.lval; yyval.gen.sym = yypt[-4].yyv.sym; yyval.gen.offset = yypt[-3].yyv.lval; } break; case 154: #line 849 "a.y" { yyval.gen = nullgen; yyval.gen.type = D_OREG; yyval.gen.name = D_STATIC; yyval.gen.sym = yypt[-6].yyv.sym; yyval.gen.offset = yypt[-3].yyv.lval; } break; case 157: #line 861 "a.y" { yyval.lval = 0; } break; case 158: #line 865 "a.y" { yyval.lval = yypt[-0].yyv.lval; } break; case 159: #line 869 "a.y" { yyval.lval = -yypt[-0].yyv.lval; } break; case 164: #line 881 "a.y" { yyval.lval = yypt[-0].yyv.sym->value; } break; case 165: #line 885 "a.y" { yyval.lval = -yypt[-0].yyv.lval; } break; case 166: #line 889 "a.y" { yyval.lval = yypt[-0].yyv.lval; } break; case 167: #line 893 "a.y" { yyval.lval = ~yypt[-0].yyv.lval; } break; case 168: #line 897 "a.y" { yyval.lval = yypt[-1].yyv.lval; } break; case 170: #line 904 "a.y" { yyval.lval = yypt[-2].yyv.lval + yypt[-0].yyv.lval; } break; case 171: #line 908 "a.y" { yyval.lval = yypt[-2].yyv.lval - yypt[-0].yyv.lval; } break; case 172: #line 912 "a.y" { yyval.lval = yypt[-2].yyv.lval * yypt[-0].yyv.lval; } break; case 173: #line 916 "a.y" { yyval.lval = yypt[-2].yyv.lval / yypt[-0].yyv.lval; } break; case 174: #line 920 "a.y" { yyval.lval = yypt[-2].yyv.lval % yypt[-0].yyv.lval; } break; case 175: #line 924 "a.y" { yyval.lval = yypt[-3].yyv.lval << yypt[-0].yyv.lval; } break; case 176: #line 928 "a.y" { yyval.lval = yypt[-3].yyv.lval >> yypt[-0].yyv.lval; } break; case 177: #line 932 "a.y" { yyval.lval = yypt[-2].yyv.lval & yypt[-0].yyv.lval; } break; case 178: #line 936 "a.y" { yyval.lval = yypt[-2].yyv.lval ^ yypt[-0].yyv.lval; } break; case 179: #line 940 "a.y" { yyval.lval = yypt[-2].yyv.lval | yypt[-0].yyv.lval; } break; } goto yystack; /* stack new state and value */ }