/* @(#)gram.x 1.2 */ # define EOS 2 # define NEWLINE 3 # define LPAR 4 # define RPAR 5 # define LBRACK 6 # define RBRACK 7 # define COMMA 8 # define COLON 9 # define ASGNOP 10 # define REPOP 11 # define OR 12 # define AND 13 # define NOT 14 # define RELOP 15 # define ADDOP 16 # define MULTOP 17 # define POWER 18 # define DOUBLEADDOP 19 # define ARROW 20 # define QUALOP 21 # define NAME 22 # define OPTNAME 23 # define STRUCTNAME 24 # define COMNAME 25 # define CONST 26 # define COMMON 27 # define INTERNAL 28 # define EXTERNAL 29 # define AUTOMATIC 30 # define STATIC 31 # define VALUE 32 # define PROCEDURE 33 # define BLOCKDATA 34 # define OPTION 35 # define INCLUDE 36 # define DEFINE 37 # define END 38 # define INTEGER 39 # define REAL 40 # define COMPLEX 41 # define LOGICAL 42 # define CHARACTER 43 # define STRUCT 44 # define FIELD 45 # define ARRAY 46 # define DIMENSION 47 # define LONG 48 # define SHORT 49 # define INITIAL 50 # define EQUIVALENCE 51 # define IMPLICIT 52 # define DEBUG 53 # define IF 54 # define ELSE 55 # define WHILE 56 # define UNTIL 57 # define REPEAT 58 # define DO 59 # define FOR 60 # define SWITCH 61 # define CASE 62 # define DEFAULT 63 # define GO 64 # define GOTO 65 # define BREAK 66 # define EXIT 67 # define NEXT 68 # define RETURN 69 # define CONTINUE 70 # define CALL 71 # define DOUBLE 72 # define PRECISION 73 # define DOUBLEPRECISION 74 # define SIZEOF 75 # define LENGTHOF 76 # define LETTER 77 # define READ 78 # define WRITE 79 # define READBIN 80 # define WRITEBIN 81 # define TRUE 82 # define FALSE 83 # define ESCAPE 84 # line 86 "gram.in" #include "defs" ptr bgnexec(), addexec(), bgnproc(), mkvar(), mkcomm(), mkstruct(), mkarrow(); ptr mkiost(), mkioitem(), mkiogroup(), mkformat(); ptr funcinv(), extrfield(), typexpr(), strucelt(), mkfield(); ptr esizeof(), elenof(), mkilab(); ptr ifthen(), doloop(); struct varblock *subscript(); # line 96 "gram.in" typedef union { int ival; ptr pval; char *cval; } YYSTYPE; # line 125 "gram.in" extern int prevv; extern YYSTYPE prevl; ptr p; ptr procattrs; int i,n; static int imptype; static int ininit =NO; #define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 extern int yychar; extern short yyerrflag; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif YYSTYPE yylval, yyval; # define YYERRCODE 256 # line 1013 "gram.in" setyydeb() { #ifdef YYDEBUG yydebug = 1; #endif } short yyexca[] ={ -1, 0, 0, 1, -2, 175, -1, 1, 0, -1, -2, 0, -1, 80, 10, 152, 20, 152, 21, 152, -2, 178, -1, 165, 20, 152, 21, 152, -2, 179, -1, 262, 7, 191, -2, 14, -1, 351, 15, 0, -2, 144, }; # define YYNPROD 284 # define YYLAST 1448 short yyact[]={ 225, 247, 408, 431, 412, 124, 409, 337, 223, 197, 157, 20, 258, 224, 185, 156, 19, 6, 140, 3, 20, 155, 61, 139, 286, 19, 59, 314, 5, 131, 297, 152, 212, 44, 182, 198, 37, 34, 36, 32, 33, 35, 21, 22, 16, 191, 14, 135, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 10, 12, 11, 72, 227, 121, 77, 64, 17, 20, 446, 66, 60, 413, 19, 179, 189, 425, 58, 195, 196, 338, 42, 149, 43, 141, 65, 80, 73, 109, 129, 78, 87, 71, 199, 400, 399, 170, 200, 172, 178, 167, 175, 176, 177, 154, 211, 233, 305, 120, 315, 203, 325, 218, 243, 326, 137, 62, 220, 218, 68, 447, 148, 147, 356, 74, 209, 222, 242, 199, 123, 204, 256, 200, 201, 202, 213, 229, 216, 215, 214, 217, 213, 68, 216, 215, 214, 217, 134, 62, 73, 169, 245, 165, 20, 164, 80, 166, 109, 19, 78, 87, 278, 76, 132, 260, 133, 273, 161, 201, 202, 144, 148, 147, 163, 382, 267, 250, 263, 160, 265, 271, 272, 273, 148, 147, 259, 433, 280, 394, 282, 148, 147, 228, 268, 269, 270, 239, 279, 69, 287, 272, 273, 289, 235, 250, 127, 295, 296, 298, 298, 58, 303, 240, 291, 292, 238, 262, 146, 128, 18, 65, 252, 251, 344, 343, 449, 307, 148, 147, 55, 310, 460, 429, 417, 253, 254, 434, 264, 283, 300, 293, 20, 329, 20, 304, 173, 19, 20, 19, 319, 322, 321, 19, 171, 372, 428, 316, 330, 429, 317, 327, 323, 281, 141, 276, 7, 274, 271, 272, 273, 342, 367, 348, 349, 350, 351, 352, 353, 354, 355, 335, 392, 248, 154, 393, 357, 360, 143, 377, 363, 462, 378, 364, 463, 287, 365, 277, 275, 276, 234, 274, 271, 272, 273, 274, 271, 272, 273, 373, 376, 339, 159, 375, 340, 380, 158, 302, 371, 366, 358, 361, 333, 301, 255, 334, 236, 159, 379, 418, 389, 237, 414, 145, 390, 420, 391, 423, 277, 275, 276, 396, 274, 271, 272, 273, 398, 134, 416, 331, 397, 415, 332, 451, 395, 277, 275, 276, 381, 274, 271, 272, 273, 369, 259, 312, 277, 275, 276, 410, 274, 271, 272, 273, 279, 445, 407, 279, 436, 465, 427, 250, 150, 419, 250, 277, 275, 276, 421, 274, 271, 272, 273, 125, 406, 20, 125, 403, 306, 285, 19, 284, 424, 422, 308, 74, 122, 277, 275, 276, 249, 274, 271, 272, 273, 219, 210, 207, 206, 435, 48, 205, 439, 437, 50, 438, 52, 53, 162, 442, 126, 410, 125, 441, 440, 444, 388, 443, 410, 448, 450, 387, 386, 385, 383, 347, 453, 456, 345, 457, 458, 150, 49, 414, 459, 51, 411, 142, 9, 461, 454, 188, 370, 186, 208, 464, 187, 107, 192, 68, 99, 44, 97, 180, 37, 34, 36, 32, 33, 35, 96, 426, 95, 266, 174, 88, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 455, 86, 84, 341, 168, 452, 277, 275, 276, 116, 274, 271, 272, 273, 277, 275, 276, 261, 274, 271, 272, 273, 42, 82, 43, 193, 194, 150, 113, 114, 111, 112, 195, 196, 384, 230, 328, 188, 221, 186, 226, 336, 187, 153, 192, 68, 241, 44, 70, 180, 37, 34, 36, 32, 33, 35, 151, 63, 136, 54, 8, 75, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 430, 13, 277, 275, 276, 404, 274, 271, 272, 273, 232, 277, 275, 276, 231, 274, 271, 272, 273, 4, 2, 102, 42, 432, 43, 193, 194, 110, 113, 114, 111, 112, 195, 196, 150, 181, 29, 23, 288, 25, 294, 299, 290, 346, 188, 85, 186, 15, 246, 187, 67, 192, 68, 184, 44, 183, 180, 37, 34, 36, 32, 33, 35, 28, 56, 309, 24, 318, 138, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 401, 130, 257, 320, 1, 0, 277, 275, 276, 0, 274, 271, 272, 273, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 43, 193, 194, 0, 113, 114, 111, 112, 195, 196, 150, 244, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 186, 0, 0, 187, 0, 192, 68, 190, 44, 0, 180, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 374, 0, 0, 0, 0, 0, 277, 275, 276, 0, 274, 271, 272, 273, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 43, 193, 194, 150, 113, 114, 111, 112, 195, 196, 0, 0, 0, 188, 0, 186, 0, 0, 187, 0, 192, 68, 190, 44, 0, 180, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 368, 0, 0, 0, 0, 0, 277, 275, 276, 0, 274, 271, 272, 273, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 43, 193, 194, 0, 113, 114, 111, 112, 195, 196, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 186, 0, 0, 187, 0, 192, 68, 190, 44, 0, 180, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 362, 45, 27, 30, 31, 46, 47, 313, 0, 277, 275, 276, 311, 274, 271, 272, 273, 0, 277, 275, 276, 0, 274, 271, 272, 273, 0, 0, 0, 42, 0, 43, 193, 194, 0, 113, 114, 111, 112, 195, 196, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 186, 0, 0, 187, 0, 192, 68, 190, 44, 0, 180, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 359, 45, 27, 30, 31, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 43, 193, 194, 0, 113, 114, 111, 112, 195, 196, 44, 0, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 190, 14, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 10, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 57, 0, 0, 0, 0, 0, 42, 0, 43, 0, 0, 0, 79, 0, 0, 91, 62, 0, 44, 92, 0, 37, 34, 36, 32, 33, 35, 21, 22, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 90, 104, 0, 106, 190, 105, 116, 115, 108, 94, 93, 101, 100, 118, 119, 117, 98, 103, 81, 0, 42, 0, 43, 0, 0, 113, 114, 111, 112, 0, 62, 89, 44, 0, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 10, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 37, 34, 36, 32, 33, 35, 0, 42, 0, 43, 0, 190, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 10, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 405, 0, 0, 0, 0, 0, 0, 42, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 324, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 0, 150, 402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 44, 43, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 42, 44, 43, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 44, 43, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 37, 34, 36, 32, 33, 35, 0, 0, 0, 42, 0, 43, 38, 39, 40, 41, 26, 45, 27, 30, 31, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 43 }; short yypact[]={ 9,-1000, 449, 449, 452, 449, 449,-1000,-1000,1032, 97,-1000, 120, 140,-1000,1031,-1000,-1000,-1000, 401, 401,-1000,-1000,-1000,-1000,-1000, 427, 425,-1000,-1000, -1000,-1000,-1000,-1000,-1000,-1000,-1000, 201,-1000,-1000, -1000,-1000, 16,-1000,-1000, 141,-1000,-1000,-1000,-1000, -1000,-1000,-1000,-1000, 92,-1000,-1000,1092,-1000, 279, -1000, 401,-1000, 324,-1000, 207,-1000, 377,-1000,1373, 307, 303,-1000, 170, 97, 423,-1000,-1000, 163, 97, -1000, 97,-1000,-1000,1031,-1000,-1000,-1000,-1000,-1000, -1000, 244,-1000, 236,-1000,-1000,-1000,-1000, 752,-1000, 106, 108, 416,-1000, 413,-1000, 412,-1000, 411,-1000, 79,-1000,-1000,-1000,-1000, 410, 752,-1000,-1000,-1000, -1000,-1000,-1000,-1000,-1000, 752, 519,-1000,-1000,-1000, -1000,-1000,-1000,-1000,-1000, 68, 291, 193, 323,-1000, -1000, 279,1288, 94, 186, 97,-1000, 105, 89,-1000, 679, 274,-1000, 405,1373,-1000,-1000, 401, 400, 97, 97, 318, 126, 752, 101,-1000, 101,-1000,-1000,-1000, -1000,-1000, 228,-1000, 752,-1000,-1000,-1000, 354, 151, -1000,-1000,1337,-1000,-1000,-1000, 752, 97, 752,-1000, -1000,-1000, -4, 396, 394,-1000,-1000,-1000, 599,-1000, -1000, 752,-1000, 71, 106, 752, 752, 752, 752, 314, 752, 85, 81,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 395, 519, 882, 359,-1000, 873,-1000, 84, 84, 340, 1130,-1000, 972,-1000,-1000, 88,1092,-1000,-1000,-1000, -1000, 752, 377,-1000,-1000, 343, 316,-1000,1373, 3, -1000,-1000,-1000, 101, 101,-1000,-1000, 305,-1000,-1000, 354,-1000,-1000,-1000,-1000,-1000, 215, 354, 445, 442, -1000, 752, 752, 752, 752, 752, 752, 752, 752,-1000, 148, 101, 289, 102, 912, 832,-1000, 354, 752, 354, 287,-1000,-1000, 599, 263, 354, 797, 357, 354,-1000, 246,-1000,-1000, 724,-1000,-1000,-1000,-1000, 752, 283, -1000,-1000,-1000, 519, 352,-1000, 157,-1000, 441,-1000, -1000, 440, 439, 438, 433,-1000,-1000,-1000, 752, 354, -1000,-1000, 752,-1000, 752,-1000, 276,-1000, 172,-1000, 94, 333,-1000,-1000, 752, 40,-1000, 37, 183, 148, 148, 164, 251, 289, 354, 354,-1000, 644,1239, 391, 569,1190, 388, 354,-1000, 71,-1000, 446,-1000,-1000, -1000, 345,-1000, 225,-1000,-1000, 326,-1000, 519,-1000, 354,-1000,-1000,1130, 329,-1000,-1000,-1000,-1000, 354, 354, 354,-1000, 3, -1,-1000,-1000,-1000, 354,-1000, 375,-1000,-1000,-1000,-1000,-1000,-1000,-1000, 250,-1000, 560,-1000, 227, 325,-1000,-1000,-1000,-1000,-1000,-1000, 752,-1000,-1000, 431,-1000,-1000,-1000, 752,-1000, 446, -1000,-1000, 370, 43,-1000, 216, 446, 347,-1000, 499, -1000,-1000, 491,-1000,-1000, 752,-1000,-1000,-1000,-1000, 224,-1000,-1000,-1000,-1000,-1000, 285,-1000,-1000,-1000, -1000,-1000,-1000, 752, 373,-1000 }; short yypgo[]={ 0, 653, 18, 652, 17, 47, 219, 651, 12, 22, 27, 650, 23, 637, 636, 34, 92, 456, 67, 635, 108, 64, 634, 8, 13, 633, 26, 71, 21, 15, 632, 29, 0, 74, 14, 75, 624, 622, 70, 619, 617, 616, 614, 612, 611, 35, 24, 72, 30, 610, 609, 2, 6, 4, 3, 608, 606, 605, 604, 45, 596, 32, 592, 590, 9, 589, 419, 588, 583, 28, 579, 570, 557, 556, 555, 554, 5, 553, 186, 552, 1, 544, 66, 542, 31, 539, 537, 7, 62, 10, 534, 532, 63, 531, 530, 65, 519, 513, 500, 499, 498, 497, 484, 483, 482, 481, 480, 479, 471, 469, 466, 463, 461, 377 }; short yyr1[]={ 0, 1, 1, 1, 1, 1, 1, 1, 66, 3, 3, 3, 3, 5, 70, 5, 67, 67, 67, 67, 72, 71, 71, 6, 6, 7, 7, 8, 65, 73, 74, 74, 74, 75, 75, 75, 69, 68, 76, 13, 13, 13, 12, 12, 2, 2, 2, 2, 2, 2, 14, 14, 14, 77, 77, 83, 82, 79, 79, 84, 84, 85, 86, 86, 87, 87, 81, 81, 88, 16, 16, 17, 17, 18, 18, 20, 20, 90, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 91, 27, 9, 15, 15, 28, 28, 29, 29, 29, 29, 29, 29, 29, 56, 56, 56, 56, 56, 19, 19, 92, 10, 10, 55, 55, 55, 55, 55, 55, 30, 30, 30, 11, 11, 93, 94, 31, 89, 89, 57, 57, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 38, 38, 38, 38, 38, 39, 34, 34, 34, 40, 40, 36, 36, 36, 37, 37, 37, 58, 58, 59, 59, 4, 41, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 102, 102, 98, 99, 100, 100, 100, 100, 103, 100, 104, 104, 42, 42, 42, 42, 105, 106, 107, 43, 43, 101, 101, 101, 101, 101, 101, 101, 45, 44, 44, 46, 46, 64, 64, 64, 64, 109, 109, 109, 109, 109, 60, 60, 60, 61, 61, 61, 61, 61, 61, 108, 108, 108, 108, 47, 47, 47, 47, 47, 47, 110, 111, 111, 49, 112, 112, 48, 48, 96, 97, 35, 63, 63, 63, 63, 50, 50, 51, 51, 52, 52, 52, 52, 52, 52, 52, 113, 53, 54, 54, 54, 54, 62, 78, 80 }; short yyr2[]={ 0, 0, 2, 2, 4, 2, 2, 1, 1, 2, 2, 2, 2, 0, 0, 3, 1, 2, 4, 5, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 0, 2, 3, 1, 3, 3, 1, 1, 0, 1, 2, 3, 1, 1, 2, 4, 2, 4, 2, 2, 1, 2, 3, 1, 3, 0, 4, 1, 3, 1, 4, 1, 1, 3, 1, 3, 1, 3, 3, 3, 3, 1, 2, 2, 2, 0, 1, 0, 4, 1, 3, 1, 3, 1, 1, 0, 1, 1, 3, 2, 0, 5, 1, 1, 2, 1, 2, 1, 2, 1, 4, 4, 1, 1, 1, 1, 1, 1, 1, 5, 5, 0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 0, 0, 6, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 1, 1, 1, 1, 2, 3, 4, 3, 1, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 1, 3, 1, 1, 2, 0, 3, 2, 1, 2, 3, 5, 2, 1, 1, 1, 1, 1, 0, 1, 0, 0, 3, 2, 4, 3, 0, 5, 1, 3, 8, 4, 4, 3, 4, 0, 1, 1, 5, 1, 2, 1, 2, 3, 3, 4, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1, 4, 3, 6, 5, 8, 7, 2, 2, 4, 2, 2, 4, 0, 1, 2, 0, 6, 1, 1, 1, 1, 1, 0, 1, 3, 1, 3, 2, 1, 2, 4, 3, 0, 4, 1, 4, 6, 3, 3, 0, 0 }; short yychk[]={ -1000, -1, -65, -2, -67, -69, -4, 256, -73, -17, 50, 52, 51, -71, 37, -41, 35, -18, -6, -29, -89, 33, 34, -56, -19, -55, 43, 45, -30, -57, 46, 47, 30, 31, 28, 32, 29, 27, 39, 40, 41, 42, 72, 74, 24, 44, 48, 49, -66, 2, -66, 2, -66, -66, -74, -6, -25, 6, -18, -26, -27, -9, 22, -77, -82, -33, -38, -39, 22, -78, -81, -16, -88, -33, 4, -72, 22, -95, -33, 19, -38, 71, -96, 6,-100, -42,-101, -35,-102, 84, 53, 22, 26, 63, 62,-105,-107,-108, 69,-109, 65, 64, -63, 70, 54, 58, 56,-110, 61, -47, -60, 80, 81, 78, 79, 60, 59, 68, 66, 67, -20, -21, 4, -20, -76, 4, 4, 4, 17, 73, -11, -31, 22, 24, 6, -5, -75, 23, -13, -12, -2, -26, -17, 8, -20, 8, 10, 21, 20, -34, 4, -79, -84, -85, -15, -28, -29, -89, 8, 8, 8, -16, 4, 10, -33, -38, -33, -4, -98, -95, -76, 9, -76, 9,-103, -76, -76, -76, -32, -33, 26, -58, -15, -36, -37, -34, 16, 19, 14, -35, 256, -59, 21, 75, 76, 82, 83, -64, -45, 22, 26, 62, 63, 4, 22, 4, 4, 4,-111, -4, 4, 26, -61, 56, 60, 59, 58, 61, 33, 4, -32, -90, -32, -23, -24, -32, 17, -92, -92, -76, -93, -68, -70, 38, 8, 10, 2, 7, -27, 10, -82, -83, 22, 24, 5, -32, -40, -80, 8, 4, -28, -21, -88, -33, -33, 5, 5, -7, -8, -9, -32, -97, -5, -76, 9, -76,-104, -32, -4, -4, -4, 16, 17, 18, 15, 12, 13, 11, 10, -34, -32, -33, -32, -59, 4, 4, -46, -32, 8, -32, -44, -64, -64, -45, -50, -32, -32, -48, -32, -49, -48, 8, 2, -32, -61, 26, 2, -76, 8, -22, -23, 5, 5, 9, -10, 25, -10, -31, -14, -2, -3, -2, -4, -69, 256, 23, 26, -12, -91, -32, -34, 5, 8, 5, 8, -84, -86, -87, 77, 5, 8, -99, -76, 9, 8, 2, -43, 2, -32, -32, -32, -32, -32, -32, -32, -32, 21, -32, -15, 43, -32, -15, 43, -32, 5, 8, -46, 8, 5, 5, -112, -4, 8, -76, 5, -76, -32, 5, 8, -24, -32, 5, 17, 2, -94, 2, 2, 2, 2, -32, -32, -32, 5, 8, 16, -8, 7, -76, -32, 55, 57, 5, 5, 5, 5, 5, 5, -64, -51, -52, -32, 9, -53, -47, 6, 5, 2, 8, 2, -76, 8, -23, -2, 7, -87, 77,-106, 4, 5, 8, 9, -54, -62, -78, 9, -53,-113, -76, -76, -32, 2, -76, -32, -52, -54, 4, 26, 77, -54, 9, -51, 5, 2, -76, -4, 5, -32, -80, -80, -54, 7, -76, 5, 8, -32, 5 }; short yydef[]={ -2, -2, 0, 0, 0, 0, 0, 7, 30, 85, 0, 282, 0, 16, 36, 188, 29, 71, 21, 75, 75, 23, 24, 97, 38, 99, 0, 0, 102, 103, 128, 129, 104, 105, 106, 107, 108, 0, 114, 115, 116, 117, 0, 119, 120, 0, 130, 131, 2, 8, 3, 13, 5, 6, 28, 22, 44, 0, 72, 86, 87, 75, 92, 46, 53, 0, 152, 153, 158, 0, 48, 49, 66, 0, 0, 17, 20, 174, 0, 0, -2, 0, 175, 190, 188, 183, 184, 185, 186, 187, 38, 158, 38, 0, 196, 38, 38, 38, 209, 211, 0, 0, 0, 189, 0, 206, 0, 175, 0, 242, 225, 260, 261, 262, 263, 0, 0, 230, 231, 232, 73, 76, 77, 74, 98, 0, 0, 111, 111, 118, 38, 122, 123, 124, 125, 14, 31, 33, 0, 39, 42, 43, 85, 0, 89, 0, 55, 0, 0, 154, 0, 283, 57, 59, 61, 93, 95, 0, 0, 0, 0, 0, 0, 0, 177, -2, 0, 258, 13, 182, 257, 38, 193, 38, 0, 175, 175, 175, 210, 132, 133, 134, 0, 136, 137, 138, 0, 0, 0, 150, 151, 170, 0, 0, 0, 172, 173, 212, 0, 221, 222, 0, 224, 0, 0, 265, 0, 255, 255, 0, 0, 226, 227, 233, 234, 235, 236, 237, 238, 249, 38, 0, 0, 0, 81, 83, 84, 112, 112, 0, 0, 4, 175, 37, 32, 0, 40, 45, 88, 90, 54, 0, 155, 157, 159, 0, 0, 47, 0, 0, 94, 96, 67, 70, 69, 68, 18, 0, 25, 27, 176, 180, -2, 192, 38, 195, 0, 198, 0, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 135, 142, 143, 147, 0, 0, 0, 214, 219, 0, 223, 0, 217, 213, 0, 0, 264, 0, 0, 256, 175, 0, 250, 38, 0, 228, 229, 38, 244, 0, 0, 79, 100, 101, 0, 0, 113, 0, 121, 126, 50, 15, 0, 0, 0, 0, 34, 35, 41, 0, 56, 156, 160, 0, 161, 0, 58, 0, 62, 64, 19, 0, 0, 194, 38, 0, 201, 202, 207, 139, 140, 141, -2, 145, 146, 149, 148, 171, 0, 0, 0, 0, 0, 0, 220, 216, 0, 215, 0, 204, 239, 240, 0, 252, 0, 241, 243, 38, 78, 0, 82, 83, 109, 110, 51, 0, 9, 10, 11, 12, 91, 162, 163, 60, 0, 0, 26, 181, 197, 199, 205, 0, 164, 165, 166, 167, 168, 169, 218, 0, 266, 268, 282, 271, 0, 275, 253, 38, 251, 38, 246, 0, 80, 52, 0, 63, 65, 38, 0, 259, 0, 282, 270, 277, 0, 282, 272, 0, 0, 245, 38, 127, 175, 0, 267, 269, 0, 283, 283, 274, 282, 0, 254, 38, 248, 200, 208, 0, 280, 281, 273, 276, 247, 278, 0, 0, 279 }; /* @(#)yaccpar 1.1 */ # # define YYFLAG -1000 # define YYERROR goto yyerrlab # define YYACCEPT return(0) # define YYABORT return(1) /* parser for yacc output */ int yydebug = 0; /* 1 for debugging */ YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ int yychar = -1; /* current input token number */ int yynerrs = 0; /* number of errors */ short yyerrflag = 0; /* error recovery flag */ yyparse() { short yys[YYMAXDEPTH]; short yyj, yym; register YYSTYPE *yypvt; register short yystate, *yyps, yyn; register YYSTYPE *yypv; register short *yyxi; yystate = 0; yychar = -1; yynerrs = 0; yyerrflag = 0; yyps= &yys[-1]; yypv= &yyv[-1]; yystack: /* put a state and value onto the stack */ if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); if( ++yyps >= &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); } *yyps = yystate; ++yypv; *yypv = yyval; yynewstate: yyn = yypact[yystate]; if( yyn<= YYFLAG ) goto yydefault; /* simple state */ if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ yychar = -1; yyval = yylval; yystate = yyn; if( yyerrflag > 0 ) --yyerrflag; goto yystack; } yydefault: /* default state action */ if( (yyn=yydef[yystate]) == -2 ) { if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; /* look through exception table */ for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ while( *(yyxi+=2) >= 0 ){ if( *yyxi == yychar ) break; } if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ } if( yyn == 0 ){ /* error */ /* error ... attempt to resume parsing */ switch( yyerrflag ){ case 0: /* brand new error */ yyerror( "syntax error" ); yyerrlab: ++yynerrs; case 1: case 2: /* incompletely recovered error ... try again */ yyerrflag = 3; /* find a state where "error" is a legal shift action */ while ( yyps >= yys ) { yyn = yypact[*yyps] + YYERRCODE; if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ yystate = yyact[yyn]; /* simulate a shift of "error" */ goto yystack; } yyn = yypact[*yyps]; /* the current yyps has no shift onn "error", pop stack */ if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); --yyps; --yypv; } /* there is no state on the stack with an error shift ... abort */ yyabort: return(1); case 3: /* no shift yet; clobber input char */ if( yydebug ) printf( "error recovery discards char %d\n", yychar ); if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ yychar = -1; goto yynewstate; /* try again in the same state */ } } /* reduction by production yyn */ if( yydebug ) printf("reduce %d\n",yyn); yyps -= yyr2[yyn]; yypvt = yypv; yypv -= yyr2[yyn]; yyval = yypv[1]; yym=yyn; /* consult goto table to find next state */ yyn = yyr1[yyn]; yyj = yypgo[yyn] + *yyps + 1; if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; switch(yym){ case 1: # line 139 "gram.in" { graal = PARSEOF; } break; case 2: # line 141 "gram.in" { graal = PARSOPT; } break; case 3: # line 143 "gram.in" { graal = PARSDCL; doinits(yypvt[-1].pval); frchain( & yypvt[-1].pval); } break; case 4: # line 145 "gram.in" { endproc(); graal = PARSPROC; } break; case 5: # line 147 "gram.in" { graal = PARSDEF; } break; case 6: # line 149 "gram.in" { graal = PARSERR; } break; case 7: # line 151 "gram.in" { graal = PARSERR; errmess("Syntax error", "", ""); } break; case 8: # line 156 "gram.in" { eofneed = 1; } break; case 9: # line 159 "gram.in" { if(!dclsect) warn("declaration amid executables"); yyval.pval = bgnexec(); TEST fprintf(diagfile,"stat: dcl\n"); doinits(yypvt[-1].pval); frchain( & yypvt[-1].pval); } break; case 10: # line 165 "gram.in" { if(dclsect && yypvt[-1].pval->tag!=TSTFUNCT) dclsect = 0; TEST fprintf(diagfile, "stat: exec\n"); } break; case 11: # line 169 "gram.in" { yyval.pval = bgnexec(); } break; case 12: # line 171 "gram.in" { yyerrok; errmess("Syntax error", "", ""); yyval.pval = bgnexec(); } break; case 13: # line 178 "gram.in" { yyval.pval = bgnexec(); } break; case 14: # line 179 "gram.in" { thisexec->copylab = 1; } break; case 15: # line 180 "gram.in" { yyval.pval = addexec(); thisexec->copylab = 0; } break; case 16: # line 184 "gram.in" { procname = 0; thisargs = 0; if(procclass == 0) procclass = PRMAIN; goto proctype; } break; case 17: # line 189 "gram.in" { thisargs = 0; goto proctype; } break; case 18: # line 191 "gram.in" { thisargs = 0; goto proctype; } break; case 19: # line 193 "gram.in" { thisargs = yypvt[-1].pval; proctype: if(procattrs) if(procname == 0) dclerr("attributes on unnamed procedure", ""); else { attvars(procattrs, mkchain(procname,CHNULL)); procclass = PRFUNCT; } fprintf(diagfile, "Procedure %s:\n", procnm() ); if(verbose) fprintf(diagfile, " Pass 1\n"); } break; case 20: # line 209 "gram.in" { procname = mkvar(yypvt[-0].pval); extname(procname); } break; case 21: # line 215 "gram.in" { procattrs = 0; } break; case 22: # line 217 "gram.in" { procattrs = yypvt[-1].pval; if(procclass == 0) procclass = PRFUNCT; } break; case 23: # line 223 "gram.in" { yyval.pval = bgnproc(); procclass = 0; } break; case 24: # line 225 "gram.in" { yyval.pval = bgnproc(); procclass = PRBLOCK; } break; case 25: # line 229 "gram.in" { yyval.pval = mkchain(yypvt[-0].pval,CHNULL); } break; case 26: # line 231 "gram.in" { hookup(yypvt[-2].pval, mkchain(yypvt[-0].pval,CHNULL) ); } break; case 27: # line 235 "gram.in" { if(yypvt[-0].pval->vclass == CLUNDEFINED) yypvt[-0].pval->vclass = CLARG; else dclerr("argument already used", yypvt[-0].pval->sthead->namep); } break; case 28: # line 241 "gram.in" { optneed = 0; } break; case 29: # line 245 "gram.in" { if(blklevel > 0) { execerr("Option statement inside procedure", ""); execerr("procedure %s terminated prematurely", procnm()); endproc(); } optneed = 1; } break; case 33: # line 261 "gram.in" { setopt(yypvt[-0].pval,CNULL); cfree(yypvt[-0].pval); } break; case 34: # line 263 "gram.in" { setopt(yypvt[-2].pval,yypvt[-0].pval); cfree(yypvt[-2].pval); cfree(yypvt[-0].pval); } break; case 35: # line 265 "gram.in" { setopt(yypvt[-2].pval,yypvt[-0].pval->leftp); cfree(yypvt[-2].pval); cfree(yypvt[-0].pval); } break; case 36: # line 269 "gram.in" { defneed = 1; } break; case 37: # line 273 "gram.in" { if(thisctl->subtype != STPROC) execerr("control stack not empty upon END", ""); exnull(); popctl(); } break; case 38: # line 281 "gram.in" { igeol=1; /* continue past newlines */ } break; case 41: # line 287 "gram.in" { yyval.pval = hookup(yypvt[-2].pval,yypvt[-0].pval); } break; case 44: # line 295 "gram.in" { attvars(yypvt[-1].pval,yypvt[-0].pval); yyval.pval = yypvt[-0].pval; } break; case 45: # line 297 "gram.in" { attvars(yypvt[-3].pval,yypvt[-1].pval); yyval.pval = yypvt[-1].pval; } break; case 46: # line 299 "gram.in" { yyval.pval = 0; } break; case 47: # line 301 "gram.in" { yyval.pval = 0; } break; case 48: # line 303 "gram.in" { yyval.pval = 0; } break; case 49: # line 305 "gram.in" { mkequiv(yypvt[-0].pval); yyval.pval = 0; } break; case 52: # line 311 "gram.in" { yyval.pval = hookup(yypvt[-2].pval,yypvt[-0].pval); } break; case 55: # line 318 "gram.in" {ininit = YES; } break; case 56: # line 319 "gram.in" { ininit = NO; mkinit(yypvt[-3].pval,yypvt[-0].pval); frexpr(yypvt[-3].pval); } break; case 59: # line 327 "gram.in" { setimpl(imptype, 'a', 'z'); } break; case 61: # line 332 "gram.in" { imptype = yypvt[-0].pval->attype; cfree(yypvt[-0].pval); } break; case 64: # line 340 "gram.in" { setimpl(imptype, yypvt[-0].ival, yypvt[-0].ival); } break; case 65: # line 342 "gram.in" { setimpl(imptype, yypvt[-2].ival, yypvt[-0].ival); } break; case 68: # line 350 "gram.in" { mkequiv(yypvt[-1].pval); } break; case 69: # line 354 "gram.in" { yyval.pval = mkchain(yypvt[-2].pval, mkchain(yypvt[-0].pval,CHNULL)); } break; case 70: # line 356 "gram.in" { yyval.pval = hookup(yypvt[-2].pval, mkchain(yypvt[-0].pval,CHNULL)); } break; case 72: # line 360 "gram.in" { attatt(yypvt[-1].pval,yypvt[-0].pval); } break; case 73: # line 363 "gram.in" { yypvt[-1].pval->atdim = yypvt[-0].pval; } break; case 74: # line 364 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->atdim = yypvt[-0].pval; } break; case 75: # line 367 "gram.in" { yyval.pval = 0; } break; case 77: # line 371 "gram.in" { inbound = 1; } break; case 78: # line 372 "gram.in" { inbound = 0; yyval.pval = arrays = mkchain(yypvt[-1].pval,arrays); } break; case 80: # line 376 "gram.in" { hookup(yypvt[-2].pval,yypvt[-0].pval); } break; case 81: # line 380 "gram.in" { yyval.pval = ALLOC(dimblock); yyval.pval->lowerb = 0; yyval.pval->upperb = yypvt[-0].pval; } break; case 82: # line 386 "gram.in" { yyval.pval = ALLOC(dimblock); yyval.pval->lowerb = yypvt[-2].pval; yyval.pval->upperb = yypvt[-0].pval; } break; case 84: # line 394 "gram.in" { yyval.pval = 0; } break; case 85: # line 397 "gram.in" { yyval.pval = 0; } break; case 88: # line 402 "gram.in" { hookup(yypvt[-2].pval,yypvt[-0].pval); } break; case 89: # line 406 "gram.in" { if(yypvt[-0].pval!=0) if(yypvt[-1].pval->vdim==0) yypvt[-1].pval->vdim = yypvt[-0].pval; else if(!eqdim(yypvt[-0].pval,yypvt[-1].pval->vdim)) dclerr("multiple dimension", yypvt[-1].pval->namep); yyval.pval = mkchain(yypvt[-1].pval,CHNULL); } break; case 90: # line 414 "gram.in" { ininit = YES; } break; case 91: # line 415 "gram.in" { ininit = NO; if(yypvt[-2].ival!=OPASGN) dclerr("illegal initialization operator", yypvt[-4].pval->sthead->namep); if(yypvt[-3].pval!=0) if(yypvt[-4].pval->vdim==0) yypvt[-4].pval->vdim = yypvt[-3].pval; else if(!eqdim(yypvt[-3].pval,yypvt[-4].pval->vdim)) dclerr("multiple dimension", yypvt[-4].pval->sthead->namep); if(yypvt[-0].pval!=0 && yypvt[-4].pval->vinit!=0) dclerr("multiple initialization", yypvt[-4].pval->sthead->namep); yypvt[-4].pval->vinit = yypvt[-0].pval; yyval.pval = mkchain(yypvt[-4].pval,CHNULL); } break; case 92: # line 432 "gram.in" { yyval.pval = mkvar(yypvt[-0].pval); } break; case 94: # line 437 "gram.in" { attatt(yypvt[-1].pval,yypvt[-0].pval); } break; case 96: # line 442 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->atdim = yypvt[-0].pval; } break; case 97: # line 446 "gram.in" { yyval.pval = ALLOC(atblock); if(yypvt[-0].ival == CLEXT) yyval.pval->atext = 1; yyval.pval->atclass = yypvt[-0].ival; } break; case 98: # line 453 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->atclass = CLCOMMON; yyval.pval->atcommon = yypvt[-1].pval; } break; case 99: # line 459 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->attype = yypvt[-0].ival; } break; case 100: # line 461 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->attype = TYCHAR; yyval.pval->attypep = yypvt[-1].pval; } break; case 101: # line 463 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->attype = TYFIELD; yyval.pval->attypep = mkfield(yypvt[-1].pval); } break; case 102: # line 466 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->attype = TYSTRUCT; yyval.pval->attypep = yypvt[-0].pval; } break; case 103: # line 469 "gram.in" { yyval.pval = ALLOC(atblock); yyval.pval->atprec = yypvt[-0].ival; } break; case 104: # line 472 "gram.in" { yyval.ival = CLAUTO; fprintf(diagfile,"AUTOMATIC not yet implemented\n"); } break; case 105: # line 474 "gram.in" { yyval.ival = CLSTAT; } break; case 106: # line 475 "gram.in" { yyval.ival = CLSTAT; } break; case 107: # line 476 "gram.in" { yyval.ival = CLVALUE; fprintf(diagfile, "VALUE not yet implemented\n"); } break; case 108: # line 478 "gram.in" { yyval.ival = CLEXT; } break; case 109: # line 482 "gram.in" { yyval.pval = yypvt[-1].pval; } break; case 110: # line 484 "gram.in" { yyval.pval = yypvt[-1].pval; } break; case 111: # line 487 "gram.in" { comneed = 1; } break; case 112: # line 490 "gram.in" { yyval.pval = mkcomm(""); } break; case 114: # line 494 "gram.in" { yyval.ival = TYINT; } break; case 115: # line 495 "gram.in" { yyval.ival = TYREAL; } break; case 116: # line 496 "gram.in" { yyval.ival = TYCOMPLEX; } break; case 117: # line 497 "gram.in" { yyval.ival = TYLOG; } break; case 118: # line 499 "gram.in" { yyval.ival = TYLREAL; /* holdover from Fortran */ } break; case 119: # line 501 "gram.in" { yyval.ival = TYLREAL; /* holdover from Fortran */ } break; case 120: # line 505 "gram.in" { yyval.pval = yypvt[-0].pval->varp; } break; case 121: # line 507 "gram.in" { yyval.pval = mkstruct(yypvt[-2].pval,yypvt[-0].pval); } break; case 122: # line 509 "gram.in" { yyval.pval = mkstruct(PNULL,yypvt[-0].pval); } break; case 123: # line 513 "gram.in" { if(yypvt[-0].pval->varp && yypvt[-0].pval->varp->blklevel<blklevel) hide(yypvt[-0].pval); yypvt[-0].pval->tag = TSTRUCT; } break; case 124: # line 518 "gram.in" { if(yypvt[-0].pval->varp) if(yypvt[-0].pval->varp->blklevel<blklevel) hide(yypvt[-0].pval); else dclerr("multiple declaration for type %s", yypvt[-0].pval->namep); } break; case 125: # line 525 "gram.in" { ++instruct; } break; case 126: # line 525 "gram.in" { --instruct; } break; case 127: # line 526 "gram.in" { yyval.pval = yypvt[-3].pval; prevv = -1; } break; case 130: # line 533 "gram.in" { yyval.ival = 1; } break; case 131: # line 534 "gram.in" { yyval.ival = 0; } break; case 132: # line 538 "gram.in" { if(yypvt[-0].pval->tag == TCALL) yypvt[-0].pval = funcinv(yypvt[-0].pval); if(yypvt[-0].pval->vtype==TYUNDEFINED && yypvt[-0].pval->vext==0) impldecl(yypvt[-0].pval); else if(yypvt[-0].pval->tag==TNAME && yypvt[-0].pval->vdcldone==0 && yypvt[-0].pval->vext==0 && !inbound) dclit(yypvt[-0].pval); if(yypvt[-0].pval->vtype==TYFIELD) yyval.pval = extrfield(yypvt[-0].pval); } break; case 134: # line 550 "gram.in" { yyval.pval = mkconst(TYLOG, (yypvt[-0].ival == TRUE ? ".true." : ".false.") ); } break; case 135: # line 552 "gram.in" { yyval.pval = typexpr(yypvt[-1].pval,yypvt[-0].pval); } break; case 138: # line 556 "gram.in" { if( !ininit && yypvt[-0].pval->tag== TLIST) yyval.pval = compconst(yypvt[-0].pval); else yypvt[-0].pval->needpar = 1; } break; case 139: # line 560 "gram.in" { yyval.pval = mknode(TAROP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 140: # line 562 "gram.in" { yyval.pval = mknode(TAROP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 141: # line 564 "gram.in" { yyval.pval = mknode(TAROP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 142: # line 566 "gram.in" { if(yypvt[-1].ival==OPMINUS) yyval.pval = mknode(TNEGOP,OPMINUS, yypvt[-0].pval, PNULL); else yyval.pval = yypvt[-0].pval; } break; case 143: # line 570 "gram.in" { yyval.pval = mknode(TASGNOP,yypvt[-1].ival,yypvt[-0].pval,mkint(1)); } break; case 144: # line 572 "gram.in" { yyval.pval = mknode(TRELOP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 145: # line 574 "gram.in" { yyval.pval = mknode(TLOGOP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 146: # line 576 "gram.in" { yyval.pval = mknode(TLOGOP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 147: # line 578 "gram.in" { yyval.pval = mknode(TNOTOP,yypvt[-1].ival,yypvt[-0].pval,PNULL); } break; case 148: # line 580 "gram.in" { if(yypvt[-2].pval->tag == TCALL) { exprerr("may not assign to a function", CNULL); yyval.pval = errnode(); } else yyval.pval = mknode(TASGNOP,yypvt[-1].ival,yypvt[-2].pval,yypvt[-0].pval); } break; case 149: # line 589 "gram.in" { yyval.pval = mknode(TREPOP,0,yypvt[-2].pval,yypvt[-0].pval); } break; case 151: # line 592 "gram.in" { yyval.pval = errnode(); } break; case 152: # line 596 "gram.in" { if(yypvt[-0].pval->tag==TNAME && yypvt[-0].pval->vdcldone==0 && yypvt[-0].pval->vsubs==0 && yypvt[-0].pval->vext==0 && !inbound) dclit(yypvt[-0].pval); } break; case 154: # line 604 "gram.in" { if(yypvt[-0].pval->tag!=TLIST) yypvt[-0].pval = mknode(TLIST,0, mkchain(yypvt[-0].pval,CHNULL), PNULL); if(yypvt[-1].pval->vdim) { if(yypvt[-1].pval->vdcldone==0 && yypvt[-1].pval->vext==0) dclit(yypvt[-1].pval); yyval.pval = subscript(yypvt[-1].pval,yypvt[-0].pval); } else yyval.pval = mkcall(yypvt[-1].pval,yypvt[-0].pval); } break; case 155: # line 616 "gram.in" { yyval.pval = strucelt(yypvt[-2].pval,yypvt[-0].pval); } break; case 156: # line 618 "gram.in" { if(yypvt[-0].pval->tag != TLIST) yypvt[-0].pval = mknode(TLIST,0, mkchain(yypvt[-0].pval,CHNULL), PNULL); yyval.pval = subscript(strucelt(yypvt[-3].pval,yypvt[-1].pval), yypvt[-0].pval); } break; case 157: # line 623 "gram.in" { yyval.pval = mkarrow(yypvt[-2].pval,yypvt[-0].pval); } break; case 158: # line 627 "gram.in" { if(yypvt[-0].pval->varp == 0) mkvar(yypvt[-0].pval); if(inbound) yypvt[-0].pval->varp->vadjdim = 1; yyval.pval = cpexpr(yypvt[-0].pval->varp); } break; case 159: # line 634 "gram.in" { yyval.pval = mknode(TLIST, 0, PNULL, PNULL); } break; case 160: # line 636 "gram.in" { yyval.pval = yypvt[-1].pval; } break; case 161: # line 638 "gram.in" { yyval.pval = mknode(TLIST,0,yypvt[-1].pval,PNULL); } break; case 162: # line 642 "gram.in" { yyval.pval = mkchain(yypvt[-2].pval, mkchain(yypvt[-0].pval, CHNULL) ); } break; case 163: # line 644 "gram.in" { hookup(yypvt[-2].pval, mkchain(yypvt[-0].pval,CHNULL) ); } break; case 164: # line 648 "gram.in" { yyval.pval = esizeof(yypvt[-1].pval->vtype, yypvt[-1].pval->vtypep, yypvt[-1].pval->vdim); frexpr(yypvt[-1].pval); } break; case 165: # line 651 "gram.in" { if(yypvt[-1].pval->attype==TYREAL && yypvt[-1].pval->atprec) yypvt[-1].pval->attype = TYLREAL; yyval.pval = esizeof(yypvt[-1].pval->attype, yypvt[-1].pval->attypep, yypvt[-1].pval->atdim); cfree(yypvt[-1].pval); } break; case 166: # line 657 "gram.in" { yyval.pval = mkint(tailor.ftnsize[FTNINT]/tailor.ftnchwd); } break; case 167: # line 661 "gram.in" { yyval.pval = elenof(yypvt[-1].pval->vtype, yypvt[-1].pval->vtypep, yypvt[-1].pval->vdim); frexpr(yypvt[-1].pval); } break; case 168: # line 664 "gram.in" { yyval.pval = elenof(yypvt[-1].pval->attype, yypvt[-1].pval->attypep, yypvt[-1].pval->atdim); cfree(yypvt[-1].pval); } break; case 169: # line 668 "gram.in" { yyval.pval = mkint(1); } break; case 171: # line 673 "gram.in" { yyval.ival = yypvt[-1].ival; } break; case 174: # line 681 "gram.in" { TEST fprintf(diagfile, "exec done\n"); } break; case 175: # line 685 "gram.in" { yyval.pval = bgnexec(); if(ncases > 0) ncases = 0; } break; case 176: # line 689 "gram.in" { if(yypvt[-2].pval->tag==TCALL) { dclerr("no statement functions in EFL", yypvt[-2].pval->sthead->namep); frexpr(yypvt[-2].pval); frexpr(yypvt[-0].pval); } else exasgn(yypvt[-2].pval,yypvt[-1].ival,yypvt[-0].pval); } break; case 177: # line 700 "gram.in" { exasgn(yypvt[-0].pval, yypvt[-1].ival, mkint(1) ); } break; case 178: # line 702 "gram.in" { excall(yypvt[-0].pval); } break; case 179: # line 704 "gram.in" { excall(yypvt[-0].pval); } break; case 181: # line 707 "gram.in" { TEST fprintf(diagfile, "exec: { stats }\n"); addexec(); } break; case 182: # line 710 "gram.in" { thisexec->labeled = 1; } break; case 183: # line 712 "gram.in" { thisexec->uniffable = 1; popctl(); } break; case 184: # line 714 "gram.in" { thisexec->brnchend = 1; } break; case 185: # line 716 "gram.in" { exio(yypvt[-0].pval, 0); } break; case 186: # line 718 "gram.in" { exnull(); } break; case 187: # line 720 "gram.in" { exnull(); putsii(ICCOMMENT, yypvt[-0].pval); cfree(yypvt[-0].pval); exnull(); } break; case 188: # line 729 "gram.in" { TEST fprintf(diagfile, "exec:empty\n"); } break; case 189: # line 731 "gram.in" { TEST fprintf(diagfile, "exec: continue\n"); } break; case 190: # line 735 "gram.in" { thisexec->copylab = 1; ++blklevel; dclsect = 1; ndecl[blklevel] = 0; nhid [blklevel] = 0; } break; case 191: # line 745 "gram.in" { if(ndecl[blklevel]) unhide(); --blklevel; dclsect = 0; } break; case 192: # line 753 "gram.in" { mklabel(yypvt[-2].pval,YES); } break; case 193: # line 755 "gram.in" { mklabel(mkilab(yypvt[-1].pval),YES); } break; case 194: # line 757 "gram.in" { mklabel(mkilab(yypvt[-3].pval),YES); } break; case 195: # line 759 "gram.in" { brkcase(); mkcase(PNULL,1); } break; case 196: # line 760 "gram.in" { brkcase(); } break; case 198: # line 764 "gram.in" { mkcase(yypvt[-0].pval,1); } break; case 199: # line 766 "gram.in" { mkcase(yypvt[-0].pval,1); } break; case 200: # line 770 "gram.in" { TEST fprintf(diagfile, "if-then-else\n"); i = yypvt[-5].pval->brnchend & yypvt[-0].pval->brnchend; addexec(); yyval.pval = addexec(); thisexec->brnchend = i; TEST fprintf(diagfile, "exec: if(expr) exec else exec\n"); } break; case 201: # line 777 "gram.in" { TEST fprintf(diagfile, "if-then\n"); pushlex = 1; yyclearin; yyval.pval = ifthen(); TEST fprintf(diagfile, "exec: if(expr) exec\n"); } break; case 202: # line 783 "gram.in" { TEST fprintf(diagfile, "repeat done\n"); } break; case 203: # line 785 "gram.in" { TEST fprintf(diagfile, "exec: control exec\n"); yyval.pval = addexec(); } break; case 204: # line 789 "gram.in" { pushctl(STIF,yypvt[-1].pval); } break; case 205: # line 793 "gram.in" { if(thisctl->breaklab == 0) thisctl->breaklab = nextlab(); /* if(thisexec->prevexec->brnchend == 0) */ exgoto(thisctl->breaklab); exlab( indifs[thisctl->indifn] = nextlab() ); } break; case 206: # line 803 "gram.in" { pushctl(STREPEAT, PNULL); } break; case 207: # line 807 "gram.in" { pushlex = 1; yyclearin; yyval.pval = addexec(); exgoto(thisctl->xlab); TEST fprintf(diagfile, " no until\n"); } break; case 208: # line 813 "gram.in" { yyval.pval = addexec(); exnull(); exlab( indifs[thisctl->indifn] = nextlab() ); exifgo(mknode(TNOTOP,OPNOT,yypvt[-1].pval,PNULL), thisctl->xlab); TEST fprintf(diagfile, "until\n"); } break; case 209: # line 822 "gram.in" { exretn(PNULL); } break; case 210: # line 824 "gram.in" { exretn(yypvt[-0].pval); } break; case 212: # line 827 "gram.in" { exgoto(yypvt[-0].ival); } break; case 213: # line 829 "gram.in" { if( !equals(yypvt[-1].pval->namep, "to") ) execerr("go %s ??\n", yypvt[-1].pval->namep); else exgoto(yypvt[-0].ival); } break; case 214: # line 834 "gram.in" { excompgoto(yypvt[-1].pval, yypvt[-0].pval); } break; case 215: # line 836 "gram.in" { if(!equals(yypvt[-2].pval->namep, "to") ) execerr("go %s ??\n", yypvt[-2].pval->namep); else excompgoto(yypvt[-1].pval, yypvt[-0].pval); } break; case 216: # line 843 "gram.in" { yyval.pval = yypvt[-1].pval; } break; case 217: # line 848 "gram.in" { yyval.pval = mkchain(yypvt[-0].ival,CHNULL); } break; case 218: # line 850 "gram.in" { yyval.pval = hookup(yypvt[-2].pval, mkchain(yypvt[-0].ival,CHNULL) ); } break; case 220: # line 855 "gram.in" { yyval.pval = yypvt[-0].pval; } break; case 221: # line 860 "gram.in" { yyval.ival = mklabel(yypvt[-0].pval,NO); } break; case 222: # line 862 "gram.in" { yyval.ival = mklabel(mkilab(yypvt[-0].pval),NO); } break; case 223: # line 864 "gram.in" { yyval.ival = mkcase(yypvt[-0].pval,0); } break; case 224: # line 866 "gram.in" { yyval.ival = mkcase(PNULL,0); } break; case 225: # line 870 "gram.in" { exbrk(yypvt[-0].ival, PNULL, 0); } break; case 226: # line 872 "gram.in" { exbrk(yypvt[-1].ival, yypvt[-0].pval, 0); } break; case 227: # line 874 "gram.in" { exbrk(yypvt[-1].ival, PNULL, yypvt[-0].ival); } break; case 228: # line 876 "gram.in" { exbrk(yypvt[-2].ival,yypvt[-1].pval,yypvt[-0].ival); } break; case 229: # line 878 "gram.in" { exbrk(yypvt[-2].ival,yypvt[-0].pval,yypvt[-1].ival); } break; case 230: # line 881 "gram.in" { yyval.ival = 1; } break; case 231: # line 882 "gram.in" { yyval.ival = 0; } break; case 232: # line 883 "gram.in" { yyval.ival = 0; } break; case 233: # line 886 "gram.in" { yyval.ival = STWHILE; } break; case 234: # line 887 "gram.in" { yyval.ival = STFOR; } break; case 235: # line 888 "gram.in" { yyval.ival = STDO; } break; case 236: # line 889 "gram.in" { yyval.ival = STREPEAT; } break; case 237: # line 890 "gram.in" { yyval.ival = STSWITCH; } break; case 238: # line 891 "gram.in" { yyval.ival = STPROC; } break; case 239: # line 895 "gram.in" { pushctl(STWHILE, yypvt[-1].pval); TEST fprintf(diagfile, "while(expr)\n"); } break; case 240: # line 898 "gram.in" { exlab(thisctl->xlab); if(yypvt[-1].pval) exifgo(mknode(TNOTOP,OPNOT,yypvt[-1].pval,PNULL), thisctl->breaklab = nextlab() ); else exnull(); TEST fprintf(diagfile, "for (forlist)\n"); } break; case 241: # line 905 "gram.in" { pushctl(STSWITCH, simple(LVAL,yypvt[-1].pval)); TEST fprintf(diagfile, "switch (expr)\n"); } break; case 242: # line 908 "gram.in" { pushctl(STDO, yypvt[-0].pval); TEST fprintf(diagfile, "do loop\n"); } break; case 243: # line 913 "gram.in" { yyval.pval = doloop(yypvt[-2].pval, PNULL, PNULL); } break; case 244: # line 915 "gram.in" { yyval.pval = doloop(yypvt[-1].pval, PNULL, PNULL); } break; case 245: # line 917 "gram.in" { yyval.pval = doloop(yypvt[-4].pval, yypvt[-2].pval, PNULL); } break; case 246: # line 919 "gram.in" { yyval.pval = doloop(yypvt[-3].pval, yypvt[-1].pval, PNULL); } break; case 247: # line 921 "gram.in" { yyval.pval = doloop(yypvt[-6].pval,yypvt[-4].pval,yypvt[-2].pval); } break; case 248: # line 923 "gram.in" { yyval.pval = doloop(yypvt[-5].pval,yypvt[-3].pval,yypvt[-1].pval); } break; case 249: # line 927 "gram.in" { pushctl(STFOR, PNULL); } break; case 250: # line 931 "gram.in" { exgoto(thisctl->xlab); exlab(thisctl->nextlab); addexec(); } break; case 251: # line 936 "gram.in" { exgoto(thisctl->xlab); exlab(thisctl->nextlab); addexec(); } break; case 253: # line 946 "gram.in" { addexec(); } break; case 254: # line 948 "gram.in" { addexec(); } break; case 255: # line 951 "gram.in" { yyval.pval = 0; } break; case 257: # line 956 "gram.in" { if(dbgopt) ++dbglevel; } break; case 258: # line 960 "gram.in" { if(dbgopt) --dbglevel; } break; case 259: # line 964 "gram.in" { yyval.pval = mkiost(yypvt[-5].ival, yypvt[-3].pval, yypvt[-1].pval); } break; case 260: # line 967 "gram.in" { yyval.ival = 0; } break; case 261: # line 968 "gram.in" { yyval.ival = 1; } break; case 262: # line 969 "gram.in" { yyval.ival = 2; } break; case 263: # line 970 "gram.in" { yyval.ival = 3; } break; case 265: # line 974 "gram.in" { yyval.pval = NULL; } break; case 266: # line 977 "gram.in" { yyval.pval = mkchain(yypvt[-0].pval,CHNULL); } break; case 267: # line 978 "gram.in" { hookup(yypvt[-2].pval, mkchain(yypvt[-0].pval,CHNULL)); } break; case 268: # line 981 "gram.in" { yyval.pval = mkioitem(yypvt[-0].pval,CNULL); } break; case 269: # line 982 "gram.in" { yyval.pval = mkioitem(yypvt[-2].pval,yypvt[-0].pval); } break; case 270: # line 983 "gram.in" { yyval.pval = mkioitem(PNULL,yypvt[-0].pval); } break; case 271: # line 984 "gram.in" { yyval.pval = mkiogroup(yypvt[-0].pval, CNULL, PNULL); } break; case 272: # line 985 "gram.in" { yyval.pval = mkiogroup(yypvt[-0].pval, CNULL, yypvt[-1].pval); } break; case 273: # line 986 "gram.in" { yyval.pval = mkiogroup(yypvt[-2].pval,yypvt[-0].pval,yypvt[-3].pval); } break; case 274: # line 987 "gram.in" { yyval.pval = mkiogroup(yypvt[-2].pval,yypvt[-0].pval,PNULL); } break; case 275: # line 990 "gram.in" { ++iobrlevel; } break; case 276: # line 991 "gram.in" { --iobrlevel; yyval.pval = yypvt[-1].pval; } break; case 277: # line 995 "gram.in" { yyval.pval = mkformat(yypvt[-0].ival, PNULL, PNULL); } break; case 278: # line 997 "gram.in" { yyval.pval = mkformat(yypvt[-3].ival, yypvt[-1].pval, PNULL); } break; case 279: # line 999 "gram.in" { yyval.pval = mkformat(yypvt[-5].ival,yypvt[-3].pval,yypvt[-1].pval); } break; case 280: # line 1001 "gram.in" { yyval.pval = yypvt[-1].pval->leftp; frexpblock(yypvt[-1].pval); } break; case 281: # line 1004 "gram.in" { yyval.ival = yypvt[-1].ival; } break; case 282: # line 1007 "gram.in" { lettneed = YES;} break; case 283: # line 1010 "gram.in" { lettneed = NO; } break; } goto yystack; /* stack new state and value */ }