Annotation of researchv10no/cmd/pcc1/pcc/cgram.c, revision 1.1.1.1

1.1       root        1: # define NAME 2
                      2: # define STRING 3
                      3: # define ICON 4
                      4: # define FCON 5
                      5: # define PLUS 6
                      6: # define MINUS 8
                      7: # define MUL 11
                      8: # define AND 14
                      9: # define OR 17
                     10: # define ER 19
                     11: # define QUEST 21
                     12: # define COLON 22
                     13: # define ANDAND 23
                     14: # define OROR 24
                     15: # define ASOP 25
                     16: # define RELOP 26
                     17: # define EQUOP 27
                     18: # define DIVOP 28
                     19: # define SHIFTOP 29
                     20: # define INCOP 30
                     21: # define UNOP 31
                     22: # define STROP 32
                     23: # define TYPE 33
                     24: # define CLASS 34
                     25: # define STRUCT 35
                     26: # define RETURN 36
                     27: # define GOTO 37
                     28: # define IF 38
                     29: # define ELSE 39
                     30: # define SWITCH 40
                     31: # define BREAK 41
                     32: # define CONTINUE 42
                     33: # define WHILE 43
                     34: # define DO 44
                     35: # define FOR 45
                     36: # define DEFAULT 46
                     37: # define CASE 47
                     38: # define SIZEOF 48
                     39: # define ENUM 49
                     40: # define LP 50
                     41: # define RP 51
                     42: # define LC 52
                     43: # define RC 53
                     44: # define LB 54
                     45: # define RB 55
                     46: # define CM 56
                     47: # define SM 57
                     48: # define ASSIGN 58
                     49: 
                     50: # line 108 "../mip/cgram.y"
                     51: # include "mfile1"
                     52: #define yyclearin yychar = -1
                     53: #define yyerrok yyerrflag = 0
                     54: extern int yychar;
                     55: extern short yyerrflag;
                     56: #ifndef YYMAXDEPTH
                     57: #define YYMAXDEPTH 150
                     58: #endif
                     59: YYSTYPE yylval; YYSTYPE yyval;
                     60: 
                     61: # line 127 "../mip/cgram.y"
                     62:        static int fake = 0;
                     63: #ifndef FLEXNAMES
                     64:        static char fakename[NCHNAM+1];
                     65: #else
                     66:        static char fakename[24];
                     67: #endif
                     68: # define YYERRCODE 256
                     69: 
                     70: # line 840 "../mip/cgram.y"
                     71: 
                     72: 
                     73: NODE *
                     74: mkty( t, d, s ) unsigned t; {
                     75:        return( block( TYPE, NIL, NIL, t, d, s ) );
                     76:        }
                     77: 
                     78: NODE *
                     79: bdty( op, p, v ) NODE *p; {
                     80:        register NODE *q;
                     81: 
                     82:        q = block( op, p, NIL, INT, 0, INT );
                     83: 
                     84:        switch( op ){
                     85: 
                     86:        case UNARY MUL:
                     87:        case UNARY CALL:
                     88:                break;
                     89: 
                     90:        case LB:
                     91:                q->in.right = bcon(v);
                     92:                break;
                     93: 
                     94:        case NAME:
                     95:                q->tn.rval = v;
                     96:                break;
                     97: 
                     98:        default:
                     99:                cerror( "bad bdty" );
                    100:                }
                    101: 
                    102:        return( q );
                    103:        }
                    104: 
                    105: dstash( n ){ /* put n into the dimension table */
                    106:        if( curdim >= DIMTABSZ-1 ){
                    107:                cerror( "dimension table overflow");
                    108:                }
                    109:        dimtab[ curdim++ ] = n;
                    110:        }
                    111: 
                    112: savebc() {
                    113:        if( psavbc > & asavbc[BCSZ-4 ] ){
                    114:                cerror( "whiles, fors, etc. too deeply nested");
                    115:                }
                    116:        *psavbc++ = brklab;
                    117:        *psavbc++ = contlab;
                    118:        *psavbc++ = flostat;
                    119:        *psavbc++ = swx;
                    120:        flostat = 0;
                    121:        }
                    122: 
                    123: resetbc(mask){
                    124: 
                    125:        swx = *--psavbc;
                    126:        flostat = *--psavbc | (flostat&mask);
                    127:        contlab = *--psavbc;
                    128:        brklab = *--psavbc;
                    129: 
                    130:        }
                    131: 
                    132: addcase(p) NODE *p; { /* add case to switch */
                    133: 
                    134:        p = optim( p );  /* change enum to ints */
                    135:        if( p->in.op != ICON ){
                    136:                uerror( "non-constant case expression");
                    137:                return;
                    138:                }
                    139:        if( swp == swtab ){
                    140:                uerror( "case not in switch");
                    141:                return;
                    142:                }
                    143:        if( swp >= &swtab[SWITSZ] ){
                    144:                cerror( "switch table overflow");
                    145:                }
                    146:        swp->sval = p->tn.lval;
                    147:        deflab( swp->slab = getlab() );
                    148:        ++swp;
                    149:        tfree(p);
                    150:        }
                    151: 
                    152: adddef(){ /* add default case to switch */
                    153:        if( swtab[swx].slab >= 0 ){
                    154:                uerror( "duplicate default in switch");
                    155:                return;
                    156:                }
                    157:        if( swp == swtab ){
                    158:                uerror( "default not inside switch");
                    159:                return;
                    160:                }
                    161:        deflab( swtab[swx].slab = getlab() );
                    162:        }
                    163: 
                    164: swstart(){
                    165:        /* begin a switch block */
                    166:        if( swp >= &swtab[SWITSZ] ){
                    167:                cerror( "switch table overflow");
                    168:                }
                    169:        swx = swp - swtab;
                    170:        swp->slab = -1;
                    171:        ++swp;
                    172:        }
                    173: 
                    174: swend(){ /* end a switch block */
                    175: 
                    176:        register struct sw *swbeg, *p, *q, *r, *r1;
                    177:        CONSZ temp;
                    178:        int tempi;
                    179: 
                    180:        swbeg = &swtab[swx+1];
                    181: 
                    182:        /* sort */
                    183: 
                    184:        r1 = swbeg;
                    185:        r = swp-1;
                    186: 
                    187:        while( swbeg < r ){
                    188:                /* bubble largest to end */
                    189:                for( q=swbeg; q<r; ++q ){
                    190:                        if( q->sval > (q+1)->sval ){
                    191:                                /* swap */
                    192:                                r1 = q+1;
                    193:                                temp = q->sval;
                    194:                                q->sval = r1->sval;
                    195:                                r1->sval = temp;
                    196:                                tempi = q->slab;
                    197:                                q->slab = r1->slab;
                    198:                                r1->slab = tempi;
                    199:                                }
                    200:                        }
                    201:                r = r1;
                    202:                r1 = swbeg;
                    203:                }
                    204: 
                    205:        /* it is now sorted */
                    206: 
                    207:        for( p = swbeg+1; p<swp; ++p ){
                    208:                if( p->sval == (p-1)->sval ){
                    209:                        uerror( "duplicate case in switch, %d", tempi=p->sval );
                    210:                        return;
                    211:                        }
                    212:                }
                    213: 
                    214:        genswitch( swbeg-1, swp-swbeg );
                    215:        swp = swbeg-1;
                    216:        }
                    217: extern short  yyexca[];
                    218: # define YYNPROD 187
                    219: # define YYLAST 1228
                    220: extern short  yyact[];
                    221: short  yyexca [] ={
                    222: -1, 1,
                    223:        0, -1,
                    224:        2, 23,
                    225:        11, 23,
                    226:        50, 23,
                    227:        57, 23,
                    228:        -2, 0,
                    229: -1, 19,
                    230:        56, 82,
                    231:        57, 82,
                    232:        -2, 7,
                    233: -1, 24,
                    234:        56, 81,
                    235:        57, 81,
                    236:        -2, 79,
                    237: -1, 26,
                    238:        56, 85,
                    239:        57, 85,
                    240:        -2, 80,
                    241: -1, 32,
                    242:        52, 46,
                    243:        -2, 44,
                    244: -1, 34,
                    245:        52, 38,
                    246:        -2, 36,
                    247: -1, 57,
                    248:        53, 50,
                    249:        57, 50,
                    250:        -2, 0,
                    251: -1, 109,
                    252:        33, 18,
                    253:        34, 18,
                    254:        35, 18,
                    255:        49, 18,
                    256:        -2, 13,
                    257: -1, 280,
                    258:        33, 16,
                    259:        34, 16,
                    260:        35, 16,
                    261:        49, 16,
                    262:        -2, 14,
                    263: -1, 297,
                    264:        33, 17,
                    265:        34, 17,
                    266:        35, 17,
                    267:        49, 17,
                    268:        -2, 15,
                    269:        };
                    270: extern short  yypact[];
                    271: short  yyact []={
                    272: 
                    273:  211,  18, 262,  93, 231,  89,  87,  88,  27, 209,
                    274:   80, 200, 132,  78,   6, 147,  79,  21,  10,   9,
                    275:   14,  20, 100, 166,  51, 131,  27, 311,  96,  92,
                    276:  310,  46,  82,  81,  16,  21,  98, 110, 221, 222,
                    277:  226,  59, 230, 219, 220, 227, 228, 229, 233, 232,
                    278:   83,  75,  84, 304, 110, 256,  22,  66,  56, 223,
                    279:  231,  89,  87,  88,  27, 291,  80, 266, 112,  78,
                    280:   36, 297,  79,  21,  22, 271, 265, 133, 107, 270,
                    281:   45, 280, 212, 101,  27, 148, 152, 204,  82,  81,
                    282:  164,  24, 203,  21, 221, 222, 226,  91, 230, 219,
                    283:  220, 227, 228, 229, 233, 232,  83,  74,  84, 193,
                    284:  110, 210,  22,  40,  42, 223, 168, 169, 170, 172,
                    285:  174, 176, 178, 180, 181, 183, 185, 187, 188, 189,
                    286:  190, 191,  22,  27,  94, 133, 156, 162, 195,  17,
                    287:   19, 160,  21,  10,   9,  14, 103, 148,  99,  95,
                    288:  155, 156, 207,  96, 158, 298,  41,  43, 161,  16,
                    289:  194, 284, 197,  36,  35,  70,  77, 114, 192, 157,
                    290:   71, 136, 235, 138, 236,  38, 237, 111, 238,  39,
                    291:  239,  22, 234, 240,  73, 241, 250, 242, 163, 208,
                    292:  286, 139,  65, 250, 133, 137, 102,  48,  48,  95,
                    293:  202,  49,  49, 283, 254, 244, 245,  38,  69, 255,
                    294:   33,  39, 159, 252, 253, 206,  48,  68, 263,  31,
                    295:   49,   8, 268, 258, 259, 260, 261, 154, 264,  28,
                    296:  306, 246, 289, 278, 202, 272, 281, 277, 248, 201,
                    297:  251, 108, 198,  27, 282, 140, 141, 142, 143, 144,
                    298:  145,  53,  21,  57,  10,   9,  14,  72, 224,  64,
                    299:  300, 299,  97, 276, 275, 153, 274, 273, 153,  52,
                    300:   16, 288, 287, 201, 292, 293, 263, 295, 294,   9,
                    301:   26, 231,  89,  87,  88,  47,  10,  80,  14,  54,
                    302:   78,  22,  30,  79, 121, 279, 269,  95, 196, 301,
                    303:   60, 307,  16,   7, 113, 263, 149, 308, 285,  82,
                    304:   81, 117,  29,  57, 224, 221, 222, 226,  26, 230,
                    305:  219, 220, 227, 228, 229, 233, 232,  83,  67,  84,
                    306:   34, 110, 118,  32, 119, 225, 223, 121,  26, 118,
                    307:  123, 119, 109, 124, 121, 125, 106, 128, 105, 126,
                    308:  127, 129, 115, 122, 117, 120, 134,  50,  25, 115,
                    309:  122, 117, 120,  61,  44, 249,   4, 205, 149, 102,
                    310:  118,  90, 119,  55,  58, 121, 167, 309, 118, 165,
                    311:  119, 104, 116, 121, 130,  63, 123,  97,  62, 124,
                    312:   37, 125, 117, 128,   3, 126, 127, 129, 115, 122,
                    313:  117, 120,   2, 151,  85,  11,  12,   5,  23,  13,
                    314:   15, 218, 216, 217, 118, 249, 119, 215, 213, 121,
                    315:  214,   1, 123, 305,   0, 124,   0, 125, 116, 128,
                    316:  130, 126, 127, 129, 115, 122, 117, 120,   0,   0,
                    317:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    318:  118,   0, 119,   0,   0, 121,   0,   0, 123, 303,
                    319:    0, 124,   0, 125, 116, 128, 130, 126, 127, 129,
                    320:  115, 122, 117, 120,   0,   0,   0,   0,   0,   0,
                    321:    0,   0,   0,   0,   0,   0,   0,   0, 118,   0,
                    322:  119,   0, 118, 121, 119, 302, 123, 121,   0, 124,
                    323:  116, 125, 130, 128, 296, 126, 127, 129, 115, 122,
                    324:  117, 120, 115,   0, 117, 120,   0,   0,   0,   0,
                    325:    0,   0,   0,   0,   0,   0, 118,   0, 119,   0,
                    326:    0, 121,   0,   0, 123, 224,   0, 124, 116, 125,
                    327:  130, 128,   0, 126, 127, 129, 115, 122, 117, 120,
                    328:  118,   0, 119,   0,   0, 121,   0, 118, 123, 119,
                    329:    0, 124, 121, 125,   0, 128,   0, 126, 127, 129,
                    330:  115, 122, 117, 120,   0,   0, 116, 290, 130, 117,
                    331:  120,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    332:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    333:  116, 257, 130, 118,   0, 119,   0,   0, 121,   0,
                    334:    0, 123,   0,   0, 124,   0, 125,   0, 128,   0,
                    335:  126, 127, 129, 115, 122, 117, 120, 118,   0, 119,
                    336:    0,   0, 121,   0,   0, 123,   0,   0, 124,   0,
                    337:  125,   0, 128, 243, 126, 127, 129, 115, 122, 117,
                    338:  120,   0, 247, 116,   0, 130,   0,   0,   0,   0,
                    339:    0,   0,   0, 118,   0, 119,   0, 118, 121, 119,
                    340:    0, 123, 121,   0, 124, 123, 125, 116, 128, 130,
                    341:  126, 127, 129, 115, 122, 117, 120, 115, 122, 117,
                    342:  120,   0,   0,   0,   0,   0,   0,   0,   0, 118,
                    343:    0, 119,   0,   0, 121,   0,   0, 123, 199,   0,
                    344:  124,   0, 125, 116, 128, 130, 126, 127, 129, 115,
                    345:  122, 117, 120, 118,   0, 119,   0,   0, 121,   0,
                    346:    0, 123,   0,   0, 124,   0, 125,   0, 128,   0,
                    347:  126, 127, 129, 115, 122, 117, 120,   0,   0, 116,
                    348:    0, 130,  86,  89,  87,  88,   0,   0,  80,   0,
                    349:    0,  78,   0,   0,  79,  86,  89,  87,  88,   0,
                    350:    0,  80,   0,   0,  78, 130,   0,  79,   0,   0,
                    351:   82,  81,   0,   0,   0,   0,   0,   0,   0,   0,
                    352:    0,   0,   0,  82,  81,   0,   0,   0,  83,   0,
                    353:   84,   0,   0,  86,  89,  87,  88,   0, 186,  80,
                    354:    0,  83,  78,  84,   0,  79,  86,  89,  87,  88,
                    355:    0, 184,  80,   0,   0,  78,   0,   0,  79,   0,
                    356:    0,  82,  81,   0,   0,   0,   0,   0,   0,   0,
                    357:    0,   0,   0,   0,  82,  81,   0,   0,   0,  83,
                    358:    0,  84,   0,   0,  86,  89,  87,  88,   0, 182,
                    359:   80,   0,  83,  78,  84,   0,  79,  86,  89,  87,
                    360:   88,   0, 179,  80,   0,   0,  78,   0,   0,  79,
                    361:    0,   0,  82,  81,   0,   0,   0,   0,   0,   0,
                    362:    0,   0,   0,   0,   0,  82,  81,   0,   0,   0,
                    363:   83,   0,  84,   0,   0,  86,  89,  87,  88,   0,
                    364:  177,  80,   0,  83,  78,  84,   0,  79,  86,  89,
                    365:   87,  88,   0, 175,  80,   0,   0,  78,   0,   0,
                    366:   79,   0,   0,  82,  81,   0,   0,   0,   0,   0,
                    367:    0,   0,   0,   0,   0,   0,  82,  81,   0,   0,
                    368:    0,  83,   0,  84,   0,   0,  86,  89,  87,  88,
                    369:    0, 173,  80,   0,  83,  78,  84,   0,  79,  86,
                    370:   89,  87,  88,   0, 171,  80,   0,   0,  78,   0,
                    371:    0,  79,   0,   0,  82,  81, 118,   0, 119,   0,
                    372:    0, 121,   0,   0, 123,   0,   0,  82,  81, 125,
                    373:    0,   0,  83,   0,  84,   0, 115, 122, 117, 120,
                    374:    0, 267,   0,   0,   0,  83,   0,  84,   0, 135,
                    375:   86,  89,  87,  88,   0,   0,  80,   0,   0,  78,
                    376:    0,   0,  79,  86,  89,  87,  88,   0,   0,  80,
                    377:    0,   0,  78,   0,   0,  79,   0,   0,  82,  81,
                    378:    0,  10,   0,  14,   0,   0,   0,   0,   0,   0,
                    379:    0,  82,  81,   0,   0,   0,  83,  16,  84,   0,
                    380:    0,   0,   0,  86,  89,  87,  88,   0,   0,  83,
                    381:    0,  84,   0,  76,  86,  89,  87,  88,   0,   0,
                    382:   80,   0,   0,  78,   0,   0,  79,  86,  89,  87,
                    383:   88,  82,  81,  80,   0,   0,  78,   0,   0,  79,
                    384:    0,   0,  82,  81,   0,   0,   0,   0,   0,  83,
                    385:    0,  84,   0,   0,   0,  82,  81,   0,   0,   0,
                    386:   83,   0,  84, 150,   0,  86,  89,  87,  88,   0,
                    387:    0,  80,   0,  83,  78,  84,   0,  79,   0,   0,
                    388:    0,   0,   0,   0, 118,   0, 119,   0,   0, 121,
                    389:    0,   0, 123,  82,  81, 124,   0, 125,   0, 128,
                    390:    0, 126, 127,   0, 115, 122, 117, 120,   0,   0,
                    391:  118,  83, 119, 146,   0, 121,   0,   0, 123,   0,
                    392:    0, 124,   0, 125,   0,   0,   0, 126,   0,   0,
                    393:  115, 122, 117, 120, 118,   0, 119,   0,   0, 121,
                    394:    0,   0, 123,   0,   0, 124,   0, 125,   0,   0,
                    395:    0,   0,   0,   0, 115, 122, 117, 120 };
                    396: extern short  yypgo[];
                    397: short  yypact []={
                    398: 
                    399: -1000, 110,-1000,-1000,-1000,  82,-1000, 253, 245,-1000,
                    400:  259,-1000,-1000, 167, 331, 158, 328,-1000, 107, 125,
                    401: -1000, 241, 241,  29, 148, -34,-1000, 219,-1000, 253,
                    402:  256, 253,-1000, 298,-1000,-1000,-1000,-1000, 208, 137,
                    403:  148, 125, 166, 157, 114,-1000,-1000,-1000, 206, 129,
                    404: 1031,-1000,-1000,-1000,-1000,  40,-1000,   6,  92,-1000,
                    405:  -36,  62,-1000, -15,-1000,-1000, 122,1095,-1000,-1000,
                    406: -1000, 302,-1000,-1000, 112, 717, 967, 141,1095,1095,
                    407: 1095,1095,1095,1133,1018,1082, 218,-1000,-1000,-1000,
                    408:  174, 253,  80,-1000, 125, 147,-1000,-1000, 159, 298,
                    409: -1000,-1000, 125,-1000,-1000,-1000,-1000, 131,  33,-1000,
                    410: -1000,-1000, 717,-1000,-1000,1095,1095, 916, 903, 865,
                    411:  852, 814,1095, 801, 763, 750,1095,1095,1095,1095,
                    412: 1095,  53,-1000, 717, 967,-1000,-1000,1095, 296,-1000,
                    413:  141, 141, 141, 141, 141, 141,1018, 191, 657, 223,
                    414: -1000,  36, 717,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
                    415: -1000,-1000,  95,-1000,-1000,-1000,  58, 221, 551, 717,
                    416: -1000,1095, 283,1095, 283,1095, 364,1095,-1000,1095,
                    417:  486, 333,1095, 980,1095, 661,1095,1198,1174, 621,
                    418:  717, 717, 152, 967,  53, 597,-1000, 187,1095,-1000,
                    419:  132, 189, 223,1095,-1000,   6,-1000,-1000,   2,-1000,
                    420: -1000, 544,-1000, 279, 279, 279, 279,1095, 279,  19,
                    421:   10, 954, 294,-1000,  22, 279, 217, 216,-1000, 214,
                    422:  213, 215,1095, 273,  24, 717, 717, 717, 717, 717,
                    423:  717, 717, 717,1095,-1000,-1000, 150,-1000,1071, 141,
                    424:  106,-1000, 139, 132, 717,-1000,-1000,-1000, 233,-1000,
                    425: -1000, 228, 181, 693,-1000,-1000,-1000,-1000, 520,   8,
                    426: -1000,-1000,-1000,1095,1095,1095,1095,-1000, 482,-1000,
                    427: -1000,  14,1148,-1000,-1000, 100, 211,-1000, 210, 279,
                    428: -1000,-1000, 444, 408,  -4, 372,-1000,-1000,-1000, 179,
                    429: 1095,-1000,-1000,-1000,1095,-1000,-1000, 326, -27, -30,
                    430: -1000,-1000 };
                    431: extern short  yyr1[];
                    432: short  yypgo []={
                    433: 
                    434:    0, 421,  57, 420, 418, 417, 413, 412, 411, 410,
                    435:  409, 408,   0,   2, 166,  14, 407, 221, 406, 405,
                    436:   15,  11, 404,   3, 134,  91, 403, 402, 394,   1,
                    437:  390, 388, 385,  82, 381,  23,   9, 379, 376,  29,
                    438:  303, 374,  36,  41, 373, 371,  58, 367, 364,  21,
                    439:  363, 358, 357,  25,  12, 356, 348, 346, 342, 335,
                    440:  328 };
                    441: extern short  yyr2[];
                    442: short  yyr1 []={
                    443: 
                    444:    0,   1,   1,  27,  27,  28,  28,  30,  28,  31,
                    445:   32,  32,  35,  35,  37,  37,  38,  38,  38,  34,
                    446:   34,  34,  16,  16,  15,  15,  15,  15,  15,  40,
                    447:   17,  17,  17,  17,  17,  18,  18,   9,   9,  41,
                    448:   41,  43,  43,  19,  19,  10,  10,  44,  44,  46,
                    449:   46,  39,  47,  39,  23,  23,  23,  23,  23,  25,
                    450:   25,  25,  25,  25,  25,  24,  24,  24,  24,  24,
                    451:   24,  24,  11,  48,  48,  48,  29,  50,  29,  51,
                    452:   51,  49,  49,  49,  49,  49,  53,  53,  54,  54,
                    453:   42,  42,  45,  45,  52,  52,  55,  33,  33,  56,
                    454:   57,  58,  36,  36,  36,  36,  36,  36,  36,  36,
                    455:   36,  36,  36,  36,  36,  36,  36,  36,  36,  59,
                    456:   59,  59,   7,   4,   3,   5,   6,   8,  60,   2,
                    457:   13,  13,  26,  26,  12,  12,  12,  12,  12,  12,
                    458:   12,  12,  12,  12,  12,  12,  12,  12,  12,  12,
                    459:   12,  12,  12,  12,  12,  12,  12,  12,  12,  14,
                    460:   14,  14,  14,  14,  14,  14,  14,  14,  14,  14,
                    461:   14,  14,  14,  14,  14,  14,  14,  20,  21,  21,
                    462:   21,  21,  21,  21,  21,  22,  22 };
                    463: extern short  yychk[];
                    464: short  yyr2 []={
                    465: 
                    466:    0,   2,   0,   1,   1,   2,   3,   0,   4,   2,
                    467:    2,   0,   2,   0,   3,   4,   3,   4,   0,   3,
                    468:    2,   2,   1,   0,   2,   2,   1,   1,   3,   1,
                    469:    1,   2,   3,   1,   1,   5,   2,   1,   2,   1,
                    470:    3,   1,   3,   5,   2,   1,   2,   1,   3,   2,
                    471:    1,   1,   0,   4,   1,   1,   3,   2,   1,   2,
                    472:    3,   3,   4,   1,   3,   2,   3,   3,   4,   3,
                    473:    3,   2,   2,   1,   3,   1,   1,   0,   4,   1,
                    474:    1,   1,   1,   3,   6,   1,   1,   3,   1,   4,
                    475:    0,   1,   0,   1,   0,   1,   1,   1,   1,   4,
                    476:    3,   1,   2,   1,   2,   2,   2,   7,   4,   2,
                    477:    2,   2,   2,   3,   3,   1,   2,   2,   2,   2,
                    478:    3,   2,   1,   4,   3,   4,   6,   4,   0,   2,
                    479:    1,   0,   1,   3,   3,   3,   3,   3,   3,   3,
                    480:    3,   3,   3,   3,   3,   3,   3,   4,   4,   4,
                    481:    4,   4,   4,   4,   4,   5,   3,   3,   1,   2,
                    482:    2,   2,   2,   2,   2,   2,   4,   4,   4,   2,
                    483:    3,   3,   1,   1,   1,   1,   3,   2,   0,   2,
                    484:    5,   2,   3,   4,   3,   2,   2 };
                    485: extern short  yydef[];
                    486: short  yychk []={
                    487: 
                    488: -1000,  -1, -27, -28, 256, -16, -15, -40, -17,  34,
                    489:   33, -19, -18, -10,  35,  -9,  49,  57, -29, -24,
                    490:  -49,  11,  50, -11, -25, -51, 256,   2, -17, -40,
                    491:   33,  52,   2,  52,   2,  57,  56, -30,  50,  54,
                    492:  -25, -24, -25, -24, -48,  51,   2, 256,  50,  54,
                    493:  -52,  58,  50, -17,  33, -44, -46, -17, -41, -43,
                    494:    2, -50, -31, -32,  51,  55,  -2, -60,  51,  51,
                    495:   51,  56,  51,  55,  -2, -12,  52, -14,  11,  14,
                    496:    8,  31,  30,  48,  50, -22,   2,   4,   5,   3,
                    497:  -45,  57, -39, -23, -24, -25,  22, 256, -42,  56,
                    498:   58, -49, -24, -33, -34, -56, -57, -15, 256, -58,
                    499:   52,  55, -12,   2,  55,  26,  56,  28,   6,   8,
                    500:   29,  11,  27,  14,  17,  19,  23,  24,  21,  25,
                    501:   58, -53, -54, -12, -55,  52,  30,  54,  32,  50,
                    502:  -14, -14, -14, -14, -14, -14,  50, -20, -12, -17,
                    503:   51, -26, -12,  50,  53, -46,  56,  22,  -2,  53,
                    504:  -43,  -2, -39,  57,  57, -37, -35, -38, -12, -12,
                    505:  -12,  58, -12,  58, -12,  58, -12,  58, -12,  58,
                    506:  -12, -12,  58, -12,  58, -12,  58, -12, -12, -12,
                    507:  -12, -12, -42,  56, -53, -12,   2, -20,  51,  51,
                    508:  -21,  50,  11,  56,  51, -47,  -2,  57, -35, -36,
                    509:   53, -12, -33,  -4,  -3,  -5,  -7,  -6,  -8,  41,
                    510:   42,  36,  37,  57, 256, -59,  38,  43,  44,  45,
                    511:   40,   2,  47,  46, -15, -12, -12, -12, -12, -12,
                    512:  -12, -12, -12,  22,  53, -54, -42,  55,  51, -14,
                    513:   54,  51, -21, -21, -12, -23,  53,  57, -36, -36,
                    514:  -36, -36, -13, -12, -36,  57,  57,  57, -12,   2,
                    515:   57,  53, -36,  50,  50,  50,  50,  22, -12,  22,
                    516:   57, -29, -12,  53,  55,  -2,  51,  39,  43,  51,
                    517:   57,  57, -12, -12, -13, -12,  22,  57,  55,  50,
                    518:   50, -36,  51,  51,  57,  51,  51, -12, -13,  51,
                    519:   57,  57 };
                    520: #
                    521: # define YYFLAG -1000
                    522: # define YYERROR goto yyerrlab
                    523: # define YYACCEPT return(0)
                    524: # define YYABORT return(1)
                    525: 
                    526: /*     parser for yacc output  */
                    527: 
                    528: #ifdef YYDEBUG
                    529: int yydebug = 0; /* 1 for debugging */
                    530: #endif
                    531: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
                    532: int yychar = -1; /* current input token number */
                    533: int yynerrs = 0;  /* number of errors */
                    534: short yyerrflag = 0;  /* error recovery flag */
                    535: 
                    536: yyparse() {
                    537: 
                    538:        short yys[YYMAXDEPTH];
                    539:        short yyj, yym;
                    540:        register YYSTYPE *yypvt;
                    541:        register short yystate, *yyps, yyn;
                    542:        register YYSTYPE *yypv;
                    543:        register short *yyxi;
                    544: 
                    545:        yystate = 0;
                    546:        yychar = -1;
                    547:        yynerrs = 0;
                    548:        yyerrflag = 0;
                    549:        yyps= &yys[-1];
                    550:        yypv= &yyv[-1];
                    551: 
                    552:  yystack:    /* put a state and value onto the stack */
                    553: 
                    554: #ifdef YYDEBUG
                    555:        if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
                    556: #endif
                    557:                if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
                    558:                *yyps = yystate;
                    559:                ++yypv;
                    560:                *yypv = yyval;
                    561: 
                    562:  yynewstate:
                    563: 
                    564:        yyn = yypact[yystate];
                    565: 
                    566:        if( yyn<= YYFLAG ) goto yydefault; /* simple state */
                    567: 
                    568:        if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
                    569:        if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
                    570: 
                    571:        if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
                    572:                yychar = -1;
                    573:                yyval = yylval;
                    574:                yystate = yyn;
                    575:                if( yyerrflag > 0 ) --yyerrflag;
                    576:                goto yystack;
                    577:                }
                    578: 
                    579:  yydefault:
                    580:        /* default state action */
                    581: 
                    582:        if( (yyn=yydef[yystate]) == -2 ) {
                    583:                if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
                    584:                /* look through exception table */
                    585: 
                    586:                for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
                    587: 
                    588:                while( *(yyxi+=2) >= 0 ){
                    589:                        if( *yyxi == yychar ) break;
                    590:                        }
                    591:                if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
                    592:                }
                    593: 
                    594:        if( yyn == 0 ){ /* error */
                    595:                /* error ... attempt to resume parsing */
                    596: 
                    597:                switch( yyerrflag ){
                    598: 
                    599:                case 0:   /* brand new error */
                    600: 
                    601:                        yyerror( "syntax error" );
                    602:                yyerrlab:
                    603:                        ++yynerrs;
                    604: 
                    605:                case 1:
                    606:                case 2: /* incompletely recovered error ... try again */
                    607: 
                    608:                        yyerrflag = 3;
                    609: 
                    610:                        /* find a state where "error" is a legal shift action */
                    611: 
                    612:                        while ( yyps >= yys ) {
                    613:                           yyn = yypact[*yyps] + YYERRCODE;
                    614:                           if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
                    615:                              yystate = yyact[yyn];  /* simulate a shift of "error" */
                    616:                              goto yystack;
                    617:                              }
                    618:                           yyn = yypact[*yyps];
                    619: 
                    620:                           /* the current yyps has no shift onn "error", pop stack */
                    621: 
                    622: #ifdef YYDEBUG
                    623:                           if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
                    624: #endif
                    625:                           --yyps;
                    626:                           --yypv;
                    627:                           }
                    628: 
                    629:                        /* there is no state on the stack with an error shift ... abort */
                    630: 
                    631:        yyabort:
                    632:                        return(1);
                    633: 
                    634: 
                    635:                case 3:  /* no shift yet; clobber input char */
                    636: 
                    637: #ifdef YYDEBUG
                    638:                        if( yydebug ) printf( "error recovery discards char %d\n", yychar );
                    639: #endif
                    640: 
                    641:                        if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
                    642:                        yychar = -1;
                    643:                        goto yynewstate;   /* try again in the same state */
                    644: 
                    645:                        }
                    646: 
                    647:                }
                    648: 
                    649:        /* reduction by production yyn */
                    650: 
                    651: #ifdef YYDEBUG
                    652:                if( yydebug ) printf("reduce %d\n",yyn);
                    653: #endif
                    654:                yyps -= yyr2[yyn];
                    655:                yypvt = yypv;
                    656:                yypv -= yyr2[yyn];
                    657:                yyval = yypv[1];
                    658:                yym=yyn;
                    659:                        /* consult goto table to find next state */
                    660:                yyn = yyr1[yyn];
                    661:                yyj = yypgo[yyn] + *yyps + 1;
                    662:                if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
                    663:                switch(yym){
                    664:                        
                    665: case 2:
                    666: # line 137 "../mip/cgram.y"
                    667: ftnend(); break;
                    668: case 3:
                    669: # line 140 "../mip/cgram.y"
                    670: { curclass = SNULL;  blevel = 0; } break;
                    671: case 4:
                    672: # line 142 "../mip/cgram.y"
                    673: { curclass = SNULL;  blevel = 0; } break;
                    674: case 5:
                    675: # line 146 "../mip/cgram.y"
                    676: {  yypvt[-1].nodep->in.op = FREE; } break;
                    677: case 6:
                    678: # line 148 "../mip/cgram.y"
                    679: {  yypvt[-2].nodep->in.op = FREE; } break;
                    680: case 7:
                    681: # line 149 "../mip/cgram.y"
                    682: {
                    683:                                defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass==STATIC?STATIC:EXTDEF );
                    684: #ifndef LINT
                    685:                                pfstab(stab[yypvt[-0].nodep->tn.rval].sname);
                    686: #endif
                    687:                                } break;
                    688: case 8:
                    689: # line 155 "../mip/cgram.y"
                    690: {  
                    691:                            if( blevel ) cerror( "function level error" );
                    692:                            if( reached ) retstat |= NRETVAL; 
                    693:                            yypvt[-3].nodep->in.op = FREE;
                    694:                            ftnend();
                    695:                            } break;
                    696: case 11:
                    697: # line 166 "../mip/cgram.y"
                    698: {  blevel = 1; } break;
                    699: case 13:
                    700: # line 171 "../mip/cgram.y"
                    701: {  bccode();
                    702:                            locctr(PROG);
                    703:                            } break;
                    704: case 14:
                    705: # line 177 "../mip/cgram.y"
                    706: {  yypvt[-1].nodep->in.op = FREE; 
                    707: #ifndef LINT
                    708:                            plcstab(blevel);
                    709: #endif
                    710:                            } break;
                    711: case 15:
                    712: # line 183 "../mip/cgram.y"
                    713: {  yypvt[-2].nodep->in.op = FREE; 
                    714: #ifndef LINT
                    715:                            plcstab(blevel);
                    716: #endif
                    717:                            } break;
                    718: case 16:
                    719: # line 191 "../mip/cgram.y"
                    720: {  yypvt[-1].nodep->in.op = FREE; } break;
                    721: case 17:
                    722: # line 193 "../mip/cgram.y"
                    723: {  yypvt[-2].nodep->in.op = FREE; } break;
                    724: case 19:
                    725: # line 197 "../mip/cgram.y"
                    726: { curclass = SNULL;  yypvt[-2].nodep->in.op = FREE; } break;
                    727: case 20:
                    728: # line 199 "../mip/cgram.y"
                    729: { curclass = SNULL;  yypvt[-1].nodep->in.op = FREE; } break;
                    730: case 21:
                    731: # line 201 "../mip/cgram.y"
                    732: {  curclass = SNULL; } break;
                    733: case 23:
                    734: # line 205 "../mip/cgram.y"
                    735: {  yyval.nodep = mkty(INT,0,INT);  curclass = SNULL; } break;
                    736: case 24:
                    737: # line 208 "../mip/cgram.y"
                    738: {  yyval.nodep = yypvt[-0].nodep; } break;
                    739: case 26:
                    740: # line 211 "../mip/cgram.y"
                    741: {  yyval.nodep = mkty(INT,0,INT); } break;
                    742: case 27:
                    743: # line 213 "../mip/cgram.y"
                    744: { curclass = SNULL ; } break;
                    745: case 28:
                    746: # line 215 "../mip/cgram.y"
                    747: {  yypvt[-2].nodep->in.type = types( yypvt[-2].nodep->in.type, yypvt[-0].nodep->in.type, UNDEF );
                    748:                            yypvt[-0].nodep->in.op = FREE;
                    749:                            } break;
                    750: case 29:
                    751: # line 222 "../mip/cgram.y"
                    752: {  curclass = yypvt[-0].intval; } break;
                    753: case 31:
                    754: # line 227 "../mip/cgram.y"
                    755: {  yypvt[-1].nodep->in.type = types( yypvt[-1].nodep->in.type, yypvt[-0].nodep->in.type, UNDEF );
                    756:                            yypvt[-0].nodep->in.op = FREE;
                    757:                            } break;
                    758: case 32:
                    759: # line 231 "../mip/cgram.y"
                    760: {  yypvt[-2].nodep->in.type = types( yypvt[-2].nodep->in.type, yypvt[-1].nodep->in.type, yypvt[-0].nodep->in.type );
                    761:                            yypvt[-1].nodep->in.op = yypvt[-0].nodep->in.op = FREE;
                    762:                            } break;
                    763: case 35:
                    764: # line 239 "../mip/cgram.y"
                    765: { yyval.nodep = dclstruct(yypvt[-4].intval); } break;
                    766: case 36:
                    767: # line 241 "../mip/cgram.y"
                    768: {  yyval.nodep = rstruct(yypvt[-0].intval,0);  stwart = instruct; } break;
                    769: case 37:
                    770: # line 245 "../mip/cgram.y"
                    771: {  yyval.intval = bstruct(-1,0); stwart = SEENAME; } break;
                    772: case 38:
                    773: # line 247 "../mip/cgram.y"
                    774: {  yyval.intval = bstruct(yypvt[-0].intval,0); stwart = SEENAME; } break;
                    775: case 41:
                    776: # line 255 "../mip/cgram.y"
                    777: {  moedef( yypvt[-0].intval ); } break;
                    778: case 42:
                    779: # line 257 "../mip/cgram.y"
                    780: {  strucoff = yypvt[-0].intval;  moedef( yypvt[-2].intval ); } break;
                    781: case 43:
                    782: # line 261 "../mip/cgram.y"
                    783: { yyval.nodep = dclstruct(yypvt[-4].intval);  } break;
                    784: case 44:
                    785: # line 263 "../mip/cgram.y"
                    786: {  yyval.nodep = rstruct(yypvt[-0].intval,yypvt[-1].intval); } break;
                    787: case 45:
                    788: # line 267 "../mip/cgram.y"
                    789: {  yyval.intval = bstruct(-1,yypvt[-0].intval);  stwart=0; } break;
                    790: case 46:
                    791: # line 269 "../mip/cgram.y"
                    792: {  yyval.intval = bstruct(yypvt[-0].intval,yypvt[-1].intval);  stwart=0;  } break;
                    793: case 49:
                    794: # line 277 "../mip/cgram.y"
                    795: { curclass = SNULL;  stwart=0; yypvt[-1].nodep->in.op = FREE; } break;
                    796: case 50:
                    797: # line 279 "../mip/cgram.y"
                    798: {  if( curclass != MOU ){
                    799:                                curclass = SNULL;
                    800:                                }
                    801:                            else {
                    802:                                sprintf( fakename, "$%dFAKE", fake++ );
                    803: #ifdef FLEXSTRINGS
                    804:                                /* No need to hash this, we won't look it up */
                    805:                                defid( tymerge(yypvt[-0].nodep, bdty(NAME,NIL,lookup( savestr(fakename), SMOS ))), curclass );
                    806: #else
                    807:                                defid( tymerge(yypvt[-0].nodep, bdty(NAME,NIL,lookup( fakename, SMOS ))), curclass );
                    808: #endif
                    809:                                werror("structure typed union member must be named");
                    810:                                }
                    811:                            stwart = 0;
                    812:                            yypvt[-0].nodep->in.op = FREE;
                    813:                            } break;
                    814: case 51:
                    815: # line 299 "../mip/cgram.y"
                    816: { defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass);  stwart = instruct; } break;
                    817: case 52:
                    818: # line 300 "../mip/cgram.y"
                    819: {yyval.nodep=yypvt[-2].nodep;} break;
                    820: case 53:
                    821: # line 301 "../mip/cgram.y"
                    822: { defid( tymerge(yypvt[-4].nodep,yypvt[-0].nodep), curclass);  stwart = instruct; } break;
                    823: case 56:
                    824: # line 307 "../mip/cgram.y"
                    825: {  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
                    826:                            if( yypvt[-0].intval<0 || yypvt[-0].intval >= FIELD ){
                    827:                                uerror( "illegal field size" );
                    828:                                yypvt[-0].intval = 1;
                    829:                                }
                    830:                            defid( tymerge(yypvt[-3].nodep,yypvt[-2].nodep), FIELD|yypvt[-0].intval );
                    831:                            yyval.nodep = NIL;
                    832:                            } break;
                    833: case 57:
                    834: # line 317 "../mip/cgram.y"
                    835: {  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
                    836:                            falloc( stab, yypvt[-0].intval, -1, yypvt[-2].nodep );  /* alignment or hole */
                    837:                            yyval.nodep = NIL;
                    838:                            } break;
                    839: case 58:
                    840: # line 322 "../mip/cgram.y"
                    841: {  yyval.nodep = NIL; } break;
                    842: case 59:
                    843: # line 327 "../mip/cgram.y"
                    844: {  umul:
                    845:                                yyval.nodep = bdty( UNARY MUL, yypvt[-0].nodep, 0 ); } break;
                    846: case 60:
                    847: # line 330 "../mip/cgram.y"
                    848: {  uftn:
                    849:                                yyval.nodep = bdty( UNARY CALL, yypvt[-2].nodep, 0 );  } break;
                    850: case 61:
                    851: # line 333 "../mip/cgram.y"
                    852: {  uary:
                    853:                                yyval.nodep = bdty( LB, yypvt[-2].nodep, 0 );  } break;
                    854: case 62:
                    855: # line 336 "../mip/cgram.y"
                    856: {  bary:
                    857:                                if( (int)yypvt[-1].intval <= 0 ) werror( "zero or negative subscript" );
                    858:                                yyval.nodep = bdty( LB, yypvt[-3].nodep, yypvt[-1].intval );  } break;
                    859: case 63:
                    860: # line 340 "../mip/cgram.y"
                    861: {  yyval.nodep = bdty( NAME, NIL, yypvt[-0].intval );  } break;
                    862: case 64:
                    863: # line 342 "../mip/cgram.y"
                    864: { yyval.nodep=yypvt[-1].nodep; } break;
                    865: case 65:
                    866: # line 345 "../mip/cgram.y"
                    867: {  goto umul; } break;
                    868: case 66:
                    869: # line 347 "../mip/cgram.y"
                    870: {  goto uftn; } break;
                    871: case 67:
                    872: # line 349 "../mip/cgram.y"
                    873: {  goto uary; } break;
                    874: case 68:
                    875: # line 351 "../mip/cgram.y"
                    876: {  goto bary; } break;
                    877: case 69:
                    878: # line 353 "../mip/cgram.y"
                    879: { yyval.nodep = yypvt[-1].nodep; } break;
                    880: case 70:
                    881: # line 355 "../mip/cgram.y"
                    882: {
                    883:                                if( blevel!=0 ) uerror("function declaration in bad context");
                    884:                                yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,yypvt[-2].intval), 0 );
                    885:                                stwart = 0;
                    886:                                } break;
                    887: case 71:
                    888: # line 361 "../mip/cgram.y"
                    889: {
                    890:                                yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,yypvt[-1].intval), 0 );
                    891:                                stwart = 0;
                    892:                                } break;
                    893: case 72:
                    894: # line 368 "../mip/cgram.y"
                    895: {
                    896:                                /* turn off typedefs for argument names */
                    897:                                stwart = SEENAME;
                    898:                                if( stab[yypvt[-1].intval].sclass == SNULL )
                    899:                                    stab[yypvt[-1].intval].stype = FTN;
                    900:                                } break;
                    901: case 73:
                    902: # line 377 "../mip/cgram.y"
                    903: { ftnarg( yypvt[-0].intval );  stwart = SEENAME; } break;
                    904: case 74:
                    905: # line 379 "../mip/cgram.y"
                    906: { ftnarg( yypvt[-0].intval );  stwart = SEENAME; } break;
                    907: case 77:
                    908: # line 385 "../mip/cgram.y"
                    909: {yyval.nodep=yypvt[-2].nodep;} break;
                    910: case 79:
                    911: # line 389 "../mip/cgram.y"
                    912: {  defid( yypvt[-0].nodep = tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass);
                    913:                            beginit(yypvt[-0].nodep->tn.rval);
                    914:                            } break;
                    915: case 81:
                    916: # line 396 "../mip/cgram.y"
                    917: {  nidcl( tymerge(yypvt[-1].nodep,yypvt[-0].nodep) ); } break;
                    918: case 82:
                    919: # line 398 "../mip/cgram.y"
                    920: {  defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), uclass(curclass) );
                    921:                        } break;
                    922: case 83:
                    923: # line 402 "../mip/cgram.y"
                    924: {  doinit( yypvt[-0].nodep );
                    925:                            endinit(); } break;
                    926: case 84:
                    927: # line 405 "../mip/cgram.y"
                    928: {  endinit(); } break;
                    929: case 88:
                    930: # line 415 "../mip/cgram.y"
                    931: {  doinit( yypvt[-0].nodep ); } break;
                    932: case 89:
                    933: # line 417 "../mip/cgram.y"
                    934: {  irbrace(); } break;
                    935: case 94:
                    936: # line 429 "../mip/cgram.y"
                    937: {  werror( "old-fashioned initialization: use =" ); } break;
                    938: case 96:
                    939: # line 434 "../mip/cgram.y"
                    940: {  ilbrace(); } break;
                    941: case 99:
                    942: # line 444 "../mip/cgram.y"
                    943: {  
                    944: #ifndef LINT
                    945:                            prcstab(blevel);
                    946: #endif
                    947:                            --blevel;
                    948:                            if( blevel == 1 ) blevel = 0;
                    949:                            clearst( blevel );
                    950:                            checkst( blevel );
                    951:                            autooff = *--psavbc;
                    952:                            regvar = *--psavbc;
                    953:                            } break;
                    954: case 100:
                    955: # line 458 "../mip/cgram.y"
                    956: {  --blevel;
                    957:                            if( blevel == 1 ) blevel = 0;
                    958:                            clearst( blevel );
                    959:                            checkst( blevel );
                    960:                            autooff = *--psavbc;
                    961:                            regvar = *--psavbc;
                    962:                            } break;
                    963: case 101:
                    964: # line 468 "../mip/cgram.y"
                    965: {  if( blevel == 1 ) dclargs();
                    966:                            ++blevel;
                    967:                            if( psavbc > &asavbc[BCSZ-2] ) cerror( "nesting too deep" );
                    968:                            *psavbc++ = regvar;
                    969:                            *psavbc++ = autooff;
                    970:                            } break;
                    971: case 102:
                    972: # line 477 "../mip/cgram.y"
                    973: { ecomp( yypvt[-1].nodep ); } break;
                    974: case 104:
                    975: # line 480 "../mip/cgram.y"
                    976: { deflab(yypvt[-1].intval);
                    977:                           reached = 1;
                    978:                           } break;
                    979: case 105:
                    980: # line 484 "../mip/cgram.y"
                    981: {  if( yypvt[-1].intval != NOLAB ){
                    982:                                deflab( yypvt[-1].intval );
                    983:                                reached = 1;
                    984:                                }
                    985:                            } break;
                    986: case 106:
                    987: # line 490 "../mip/cgram.y"
                    988: {  branch(  contlab );
                    989:                            deflab( brklab );
                    990:                            if( (flostat&FBRK) || !(flostat&FLOOP)) reached = 1;
                    991:                            else reached = 0;
                    992:                            resetbc(0);
                    993:                            } break;
                    994: case 107:
                    995: # line 497 "../mip/cgram.y"
                    996: {  deflab( contlab );
                    997:                            if( flostat & FCONT ) reached = 1;
                    998:                            ecomp( buildtree( CBRANCH, buildtree( NOT, yypvt[-2].nodep, NIL ), bcon( yypvt[-6].intval ) ) );
                    999:                            deflab( brklab );
                   1000:                            reached = 1;
                   1001:                            resetbc(0);
                   1002:                            } break;
                   1003: case 108:
                   1004: # line 505 "../mip/cgram.y"
                   1005: {  deflab( contlab );
                   1006:                            if( flostat&FCONT ) reached = 1;
                   1007:                            if( yypvt[-2].nodep ) ecomp( yypvt[-2].nodep );
                   1008:                            branch( yypvt[-3].intval );
                   1009:                            deflab( brklab );
                   1010:                            if( (flostat&FBRK) || !(flostat&FLOOP) ) reached = 1;
                   1011:                            else reached = 0;
                   1012:                            resetbc(0);
                   1013:                            } break;
                   1014: case 109:
                   1015: # line 515 "../mip/cgram.y"
                   1016: {  if( reached ) branch( brklab );
                   1017:                            deflab( yypvt[-1].intval );
                   1018:                           swend();
                   1019:                            deflab(brklab);
                   1020:                            if( (flostat&FBRK) || !(flostat&FDEF) ) reached = 1;
                   1021:                            resetbc(FCONT);
                   1022:                            } break;
                   1023: case 110:
                   1024: # line 523 "../mip/cgram.y"
                   1025: {  if( brklab == NOLAB ) uerror( "illegal break");
                   1026:                            else if(reached) branch( brklab );
                   1027:                            flostat |= FBRK;
                   1028:                            if( brkflag ) goto rch;
                   1029:                            reached = 0;
                   1030:                            } break;
                   1031: case 111:
                   1032: # line 530 "../mip/cgram.y"
                   1033: {  if( contlab == NOLAB ) uerror( "illegal continue");
                   1034:                            else branch( contlab );
                   1035:                            flostat |= FCONT;
                   1036:                            goto rch;
                   1037:                            } break;
                   1038: case 112:
                   1039: # line 536 "../mip/cgram.y"
                   1040: {  retstat |= NRETVAL;
                   1041:                            branch( retlab );
                   1042:                        rch:
                   1043:                            if( !reached ) werror( "statement not reached");
                   1044:                            reached = 0;
                   1045:                            } break;
                   1046: case 113:
                   1047: # line 543 "../mip/cgram.y"
                   1048: {  register NODE *temp;
                   1049:                            idname = curftn;
                   1050:                            temp = buildtree( NAME, NIL, NIL );
                   1051:                            if(temp->in.type == TVOID)
                   1052:                                uerror("void function %s cannot return value",
                   1053:                                        stab[idname].sname);
                   1054:                            temp->in.type = DECREF( temp->in.type );
                   1055:                            temp = buildtree( RETURN, temp, yypvt[-1].nodep );
                   1056:                            /* now, we have the type of the RHS correct */
                   1057:                            temp->in.left->in.op = FREE;
                   1058:                            temp->in.op = FREE;
                   1059:                            ecomp( buildtree( FORCE, temp->in.right, NIL ) );
                   1060:                            retstat |= RETVAL;
                   1061:                            branch( retlab );
                   1062:                            reached = 0;
                   1063:                            } break;
                   1064: case 114:
                   1065: # line 560 "../mip/cgram.y"
                   1066: {  register NODE *q;
                   1067:                            q = block( FREE, NIL, NIL, INT|ARY, 0, INT );
                   1068:                            q->tn.rval = idname = yypvt[-1].intval;
                   1069:                            defid( q, ULABEL );
                   1070:                            stab[idname].suse = -lineno;
                   1071:                            branch( stab[idname].offset );
                   1072:                            goto rch;
                   1073:                            } break;
                   1074: case 119:
                   1075: # line 574 "../mip/cgram.y"
                   1076: {  register NODE *q;
                   1077:                            q = block( FREE, NIL, NIL, INT|ARY, 0, LABEL );
                   1078:                            q->tn.rval = yypvt[-1].intval;
                   1079:                            defid( q, LABEL );
                   1080:                            reached = 1;
                   1081:                            } break;
                   1082: case 120:
                   1083: # line 581 "../mip/cgram.y"
                   1084: {  addcase(yypvt[-1].nodep);
                   1085:                            reached = 1;
                   1086:                            } break;
                   1087: case 121:
                   1088: # line 585 "../mip/cgram.y"
                   1089: {  reached = 1;
                   1090:                            adddef();
                   1091:                            flostat |= FDEF;
                   1092:                            } break;
                   1093: case 122:
                   1094: # line 591 "../mip/cgram.y"
                   1095: {  savebc();
                   1096:                            if( !reached ) werror( "loop not entered at top");
                   1097:                            brklab = getlab();
                   1098:                            contlab = getlab();
                   1099:                            deflab( yyval.intval = getlab() );
                   1100:                            reached = 1;
                   1101:                            } break;
                   1102: case 123:
                   1103: # line 600 "../mip/cgram.y"
                   1104: {  ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( yyval.intval=getlab()) ) ) ;
                   1105:                            reached = 1;
                   1106:                            } break;
                   1107: case 124:
                   1108: # line 605 "../mip/cgram.y"
                   1109: {  if( reached ) branch( yyval.intval = getlab() );
                   1110:                            else yyval.intval = NOLAB;
                   1111:                            deflab( yypvt[-2].intval );
                   1112:                            reached = 1;
                   1113:                            } break;
                   1114: case 125:
                   1115: # line 613 "../mip/cgram.y"
                   1116: {  savebc();
                   1117:                            if( !reached ) werror( "loop not entered at top");
                   1118:                            if( yypvt[-1].nodep->in.op == ICON && yypvt[-1].nodep->tn.lval != 0 ) flostat = FLOOP;
                   1119:                            deflab( contlab = getlab() );
                   1120:                            reached = 1;
                   1121:                            brklab = getlab();
                   1122:                            if( flostat == FLOOP ) tfree( yypvt[-1].nodep );
                   1123:                            else ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( brklab) ) );
                   1124:                            } break;
                   1125: case 126:
                   1126: # line 624 "../mip/cgram.y"
                   1127: {  if( yypvt[-3].nodep ) ecomp( yypvt[-3].nodep );
                   1128:                            else if( !reached ) werror( "loop not entered at top");
                   1129:                            savebc();
                   1130:                            contlab = getlab();
                   1131:                            brklab = getlab();
                   1132:                            deflab( yyval.intval = getlab() );
                   1133:                            reached = 1;
                   1134:                            if( yypvt[-1].nodep ) ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( brklab) ) );
                   1135:                            else flostat |= FLOOP;
                   1136:                            } break;
                   1137: case 127:
                   1138: # line 636 "../mip/cgram.y"
                   1139: {  savebc();
                   1140:                            brklab = getlab();
                   1141:                            ecomp( buildtree( FORCE, yypvt[-1].nodep, NIL ) );
                   1142:                            branch( yyval.intval = getlab() );
                   1143:                            swstart();
                   1144:                            reached = 0;
                   1145:                            } break;
                   1146: case 128:
                   1147: # line 645 "../mip/cgram.y"
                   1148: { yyval.intval=instruct; stwart=instruct=0; } break;
                   1149: case 129:
                   1150: # line 647 "../mip/cgram.y"
                   1151: {  yyval.intval = icons( yypvt[-0].nodep );  instruct=yypvt[-1].intval; } break;
                   1152: case 131:
                   1153: # line 651 "../mip/cgram.y"
                   1154: { yyval.nodep=0; } break;
                   1155: case 133:
                   1156: # line 656 "../mip/cgram.y"
                   1157: {  goto bop; } break;
                   1158: case 134:
                   1159: # line 660 "../mip/cgram.y"
                   1160: {
                   1161:                        preconf:
                   1162:                            if( yychar==RELOP||yychar==EQUOP||yychar==AND||yychar==OR||yychar==ER ){
                   1163:                            precplaint:
                   1164:                                if( hflag ) werror( "precedence confusion possible: parenthesize!" );
                   1165:                                }
                   1166:                        bop:
                   1167:                            yyval.nodep = buildtree( yypvt[-1].intval, yypvt[-2].nodep, yypvt[-0].nodep );
                   1168:                            } break;
                   1169: case 135:
                   1170: # line 670 "../mip/cgram.y"
                   1171: {  yypvt[-1].intval = COMOP;
                   1172:                            goto bop;
                   1173:                            } break;
                   1174: case 136:
                   1175: # line 674 "../mip/cgram.y"
                   1176: {  goto bop; } break;
                   1177: case 137:
                   1178: # line 676 "../mip/cgram.y"
                   1179: {  if(yychar==SHIFTOP) goto precplaint; else goto bop; } break;
                   1180: case 138:
                   1181: # line 678 "../mip/cgram.y"
                   1182: {  if(yychar==SHIFTOP ) goto precplaint; else goto bop; } break;
                   1183: case 139:
                   1184: # line 680 "../mip/cgram.y"
                   1185: {  if(yychar==PLUS||yychar==MINUS) goto precplaint; else goto bop; } break;
                   1186: case 140:
                   1187: # line 682 "../mip/cgram.y"
                   1188: {  goto bop; } break;
                   1189: case 141:
                   1190: # line 684 "../mip/cgram.y"
                   1191: {  goto preconf; } break;
                   1192: case 142:
                   1193: # line 686 "../mip/cgram.y"
                   1194: {  if( yychar==RELOP||yychar==EQUOP ) goto preconf;  else goto bop; } break;
                   1195: case 143:
                   1196: # line 688 "../mip/cgram.y"
                   1197: {  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } break;
                   1198: case 144:
                   1199: # line 690 "../mip/cgram.y"
                   1200: {  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } break;
                   1201: case 145:
                   1202: # line 692 "../mip/cgram.y"
                   1203: {  goto bop; } break;
                   1204: case 146:
                   1205: # line 694 "../mip/cgram.y"
                   1206: {  goto bop; } break;
                   1207: case 147:
                   1208: # line 696 "../mip/cgram.y"
                   1209: {  abop:
                   1210:                                yyval.nodep = buildtree( ASG yypvt[-2].intval, yypvt[-3].nodep, yypvt[-0].nodep );
                   1211:                                } break;
                   1212: case 148:
                   1213: # line 700 "../mip/cgram.y"
                   1214: {  goto abop; } break;
                   1215: case 149:
                   1216: # line 702 "../mip/cgram.y"
                   1217: {  goto abop; } break;
                   1218: case 150:
                   1219: # line 704 "../mip/cgram.y"
                   1220: {  goto abop; } break;
                   1221: case 151:
                   1222: # line 706 "../mip/cgram.y"
                   1223: {  goto abop; } break;
                   1224: case 152:
                   1225: # line 708 "../mip/cgram.y"
                   1226: {  goto abop; } break;
                   1227: case 153:
                   1228: # line 710 "../mip/cgram.y"
                   1229: {  goto abop; } break;
                   1230: case 154:
                   1231: # line 712 "../mip/cgram.y"
                   1232: {  goto abop; } break;
                   1233: case 155:
                   1234: # line 714 "../mip/cgram.y"
                   1235: {  yyval.nodep=buildtree(QUEST, yypvt[-4].nodep, buildtree( COLON, yypvt[-2].nodep, yypvt[-0].nodep ) );
                   1236:                            } break;
                   1237: case 156:
                   1238: # line 717 "../mip/cgram.y"
                   1239: {  werror( "old-fashioned assignment operator" );  goto bop; } break;
                   1240: case 157:
                   1241: # line 719 "../mip/cgram.y"
                   1242: {  goto bop; } break;
                   1243: case 159:
                   1244: # line 723 "../mip/cgram.y"
                   1245: {  yyval.nodep = buildtree( yypvt[-0].intval, yypvt[-1].nodep, bcon(1) ); } break;
                   1246: case 160:
                   1247: # line 725 "../mip/cgram.y"
                   1248: { ubop:
                   1249:                            yyval.nodep = buildtree( UNARY yypvt[-1].intval, yypvt[-0].nodep, NIL );
                   1250:                            } break;
                   1251: case 161:
                   1252: # line 729 "../mip/cgram.y"
                   1253: {  if( ISFTN(yypvt[-0].nodep->in.type) || ISARY(yypvt[-0].nodep->in.type) ){
                   1254:                                werror( "& before array or function: ignored" );
                   1255:                                yyval.nodep = yypvt[-0].nodep;
                   1256:                                }
                   1257:                            else goto ubop;
                   1258:                            } break;
                   1259: case 162:
                   1260: # line 736 "../mip/cgram.y"
                   1261: {  goto ubop; } break;
                   1262: case 163:
                   1263: # line 738 "../mip/cgram.y"
                   1264: {
                   1265:                            yyval.nodep = buildtree( yypvt[-1].intval, yypvt[-0].nodep, NIL );
                   1266:                            } break;
                   1267: case 164:
                   1268: # line 742 "../mip/cgram.y"
                   1269: {  yyval.nodep = buildtree( yypvt[-1].intval==INCR ? ASG PLUS : ASG MINUS,
                   1270:                                                yypvt[-0].nodep,
                   1271:                                                bcon(1)  );
                   1272:                            } break;
                   1273: case 165:
                   1274: # line 747 "../mip/cgram.y"
                   1275: {  yyval.nodep = doszof( yypvt[-0].nodep ); } break;
                   1276: case 166:
                   1277: # line 749 "../mip/cgram.y"
                   1278: {  yyval.nodep = buildtree( CAST, yypvt[-2].nodep, yypvt[-0].nodep );
                   1279:                            yyval.nodep->in.left->in.op = FREE;
                   1280:                            yyval.nodep->in.op = FREE;
                   1281:                            yyval.nodep = yyval.nodep->in.right;
                   1282:                            } break;
                   1283: case 167:
                   1284: # line 755 "../mip/cgram.y"
                   1285: {  yyval.nodep = doszof( yypvt[-1].nodep ); } break;
                   1286: case 168:
                   1287: # line 757 "../mip/cgram.y"
                   1288: {  yyval.nodep = buildtree( UNARY MUL, buildtree( PLUS, yypvt[-3].nodep, yypvt[-1].nodep ), NIL ); } break;
                   1289: case 169:
                   1290: # line 759 "../mip/cgram.y"
                   1291: {  yyval.nodep=buildtree(UNARY CALL,yypvt[-1].nodep,NIL); } break;
                   1292: case 170:
                   1293: # line 761 "../mip/cgram.y"
                   1294: {  yyval.nodep=buildtree(CALL,yypvt[-2].nodep,yypvt[-1].nodep); } break;
                   1295: case 171:
                   1296: # line 763 "../mip/cgram.y"
                   1297: {  if( yypvt[-1].intval == DOT ){
                   1298:                                if( notlval( yypvt[-2].nodep ) )uerror("structure reference must be addressable");
                   1299:                                yypvt[-2].nodep = buildtree( UNARY AND, yypvt[-2].nodep, NIL );
                   1300:                                }
                   1301:                            idname = yypvt[-0].intval;
                   1302:                            yyval.nodep = buildtree( STREF, yypvt[-2].nodep, buildtree( NAME, NIL, NIL ) );
                   1303:                            } break;
                   1304: case 172:
                   1305: # line 771 "../mip/cgram.y"
                   1306: {  idname = yypvt[-0].intval;
                   1307:                            /* recognize identifiers in initializations */
                   1308:                            if( blevel==0 && stab[idname].stype == UNDEF ) {
                   1309:                                register NODE *q;
                   1310: #ifndef FLEXNAMES
                   1311:                                werror( "undeclared initializer name %.8s", stab[idname].sname );
                   1312: #else
                   1313:                                werror( "undeclared initializer name %s", stab[idname].sname );
                   1314: #endif
                   1315:                                q = block( FREE, NIL, NIL, INT, 0, INT );
                   1316:                                q->tn.rval = idname;
                   1317:                                defid( q, EXTERN );
                   1318:                                }
                   1319:                            yyval.nodep=buildtree(NAME,NIL,NIL);
                   1320:                            stab[yypvt[-0].intval].suse = -lineno;
                   1321:                        } break;
                   1322: case 173:
                   1323: # line 788 "../mip/cgram.y"
                   1324: {  yyval.nodep=bcon(0);
                   1325:                            yyval.nodep->tn.lval = lastcon;
                   1326:                            yyval.nodep->tn.rval = NONAME;
                   1327:                            if( yypvt[-0].intval ) yyval.nodep->fn.csiz = yyval.nodep->in.type = ctype(LONG);
                   1328:                            } break;
                   1329: case 174:
                   1330: # line 794 "../mip/cgram.y"
                   1331: {  yyval.nodep=buildtree(FCON,NIL,NIL);
                   1332:                            yyval.nodep->fpn.dval = dcon;
                   1333:                            } break;
                   1334: case 175:
                   1335: # line 798 "../mip/cgram.y"
                   1336: {  yyval.nodep = getstr(); /* get string contents */ } break;
                   1337: case 176:
                   1338: # line 800 "../mip/cgram.y"
                   1339: { yyval.nodep=yypvt[-1].nodep; } break;
                   1340: case 177:
                   1341: # line 804 "../mip/cgram.y"
                   1342: {
                   1343:                        yyval.nodep = tymerge( yypvt[-1].nodep, yypvt[-0].nodep );
                   1344:                        yyval.nodep->in.op = NAME;
                   1345:                        yypvt[-1].nodep->in.op = FREE;
                   1346:                        } break;
                   1347: case 178:
                   1348: # line 812 "../mip/cgram.y"
                   1349: { yyval.nodep = bdty( NAME, NIL, -1 ); } break;
                   1350: case 179:
                   1351: # line 814 "../mip/cgram.y"
                   1352: { yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,-1),0); } break;
                   1353: case 180:
                   1354: # line 816 "../mip/cgram.y"
                   1355: {  yyval.nodep = bdty( UNARY CALL, yypvt[-3].nodep, 0 ); } break;
                   1356: case 181:
                   1357: # line 818 "../mip/cgram.y"
                   1358: {  goto umul; } break;
                   1359: case 182:
                   1360: # line 820 "../mip/cgram.y"
                   1361: {  goto uary; } break;
                   1362: case 183:
                   1363: # line 822 "../mip/cgram.y"
                   1364: {  goto bary;  } break;
                   1365: case 184:
                   1366: # line 824 "../mip/cgram.y"
                   1367: { yyval.nodep = yypvt[-1].nodep; } break;
                   1368: case 185:
                   1369: # line 828 "../mip/cgram.y"
                   1370: {  if( stab[yypvt[-1].intval].stype == UNDEF ){
                   1371:                                register NODE *q;
                   1372:                                q = block( FREE, NIL, NIL, FTN|INT, 0, INT );
                   1373:                                q->tn.rval = yypvt[-1].intval;
                   1374:                                defid( q, EXTERN );
                   1375:                                }
                   1376:                            idname = yypvt[-1].intval;
                   1377:                            yyval.nodep=buildtree(NAME,NIL,NIL);
                   1378:                            stab[idname].suse = -lineno;
                   1379:                        } break;
                   1380:                }
                   1381:                goto yystack;  /* stack new state and value */
                   1382: 
                   1383:        }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.