Annotation of cci/usr/src/usr.bin/struct/beauty.c, revision 1.1.1.1

1.1       root        1: # define xxif 300
                      2: # define xxelse 301
                      3: # define xxwhile 302
                      4: # define xxrept 303
                      5: # define xxdo 304
                      6: # define xxrb 305
                      7: # define xxpred 306
                      8: # define xxident 307
                      9: # define xxle 308
                     10: # define xxge 309
                     11: # define xxne 310
                     12: # define xxnum 311
                     13: # define xxcom 312
                     14: # define xxstring 313
                     15: # define xxexplist 314
                     16: # define xxidpar 315
                     17: # define xxelseif 316
                     18: # define xxlb 318
                     19: # define xxend 319
                     20: # define xxcase 320
                     21: # define xxswitch 321
                     22: # define xxuntil 322
                     23: # define xxdefault 323
                     24: # define xxeq 324
                     25: # define xxuminus 281
                     26: 
                     27: # line 17 "beauty.y"
                     28: #ifndef lint
                     29: static char sccsid[] = "@(#)beauty.y   4.1     (Berkeley)      2/11/83";
                     30: #endif not lint
                     31: 
                     32: #include "b.h"
                     33: #include <stdio.h>
                     34: #define yyclearin yychar = -1
                     35: #define yyerrok yyerrflag = 0
                     36: extern int yychar;
                     37: extern short yyerrflag;
                     38: #ifndef YYMAXDEPTH
                     39: #define YYMAXDEPTH 150
                     40: #endif
                     41: #ifndef YYSTYPE
                     42: #define YYSTYPE int
                     43: #endif
                     44: YYSTYPE yylval, yyval;
                     45: 
                     46: # line 27 "beauty.y"
                     47: struct node *t;
                     48: # define YYERRCODE 256
                     49: 
                     50: # line 232 "beauty.y"
                     51: 
                     52: #define ASSERT(X,Y)    if (!(X)) error("struct bug: assertion 'X' invalid in routine Y","","");
                     53: 
                     54: yyerror(s)
                     55: char *s;
                     56:        {
                     57:        extern int yychar;
                     58:        fprintf(stderr,"\n%s",s);
                     59:        fprintf(stderr," in beautifying, output line %d,",xxlineno + 1);
                     60:        fprintf(stderr," on input: ");
                     61:                switch (yychar) {
                     62:                        case '\t': fprintf(stderr,"\\t\n"); return;
                     63:                        case '\n': fprintf(stderr,"\\n\n"); return;
                     64:                        case '\0': fprintf(stderr,"$end\n"); return;
                     65:                        default: fprintf(stderr,"%c\n",yychar); return;
                     66:                        }
                     67:        }
                     68: 
                     69: yyinit(argc, argv)                     /* initialize pushdown store */
                     70: int argc;
                     71: char *argv[];
                     72:        {
                     73:        xxindent = 0;
                     74:        xxbpertab = 8;
                     75:        xxmaxchars = 120;
                     76:        }
                     77: 
                     78: 
                     79: #include <signal.h>
                     80: main()
                     81:        {
                     82:        int exit();
                     83:        if ( signal(SIGINT, SIG_IGN) != SIG_IGN)
                     84:                signal(SIGINT, exit);
                     85:        yyinit();
                     86:        yyparse();
                     87:        }
                     88: 
                     89: 
                     90: putout(type,string)                    /* output string with proper indentation */
                     91: int type;
                     92: char *string;
                     93:        {
                     94:        static int lasttype;
                     95:        if ( (lasttype != 0) && (lasttype != '\n') && (lasttype != ' ') && (lasttype != '\t') && (type == xxcom))
                     96:                accum("\t");
                     97:        else if (lasttype == xxcom && type != '\n')
                     98:                tab(xxindent);
                     99:        else
                    100:                if (lasttype == xxif    ||
                    101:                        lasttype == xxwhile     ||
                    102:                        lasttype == xxdo        ||
                    103:                        type == '='     ||
                    104:                        lasttype == '=' ||
                    105:                        (lasttype == xxident && (type == xxident || type == xxnum) )    ||
                    106:                        (lasttype == xxnum && type == xxnum) )
                    107:                        accum(" ");
                    108:        accum(string);
                    109:        lasttype = type;
                    110:        }
                    111: 
                    112: 
                    113: accum(token)           /* fill output buffer, generate continuation lines */
                    114: char *token;
                    115:        {
                    116:        static char *buffer;
                    117:        static int lstatus,llen,bufind;
                    118:        int tstatus,tlen,i;
                    119: 
                    120: #define NEW    0
                    121: #define MID    1
                    122: #define CONT   2
                    123: 
                    124:        if (buffer == 0)
                    125:                {
                    126:                buffer = malloc(xxmaxchars);
                    127:                if (buffer == 0) error("malloc out of space","","");
                    128:                }
                    129:        tlen = slength(token);
                    130:        if (tlen == 0) return;
                    131:        for (i = 0; i < tlen; ++i)
                    132:                ASSERT(token[i] != '\n' || tlen == 1,accum);
                    133:        switch(token[tlen-1])
                    134:                {
                    135:                case '\n':      tstatus = NEW;
                    136:                                break;
                    137:                case '+':
                    138:                case '-':
                    139:                case '*':
                    140:                case ',':
                    141:                case '|':
                    142:                case '&':
                    143:                case '(':       tstatus = CONT;
                    144:                                break;
                    145:                default:        tstatus = MID;
                    146:                }
                    147:        if (llen + bufind + tlen > xxmaxchars && lstatus == CONT && tstatus != NEW)
                    148:                {
                    149:                putchar('\n');
                    150:                ++xxlineno;
                    151:                for (i = 0; i < xxindent; ++i)
                    152:                        putchar('\t');
                    153:                putchar(' ');putchar(' ');
                    154:                llen = 2 + xxindent * xxbpertab;
                    155:                lstatus = NEW;
                    156:                }
                    157:        if (lstatus == CONT && tstatus == MID)
                    158:                {                       /* store in buffer in case need \n after last CONT char */
                    159:                ASSERT(bufind + tlen < xxmaxchars,accum);
                    160:                for (i = 0; i < tlen; ++i)
                    161:                        buffer[bufind++] = token[i];
                    162:                }
                    163:        else
                    164:                {
                    165:                for (i = 0; i < bufind; ++i)
                    166:                        putchar(buffer[i]);
                    167:                llen += bufind;
                    168:                bufind = 0;
                    169:                for (i = 0; i < tlen; ++i)
                    170:                        putchar(token[i]);
                    171:                if (tstatus == NEW) ++xxlineno;
                    172:                llen = (tstatus == NEW) ? 0 : llen + tlen;
                    173:                lstatus = tstatus;
                    174:                }
                    175:        }
                    176: 
                    177: tab(n)
                    178: int n;
                    179:        {
                    180:        int i;
                    181:        newline();
                    182:        for ( i = 0;  i < n; ++i)
                    183:                putout('\t',"\t");
                    184:        }
                    185: 
                    186: newline()
                    187:        {
                    188:        static int already;
                    189:        if (already)
                    190:                putout('\n',"\n");
                    191:        else
                    192:                already = 1;
                    193:        }
                    194: 
                    195: error(mess1, mess2, mess3)
                    196: char *mess1, *mess2, *mess3;
                    197:        {
                    198:        fprintf(stderr,"\nerror in beautifying, output line %d: %s %s %s \n",
                    199:                xxlineno, mess1, mess2, mess3);
                    200:        exit(1);
                    201:        }
                    202: 
                    203: 
                    204: 
                    205: 
                    206: 
                    207: 
                    208: 
                    209: push(type)
                    210: int type;
                    211:        {
                    212:        if (++xxstind > xxtop)
                    213:                error("nesting too deep, stack overflow","","");
                    214:        xxstack[xxstind] = type;
                    215:        }
                    216: 
                    217: pop()
                    218:        {
                    219:        if (xxstind <= 0)
                    220:                error("stack exhausted, can't be popped as requested","","");
                    221:        --xxstind;
                    222:        }
                    223: 
                    224: 
                    225: forst()
                    226:        {
                    227:        while( (xxval = yylex()) != '\n')
                    228:                {
                    229:                putout(xxval, yylval);
                    230:                free(yylval);
                    231:                }
                    232:        free(yylval);
                    233:        }
                    234: short yyexca[] ={
                    235: -1, 0,
                    236:        312, 17,
                    237:        -2, 16,
                    238: -1, 1,
                    239:        0, -1,
                    240:        -2, 0,
                    241: -1, 2,
                    242:        0, 18,
                    243:        312, 17,
                    244:        -2, 16,
                    245: -1, 6,
                    246:        312, 17,
                    247:        -2, 16,
                    248: -1, 7,
                    249:        312, 17,
                    250:        -2, 16,
                    251: -1, 29,
                    252:        312, 17,
                    253:        -2, 16,
                    254: -1, 36,
                    255:        312, 17,
                    256:        -2, 16,
                    257: -1, 46,
                    258:        322, 16,
                    259:        -2, 65,
                    260: -1, 93,
                    261:        308, 0,
                    262:        309, 0,
                    263:        310, 0,
                    264:        324, 0,
                    265:        60, 0,
                    266:        62, 0,
                    267:        -2, 51,
                    268: -1, 94,
                    269:        308, 0,
                    270:        309, 0,
                    271:        310, 0,
                    272:        324, 0,
                    273:        60, 0,
                    274:        62, 0,
                    275:        -2, 52,
                    276: -1, 95,
                    277:        308, 0,
                    278:        309, 0,
                    279:        310, 0,
                    280:        324, 0,
                    281:        60, 0,
                    282:        62, 0,
                    283:        -2, 53,
                    284: -1, 96,
                    285:        308, 0,
                    286:        309, 0,
                    287:        310, 0,
                    288:        324, 0,
                    289:        60, 0,
                    290:        62, 0,
                    291:        -2, 54,
                    292: -1, 97,
                    293:        308, 0,
                    294:        309, 0,
                    295:        310, 0,
                    296:        324, 0,
                    297:        60, 0,
                    298:        62, 0,
                    299:        -2, 55,
                    300: -1, 98,
                    301:        308, 0,
                    302:        309, 0,
                    303:        310, 0,
                    304:        324, 0,
                    305:        60, 0,
                    306:        62, 0,
                    307:        -2, 56,
                    308: -1, 104,
                    309:        312, 17,
                    310:        -2, 16,
                    311: -1, 110,
                    312:        312, 17,
                    313:        125, 23,
                    314:        -2, 16,
                    315: -1, 126,
                    316:        312, 17,
                    317:        -2, 16,
                    318: -1, 130,
                    319:        312, 17,
                    320:        320, 21,
                    321:        323, 21,
                    322:        125, 21,
                    323:        -2, 16,
                    324: -1, 132,
                    325:        312, 17,
                    326:        320, 21,
                    327:        323, 21,
                    328:        125, 21,
                    329:        -2, 16,
                    330: -1, 133,
                    331:        312, 17,
                    332:        320, 21,
                    333:        323, 21,
                    334:        125, 21,
                    335:        -2, 16,
                    336:        };
                    337: # define YYNPROD 76
                    338: # define YYLAST 384
                    339: short yyact[]={
                    340: 
                    341:   66,  31, 103,  55,  62,  60, 113,  61,  66,  63,
                    342:   11,  40,  62,  60, 107,  61, 119,  63,  38, 120,
                    343:   34,  44,  68,  39,  67,  11,  11,  31,  57,  31,
                    344:   68,  66,  67,  85,  99,  62,  60,  11,  61,  66,
                    345:   63, 110,  59,  62,  60, 109,  61, 100,  63,   8,
                    346:    2,  64,  82,  68,   6,  67,  64,  29, 131,  30,
                    347:   33,  68, 127,  67,  64,  36,  66,  51, 106,  16,
                    348:   62,  60,  76,  61,  66,  63,  50,  24,  62,  60,
                    349:   62,  61,  41,  63, 102,  63,  65,  64,  68, 118,
                    350:   67, 124, 117,   7,  65,  64,  68,   3,  67,   5,
                    351:   14,  62,  60,  21,  61,  32,  63,  22,  23,  28,
                    352:   48,  52,  27,  83,  80,  15,  20,  65,  19,  68,
                    353:   78,  67,  64,  18,  26,  65,  25,  14,  35,  53,
                    354:   64,  54,  64,  45,  58, 104,  49,  62,  60,  17,
                    355:   61,  56,  63,   9,   4,  13,  79,  46,  47,   1,
                    356:    0,   0,  65,  64, 112, 114, 116, 129,   9,   9,
                    357:  112,   0,   0, 128, 134, 125, 135, 136,   0,   0,
                    358:    0, 112,   0, 121,  77, 123, 101, 132,  22,  23,
                    359:   28, 133,   0,  27, 126,  84,   0,  10,   0,  64,
                    360:  130,   0,   0,  37,   0,  26,   0,  25,  12,  55,
                    361:    0,   0,  10,  10, 111,   0,   0,   0,   0, 115,
                    362:  111,   0,   0,  12,  12,  73,  74,  75, 108,   0,
                    363:    0, 111,   0,   0,   0,   0,   0,   0,  81,   0,
                    364:   14,  14,   0,   0,   0,   0,   0,  86,  87,  88,
                    365:   89,  90,  91,  92,  93,  94,  95,  96,  97,  98,
                    366:    0,   0,   0,   0,   0,   0,   0,   0,   0, 105,
                    367:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    368:   70,  71,  72,   0,   0,   0,   0,   0,  70,  71,
                    369:   72,   0,   0,   0,   0,  44,  69,   0,   0,  42,
                    370:  122,  43,   0,   0,  69,   0,   0,   0,   0,   0,
                    371:    0,  70,  71,  72,   0,   0,   0,   0,   0,  70,
                    372:   71,  72,   0,   0,   0,   0,   0,  69,   0,   0,
                    373:    0,   0,   0,   0,   0,  69,   0,   0,   0,   0,
                    374:    0,   0,   0,   0,   0,   0,  70,  71,  72,   0,
                    375:    0,   0,   0,   0,  70,  71,  72,   0,   0,   0,
                    376:    0,   0,  69,   0,   0,   0,   0,   0,   0,   0,
                    377:   69,   0,   0,   0,   0,   0,   0,  70,  71,  72,
                    378:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    379:    0,   0,   0,  69 };
                    380: short yypact[]={
                    381: 
                    382:  -97,-1000, -97,-1000,  29,-195, -98, -97,-292,-1000,
                    383: -1000,-1000,-1000,-1000,-1000,-1000, -22,  29,-1000,-1000,
                    384:   29,-1000,-1000,-1000,  23,-1000,-1000,-1000,-286, -97,
                    385: -1000,-1000,-1000,-113,-1000,-273, -97,   1, -22, -22,
                    386:  -22,-1000,-1000,-1000,  32,-1000,-1000,-1000,-1000,-1000,
                    387: -1000, -22,  -9,-124,-1000,-1000,-1000,-1000,-1000,-1000,
                    388:  -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
                    389:  -22, -22, -22,  -7, -43,  59, -22,-1000,-1000,-320,
                    390:  -86,  28, -22,-1000,-1000,-1000,  38,  38, -43, -43,
                    391:  -43,  36,  59,  95,  95,  95,  95,  95,  95,-1000,
                    392:   27, -30,  29,-1000,-1000, -38,-1000, -22,-1000,-1000,
                    393: -1000,-304,-292, -22,-1000, -96,-1000, -22,-1000,-1000,
                    394:    4,-309,  28,-1000,-1000,   0, -97,-1000,-1000,-1000,
                    395:  -97,-1000, -97, -97,-1000,-1000,-1000 };
                    396: short yypgo[]={
                    397: 
                    398:    0, 149,  50, 145,  97, 144, 115, 128, 141,  99,
                    399:  139, 123, 120, 118, 116, 110,  65,  54,  45,  59,
                    400:   33, 103,  93,  49,  60,  41,  92,  91,  89,  82,
                    401:   47, 176,  84,  77,  76 };
                    402: short yyr1[]={
                    403: 
                    404:    0,   1,   2,   2,   4,   4,   4,   4,   4,   4,
                    405:    4,   4,   4,   4,   4,   4,   9,  23,   3,   7,
                    406:   16,  20,  18,  18,  25,  25,  25,  25,  26,  28,
                    407:   14,  21,  21,  29,  29,  27,  30,  30,  15,  15,
                    408:    6,  31,  31,  31,  31,  31,  31,  31,  31,  31,
                    409:   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,
                    410:    5,   8,  10,  11,  12,  12,  32,  13,  33,  34,
                    411:   34,  17,  19,  22,  24,  24 };
                    412: short yyr2[]={
                    413: 
                    414:    0,   2,   1,   2,   5,   3,   4,   4,   3,   9,
                    415:    2,   4,   2,   2,   3,   1,   0,   0,   0,   3,
                    416:    0,   0,   2,   1,   6,   5,   5,   3,   1,   2,
                    417:    1,   1,   1,   4,   1,   2,   3,   1,   1,   0,
                    418:    3,   3,   2,   2,   3,   3,   3,   3,   3,   3,
                    419:    3,   3,   3,   3,   3,   3,   3,   1,   1,   1,
                    420:    1,   1,   1,   1,   3,   0,   1,   2,   6,   2,
                    421:    0,   1,   1,   1,   1,   2 };
                    422: short yychk[]={
                    423: 
                    424: -1000,  -1,  -2,  -4,  -5,  -9, -17, -22, -23, 256,
                    425:  300, 123, 311,  -3,  -4,  -6,  40, -10, -11, -13,
                    426:  -14, -21, 302, 303, -33, 321, 319, 307, 304,  -2,
                    427:  -19, 125,  -4, -24, 312,  -7, -16, -31,  40,  45,
                    428:   33, -29, 311, 313, 307,  -6,  -7,  -7, -15,  -6,
                    429:  -34,  44, -29,  -9,  -4, 312,  -8, 301,  -4,  41,
                    430:   43,  45,  42,  47,  94, 124,  38,  62,  60, 324,
                    431:  308, 309, 310, -31, -31, -31,  40,  -7, -12,  -9,
                    432:  -16, -31,  61, -19,  -7, -20, -31, -31, -31, -31,
                    433:  -31, -31, -31, -31, -31, -31, -31, -31, -31,  41,
                    434:  -30, -31, -32, 322, -17, -31,  41,  44,  -6, -18,
                    435:  -25,  -9, -23,  44, -30,  -9, -18, -26, -28, 320,
                    436:  323, -24, -31, -19, -27, -30, -16,  58, -25, -20,
                    437:  -16,  58,  -2,  -2, -20, -20, -20 };
                    438: short yydef[]={
                    439: 
                    440:   -2,  -2,  -2,   2,   0,   0,  -2,  -2,   0,  15,
                    441:   60,  71,  73,   1,   3,  20,   0,   0,  20,  20,
                    442:   39,  10,  62,  63,  70,  30,  31,  32,   0,  -2,
                    443:   12,  72,  13,  16,  74,   5,  -2,   0,   0,   0,
                    444:    0,  57,  58,  59,  34,  20,  -2,   8,  20,  38,
                    445:   67,   0,   0,   0,  14,  75,  20,  61,  21,  40,
                    446:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                    447:    0,   0,   0,   0,  42,  43,   0,   6,   7,   0,
                    448:    0,  69,   0,  11,   4,  19,  44,  45,  46,  47,
                    449:   48,  49,  50,  -2,  -2,  -2,  -2,  -2,  -2,  41,
                    450:    0,  37,   0,  66,  -2,   0,  33,   0,  64,  16,
                    451:   -2,   0,   0,   0,  36,   0,  22,   0,  20,  28,
                    452:    0,  16,  68,  21,  20,   0,  -2,  29,  27,   9,
                    453:   -2,  35,  -2,  -2,  25,  26,  24 };
                    454: #ifndef lint
                    455: static char yaccpar_sccsid[] = "@(#)yaccpar    4.1     (Berkeley)      2/11/83";
                    456: #endif not lint
                    457: 
                    458: #
                    459: # define YYFLAG -1000
                    460: # define YYERROR goto yyerrlab
                    461: # define YYACCEPT return(0)
                    462: # define YYABORT return(1)
                    463: 
                    464: /*     parser for yacc output  */
                    465: 
                    466: #ifdef YYDEBUG
                    467: int yydebug = 0; /* 1 for debugging */
                    468: #endif
                    469: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
                    470: int yychar = -1; /* current input token number */
                    471: int yynerrs = 0;  /* number of errors */
                    472: short yyerrflag = 0;  /* error recovery flag */
                    473: 
                    474: yyparse() {
                    475: 
                    476:        short yys[YYMAXDEPTH];
                    477:        short yyj, yym;
                    478:        register YYSTYPE *yypvt;
                    479:        register short yystate, *yyps, yyn;
                    480:        register YYSTYPE *yypv;
                    481:        register short *yyxi;
                    482: 
                    483:        yystate = 0;
                    484:        yychar = -1;
                    485:        yynerrs = 0;
                    486:        yyerrflag = 0;
                    487:        yyps= &yys[-1];
                    488:        yypv= &yyv[-1];
                    489: 
                    490:  yystack:    /* put a state and value onto the stack */
                    491: 
                    492: #ifdef YYDEBUG
                    493:        if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
                    494: #endif
                    495:                if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
                    496:                *yyps = yystate;
                    497:                ++yypv;
                    498:                *yypv = yyval;
                    499: 
                    500:  yynewstate:
                    501: 
                    502:        yyn = yypact[yystate];
                    503: 
                    504:        if( yyn<= YYFLAG ) goto yydefault; /* simple state */
                    505: 
                    506:        if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
                    507:        if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
                    508: 
                    509:        if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
                    510:                yychar = -1;
                    511:                yyval = yylval;
                    512:                yystate = yyn;
                    513:                if( yyerrflag > 0 ) --yyerrflag;
                    514:                goto yystack;
                    515:                }
                    516: 
                    517:  yydefault:
                    518:        /* default state action */
                    519: 
                    520:        if( (yyn=yydef[yystate]) == -2 ) {
                    521:                if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
                    522:                /* look through exception table */
                    523: 
                    524:                for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
                    525: 
                    526:                while( *(yyxi+=2) >= 0 ){
                    527:                        if( *yyxi == yychar ) break;
                    528:                        }
                    529:                if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
                    530:                }
                    531: 
                    532:        if( yyn == 0 ){ /* error */
                    533:                /* error ... attempt to resume parsing */
                    534: 
                    535:                switch( yyerrflag ){
                    536: 
                    537:                case 0:   /* brand new error */
                    538: 
                    539:                        yyerror( "syntax error" );
                    540:                yyerrlab:
                    541:                        ++yynerrs;
                    542: 
                    543:                case 1:
                    544:                case 2: /* incompletely recovered error ... try again */
                    545: 
                    546:                        yyerrflag = 3;
                    547: 
                    548:                        /* find a state where "error" is a legal shift action */
                    549: 
                    550:                        while ( yyps >= yys ) {
                    551:                           yyn = yypact[*yyps] + YYERRCODE;
                    552:                           if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
                    553:                              yystate = yyact[yyn];  /* simulate a shift of "error" */
                    554:                              goto yystack;
                    555:                              }
                    556:                           yyn = yypact[*yyps];
                    557: 
                    558:                           /* the current yyps has no shift onn "error", pop stack */
                    559: 
                    560: #ifdef YYDEBUG
                    561:                           if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
                    562: #endif
                    563:                           --yyps;
                    564:                           --yypv;
                    565:                           }
                    566: 
                    567:                        /* there is no state on the stack with an error shift ... abort */
                    568: 
                    569:        yyabort:
                    570:                        return(1);
                    571: 
                    572: 
                    573:                case 3:  /* no shift yet; clobber input char */
                    574: 
                    575: #ifdef YYDEBUG
                    576:                        if( yydebug ) printf( "error recovery discards char %d\n", yychar );
                    577: #endif
                    578: 
                    579:                        if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
                    580:                        yychar = -1;
                    581:                        goto yynewstate;   /* try again in the same state */
                    582: 
                    583:                        }
                    584: 
                    585:                }
                    586: 
                    587:        /* reduction by production yyn */
                    588: 
                    589: #ifdef YYDEBUG
                    590:                if( yydebug ) printf("reduce %d\n",yyn);
                    591: #endif
                    592:                yyps -= yyr2[yyn];
                    593:                yypvt = yypv;
                    594:                yypv -= yyr2[yyn];
                    595:                yyval = yypv[1];
                    596:                yym=yyn;
                    597:                        /* consult goto table to find next state */
                    598:                yyn = yyr1[yyn];
                    599:                yyj = yypgo[yyn] + *yyps + 1;
                    600:                if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
                    601:                switch(yym){
                    602:                        
                    603: case 16:
                    604: # line 53 "beauty.y"
                    605:        {
                    606:                        if (!xxlablast) tab(xxindent);
                    607:                        xxlablast = 0;
                    608:                        } break;
                    609: case 17:
                    610: # line 58 "beauty.y"
                    611:        newline(); break;
                    612: case 18:
                    613: # line 59 "beauty.y"
                    614:        putout('\n',"\n"); break;
                    615: case 20:
                    616: # line 61 "beauty.y"
                    617: 
                    618:                                {
                    619:                                if (xxstack[xxstind] != xxlb)
                    620:                                        ++xxindent;
                    621:                                } break;
                    622: case 21:
                    623: # line 66 "beauty.y"
                    624: 
                    625:                                {if (xxstack[xxstind] != xxlb && xxstack[xxstind] != xxelseif)
                    626:                                        --xxindent;
                    627:                                pop();
                    628:                                } break;
                    629: case 28:
                    630: # line 81 "beauty.y"
                    631:        {putout(xxcase,"case "); free (yypvt[-0]); push(xxcase); } break;
                    632: case 29:
                    633: # line 84 "beauty.y"
                    634:                {
                    635:                                                putout(xxcase,"default");
                    636:                                                free(yypvt[-1]);
                    637:                                                putout(':',":");
                    638:                                                free(yypvt[-0]);
                    639:                                                push(xxcase);
                    640:                                                } break;
                    641: case 30:
                    642: # line 91 "beauty.y"
                    643:        {putout(xxswitch,"switch"); free(yypvt[-0]); push(xxswitch); } break;
                    644: case 31:
                    645: # line 93 "beauty.y"
                    646:        {
                    647:                                free(yypvt[-0]);
                    648:                                putout(xxident,"end");
                    649:                                putout('\n',"\n");
                    650:                                putout('\n',"\n");
                    651:                                putout('\n',"\n");
                    652:                                } break;
                    653: case 32:
                    654: # line 100 "beauty.y"
                    655:        {
                    656:                                putout(xxident,yypvt[-0]);
                    657:                                free(yypvt[-0]);
                    658:                                newflag = 1;
                    659:                                forst();
                    660:                                newflag = 0;
                    661:                                } break;
                    662: case 33:
                    663: # line 110 "beauty.y"
                    664:        {
                    665:                                xxt = addroot(yypvt[-3],xxident,0,0);
                    666:                                yyval = addroot("",xxidpar,xxt,yypvt[-1]);
                    667:                                } break;
                    668: case 34:
                    669: # line 115 "beauty.y"
                    670:        yyval = addroot(yypvt[-0],xxident,0,0); break;
                    671: case 35:
                    672: # line 118 "beauty.y"
                    673:        {
                    674:                                yield(yypvt[-1],0);
                    675:                                putout(':',":");
                    676:                                freetree(yypvt[-1]);
                    677:                                } break;
                    678: case 36:
                    679: # line 123 "beauty.y"
                    680:        yyval = addroot(yypvt[-1],xxexplist,checkneg(yypvt[-2],0),yypvt[-0]); break;
                    681: case 37:
                    682: # line 124 "beauty.y"
                    683:        yyval = checkneg(yypvt[-0],0); break;
                    684: case 40:
                    685: # line 132 "beauty.y"
                    686:        { t = checkneg(yypvt[-1],0);
                    687:                                yield(t,100);  freetree(t);     } break;
                    688: case 41:
                    689: # line 135 "beauty.y"
                    690:        yyval = yypvt[-1]; break;
                    691: case 42:
                    692: # line 136 "beauty.y"
                    693:        yyval = addroot(yypvt[-1],xxuminus,yypvt[-0],0); break;
                    694: case 43:
                    695: # line 137 "beauty.y"
                    696:        yyval = addroot(yypvt[-1],'!',yypvt[-0],0); break;
                    697: case 44:
                    698: # line 138 "beauty.y"
                    699:        yyval = addroot(yypvt[-1],'+',yypvt[-2],yypvt[-0]); break;
                    700: case 45:
                    701: # line 139 "beauty.y"
                    702:        yyval = addroot(yypvt[-1],'-',yypvt[-2],yypvt[-0]); break;
                    703: case 46:
                    704: # line 140 "beauty.y"
                    705:        yyval = addroot(yypvt[-1],'*',yypvt[-2],yypvt[-0]); break;
                    706: case 47:
                    707: # line 141 "beauty.y"
                    708:        yyval = addroot(yypvt[-1],'/',yypvt[-2],yypvt[-0]); break;
                    709: case 48:
                    710: # line 142 "beauty.y"
                    711:        yyval = addroot(yypvt[-1],'^',yypvt[-2],yypvt[-0]); break;
                    712: case 49:
                    713: # line 143 "beauty.y"
                    714:        yyval = addroot(yypvt[-1],'|',yypvt[-2],yypvt[-0]); break;
                    715: case 50:
                    716: # line 144 "beauty.y"
                    717:        yyval = addroot(yypvt[-1],'&',yypvt[-2],yypvt[-0]); break;
                    718: case 51:
                    719: # line 145 "beauty.y"
                    720:        yyval = addroot(yypvt[-1],'>',yypvt[-2],yypvt[-0]); break;
                    721: case 52:
                    722: # line 146 "beauty.y"
                    723:        yyval = addroot(yypvt[-1],'<',yypvt[-2],yypvt[-0]); break;
                    724: case 53:
                    725: # line 147 "beauty.y"
                    726:        yyval = addroot(yypvt[-1],xxeq,yypvt[-2],yypvt[-0]); break;
                    727: case 54:
                    728: # line 148 "beauty.y"
                    729:        yyval = addroot(yypvt[-1],xxle,yypvt[-2],yypvt[-0]); break;
                    730: case 55:
                    731: # line 149 "beauty.y"
                    732:        yyval = addroot(yypvt[-1],xxge,yypvt[-2],yypvt[-0]); break;
                    733: case 56:
                    734: # line 150 "beauty.y"
                    735:        yyval = addroot(yypvt[-1],xxne,yypvt[-2],yypvt[-0]); break;
                    736: case 57:
                    737: # line 151 "beauty.y"
                    738:        yyval = yypvt[-0]; break;
                    739: case 58:
                    740: # line 152 "beauty.y"
                    741:        yyval = addroot(yypvt[-0],xxnum,0,0); break;
                    742: case 59:
                    743: # line 153 "beauty.y"
                    744:        yyval = addroot(yypvt[-0],xxstring,0,0); break;
                    745: case 60:
                    746: # line 156 "beauty.y"
                    747: 
                    748:                                {
                    749:                                if (xxstack[xxstind] == xxelse && !xxlablast)
                    750:                                        {
                    751:                                        --xxindent;
                    752:                                        xxstack[xxstind] = xxelseif;
                    753:                                        putout(' '," ");
                    754:                                        }
                    755:                                else
                    756:                                        {
                    757:                                        if (!xxlablast)
                    758:                                                tab(xxindent);
                    759:                                        xxlablast = 0;
                    760:                                        }
                    761:                                putout(xxif,"if");
                    762:                                free(yypvt[-0]);
                    763:                                push(xxif);
                    764:                                } break;
                    765: case 61:
                    766: # line 174 "beauty.y"
                    767: 
                    768:                                {
                    769:                                tab(xxindent);
                    770:                                putout(xxelse,"else");
                    771:                                free(yypvt[-0]);
                    772:                                push(xxelse);
                    773:                                } break;
                    774: case 62:
                    775: # line 181 "beauty.y"
                    776:        {
                    777:                                putout(xxwhile,"while");
                    778:                                free(yypvt[-0]);
                    779:                                push(xxwhile);
                    780:                                } break;
                    781: case 63:
                    782: # line 186 "beauty.y"
                    783:                        {
                    784:                                        putout(xxrept,"repeat");
                    785:                                        free(yypvt[-0]);
                    786:                                        push(xxrept);
                    787:                                        } break;
                    788: case 66:
                    789: # line 195 "beauty.y"
                    790:        {
                    791:                        putout('\t',"\t");
                    792:                        putout(xxuntil,"until");
                    793:                        free(yypvt[-0]);
                    794:                        } break;
                    795: case 68:
                    796: # line 202 "beauty.y"
                    797: 
                    798:                                        {push(xxdo);
                    799:                                        putout(xxdo,"do");
                    800:                                        free(yypvt[-5]);
                    801:                                        puttree(yypvt[-4]);
                    802:                                        putout('=',"=");
                    803:                                        free(yypvt[-3]);
                    804:                                        puttree(yypvt[-2]);
                    805:                                        putout(',',",");
                    806:                                        free(yypvt[-1]);
                    807:                                        puttree(yypvt[-0]);
                    808:                                        } break;
                    809: case 69:
                    810: # line 214 "beauty.y"
                    811:        {
                    812:                                                putout(',',",");
                    813:                                                puttree(yypvt[-0]);
                    814:                                                } break;
                    815: case 71:
                    816: # line 219 "beauty.y"
                    817:        {
                    818:                                putout('{'," {");
                    819:                                push(xxlb);
                    820:                                } break;
                    821: case 72:
                    822: # line 223 "beauty.y"
                    823:        { putout('}',"}");  pop();   } break;
                    824: case 73:
                    825: # line 224 "beauty.y"
                    826:        {
                    827:                                tab(xxindent);
                    828:                                putout(xxnum,yypvt[-0]);
                    829:                                putout(' ',"  ");
                    830:                                xxlablast = 1;
                    831:                                } break;
                    832: case 74:
                    833: # line 230 "beauty.y"
                    834:        { putout(xxcom,yypvt[-0]);  free(yypvt[-0]);  xxlablast = 0; } break;
                    835: case 75:
                    836: # line 231 "beauty.y"
                    837:  { putout ('\n',"\n"); putout(xxcom,yypvt[-0]);  free(yypvt[-0]);  xxlablast = 0; } break;
                    838:                }
                    839:                goto yystack;  /* stack new state and value */
                    840: 
                    841:        }

unix.superglobalmegacorp.com

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