Annotation of researchv9/sys/conf/src/config/y.tab.c, revision 1.1

1.1     ! root        1: 
        !             2: # line 1 "config.y"
        !             3: typedef union  {
        !             4:        int i;
        !             5:        char *cp;
        !             6:        struct idlst *idlst;
        !             7: } YYSTYPE;
        !             8: # define CPU 257
        !             9: # define IDENT 258
        !            10: # define CONFIG 259
        !            11: # define ANY 260
        !            12: # define DEVICE 261
        !            13: # define UBA 262
        !            14: # define MBA 263
        !            15: # define NEXUS 264
        !            16: # define CSR 265
        !            17: # define DRIVE 266
        !            18: # define VECTOR 267
        !            19: # define OPTIONS 268
        !            20: # define CONTROLLER 269
        !            21: # define PSEUDO_DEVICE 270
        !            22: # define FLAGS 271
        !            23: # define ID 272
        !            24: # define SEMICOLON 273
        !            25: # define NUMBER 274
        !            26: # define FPNUMBER 275
        !            27: # define TRACE 276
        !            28: # define DISK 277
        !            29: # define SLAVE 278
        !            30: # define AT 279
        !            31: # define HZ 280
        !            32: # define TIMEZONE 281
        !            33: # define DST 282
        !            34: # define MAXUSERS 283
        !            35: # define MASTER 284
        !            36: # define MAKEFILE 285
        !            37: # define COMMA 286
        !            38: # define MINUS 287
        !            39: # define MACHINE 288
        !            40: # define PRIORITY 289
        !            41: # define VME16D16 290
        !            42: # define VME24D16 291
        !            43: # define VME32D16 292
        !            44: # define VME16D32 293
        !            45: # define VME24D32 294
        !            46: # define VME32D32 295
        !            47: 
        !            48: # line 15 "config.y"
        !            49: /*     config.y        1.11    81/05/22        */
        !            50: #include "config.h"
        !            51: #include <stdio.h>
        !            52:        struct device cur;
        !            53:        struct device *curp = NULL;
        !            54:        char *temp_id;
        !            55: #define yyclearin yychar = -1
        !            56: #define yyerrok yyerrflag = 0
        !            57: extern int yychar;
        !            58: extern short yyerrflag;
        !            59: #ifndef YYMAXDEPTH
        !            60: #define YYMAXDEPTH 150
        !            61: #endif
        !            62: YYSTYPE yylval, yyval;
        !            63: # define YYERRCODE 256
        !            64: 
        !            65: # line 255 "config.y"
        !            66: 
        !            67: 
        !            68: yyerror(s)
        !            69: char *s;
        !            70: {
        !            71:        fprintf(stderr, "config: %s at line %d\n", s, yyline);
        !            72: }
        !            73: 
        !            74: /*
        !            75:  * ns:
        !            76:  *     Return the passed string in a new space
        !            77:  */
        !            78: 
        !            79: char *
        !            80: ns(str)
        !            81: register char *str;
        !            82: {
        !            83:        register char *cp;
        !            84: 
        !            85:        cp = malloc(strlen(str)+1);
        !            86:        strcpy(cp, str);
        !            87:        return cp;
        !            88: }
        !            89: 
        !            90: /*
        !            91:  * newdev
        !            92:  *     Add a device to the list
        !            93:  */
        !            94: 
        !            95: newdev(dp)
        !            96: register struct device *dp;
        !            97: {
        !            98:        register struct device *np;
        !            99: 
        !           100:        np = (struct device *) malloc(sizeof *np);
        !           101:        *np = *dp;
        !           102:        if (curp == NULL)
        !           103:                dtab = np;
        !           104:        else
        !           105:                curp->d_next = np;
        !           106:        curp = np;
        !           107: }
        !           108: 
        !           109: /*
        !           110:  * mkconf
        !           111:  *     Note that a configuration should be made
        !           112:  */
        !           113: 
        !           114: mkconf(dev, sysname)
        !           115: char *dev, *sysname;
        !           116: {
        !           117:        register struct file_list *fl;
        !           118: 
        !           119:        fl = (struct file_list *) malloc(sizeof *fl);
        !           120:        fl->f_fn = ns(dev);
        !           121:        fl->f_needs = ns(sysname);
        !           122:        if (confp == NULL)
        !           123:            conf_list = fl;
        !           124:        else
        !           125:            confp->f_next = fl;
        !           126:        confp = fl;
        !           127: }
        !           128: 
        !           129: /*
        !           130:  * Connect:
        !           131:  *     Find the pointer to connect to the given device and number.
        !           132:  *     returns NULL if no such device and prints an error message
        !           133:  */
        !           134: 
        !           135: struct device *connect(dev, num)
        !           136: register char *dev;
        !           137: register int num;
        !           138: {
        !           139:        register struct device *dp;
        !           140:        struct device *huhcon();
        !           141: 
        !           142:        if (num == QUES)
        !           143:            return huhcon(dev);
        !           144:        for (dp = dtab; dp != NULL; dp = dp->d_next)
        !           145:                if ((num == dp->d_unit) && eq(dev, dp->d_name))
        !           146:                    if (dp->d_type != CONTROLLER && dp->d_type != MASTER)
        !           147:                    {
        !           148:                        sprintf(errbuf, "%s connected to non-controller", dev);
        !           149:                        yyerror(errbuf);
        !           150:                        return NULL;
        !           151:                    }
        !           152:                    else
        !           153:                        return dp;
        !           154:        sprintf(errbuf, "%s %d not defined", dev, num);
        !           155:        yyerror(errbuf);
        !           156:        return NULL;
        !           157: }
        !           158: 
        !           159: /*
        !           160:  * huhcon
        !           161:  *     Connect to an unspecific thing
        !           162:  */
        !           163: 
        !           164: struct device *huhcon(dev)
        !           165: register char *dev;
        !           166: {
        !           167:     register struct device *dp, *dcp;
        !           168:     struct device rdev;
        !           169:     int oldtype;
        !           170: 
        !           171:     /*
        !           172:      * First make certain that there are some of these to wildcard on
        !           173:      */
        !           174:     for (dp = dtab; dp != NULL; dp = dp->d_next)
        !           175:        if (eq(dp->d_name, dev))
        !           176:            break;
        !           177:     if (dp == NULL)
        !           178:     {
        !           179:        sprintf(errbuf, "no %s's to wildcard", dev);
        !           180:        yyerror(errbuf);
        !           181:        return NULL;
        !           182:     }
        !           183:     oldtype = dp->d_type;
        !           184:     dcp = dp->d_conn;
        !           185:     /*
        !           186:      * Now see if there is already a wildcard entry for this device
        !           187:      * (e.g. Search for a "uba ?")
        !           188:      */
        !           189:     for (; dp != NULL; dp = dp->d_next)
        !           190:        if (eq(dev, dp->d_name) && dp->d_unit == -1)
        !           191:            break;
        !           192:     /*
        !           193:      * If there isn't, make one becuase everything needs to be connected
        !           194:      * to something.
        !           195:      */
        !           196:     if (dp == NULL)
        !           197:     {
        !           198:        dp = &rdev;
        !           199:        init_dev(dp);
        !           200:        dp->d_unit = QUES;
        !           201:        dp->d_name = ns(dev);
        !           202:        dp->d_type = oldtype;
        !           203:        newdev(dp);
        !           204:        dp = curp;
        !           205:        /*
        !           206:         * Connect it to the same thing that other similar things are
        !           207:         * connected to, but make sure it is a wildcard unit
        !           208:         * (e.g. up connected to sc ?, here we make connect sc? to a uba?)
        !           209:         * If other things like this are on the NEXUS or if the aren't
        !           210:         * connected to anything, then make the same connection, else
        !           211:         * call ourself to connect to another unspecific device.
        !           212:         */
        !           213:        if (dcp == TO_NEXUS || dcp == NULL)
        !           214:            dp->d_conn = dcp;
        !           215:        else
        !           216:            dp->d_conn = connect(dcp->d_name, QUES);
        !           217:     }
        !           218:     return dp;
        !           219: }
        !           220: 
        !           221: /*
        !           222:  * init_dev:
        !           223:  *     Set up the fields in the current device to their
        !           224:  *     default values.
        !           225:  */
        !           226: 
        !           227: init_dev(dp)
        !           228: register struct device *dp;
        !           229: {
        !           230:     dp->d_name = "OHNO!!!";
        !           231:     dp->d_type = DEVICE;
        !           232:     dp->d_conn = NULL;
        !           233:     dp->d_vec = NULL;
        !           234:     dp->d_addr = UNKNOWN;
        !           235:     dp->d_flags = dp->d_dk = 0;
        !           236:     dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN;
        !           237:     dp->d_count = 0;
        !           238:     dp->d_mach = dp->d_bus = 0;
        !           239:     dp->d_pri = 0;
        !           240: }
        !           241: 
        !           242: /*
        !           243:  * Check_nexus:
        !           244:  *     Make certain that this is a reasonable type of thing to put
        !           245:  *     on the nexus.
        !           246:  */
        !           247: 
        !           248: check_nexus(dev, num)
        !           249: register struct device *dev;
        !           250: int num;
        !           251: {
        !           252:        switch (machine) {
        !           253: 
        !           254:        case MACHINE_VAX:
        !           255:                if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba"))
        !           256:                        yyerror("only uba's and mba's should be connected to the nexus");
        !           257:                if (num != QUES)
        !           258:                        yyerror("can't give specific nexus numbers");
        !           259:                break;
        !           260: 
        !           261:        case MACHINE_SUN2:
        !           262:                if (!eq(dev->d_name, "virtual") &&
        !           263:                    !eq(dev->d_name, "obmem") &&
        !           264:                    !eq(dev->d_name, "obio") &&
        !           265:                    !eq(dev->d_name, "mbmem") &&
        !           266:                    !eq(dev->d_name, "mbio") &&
        !           267:                    !eq(dev->d_name, "vme16d16") &&
        !           268:                    !eq(dev->d_name, "vme24d16")) {
        !           269:                        (void)sprintf(errbuf,
        !           270:                            "unknown bus type `%s' for nexus connection on %s",
        !           271:                            dev->d_name, machinename);
        !           272:                        yyerror(errbuf);
        !           273:                }
        !           274:                break;
        !           275: 
        !           276:        case MACHINE_SUN3:
        !           277:                if (!eq(dev->d_name, "virtual") &&
        !           278:                    !eq(dev->d_name, "obmem") &&
        !           279:                    !eq(dev->d_name, "obio") &&
        !           280:                    !eq(dev->d_name, "vme16d16") &&
        !           281:                    !eq(dev->d_name, "vme24d16") &&
        !           282:                    !eq(dev->d_name, "vme32d16") &&
        !           283:                    !eq(dev->d_name, "vme16d32") &&
        !           284:                    !eq(dev->d_name, "vme24d32") &&
        !           285:                    !eq(dev->d_name, "vme32d32")) {
        !           286:                        (void)sprintf(errbuf,
        !           287:                            "unknown bus type `%s' for nexus connection on %s",
        !           288:                            dev->d_name, machinename);
        !           289:                        yyerror(errbuf);
        !           290:                }
        !           291:                break;
        !           292:        }
        !           293: }
        !           294: 
        !           295: /*
        !           296:  * Check the timezone to make certain it is sensible
        !           297:  */
        !           298: 
        !           299: check_tz()
        !           300: {
        !           301:        if (timezone > 24 * 60)
        !           302:                yyerror("timezone is unreasonable");
        !           303:        else
        !           304:                hadtz = TRUE;
        !           305: }
        !           306: 
        !           307: /*
        !           308:  * bi_info gives the magic number used to construct the token for
        !           309:  * the autoconf code.  bi_max is the maximum value (across all
        !           310:  * machine types for a given architecture) that a given "bus
        !           311:  * type" can legally have.
        !           312:  */
        !           313: struct bus_info {
        !           314:        char    *bi_name;
        !           315:        u_short bi_info;
        !           316:        u_int   bi_max;
        !           317: };
        !           318: 
        !           319: struct bus_info sun2_info[] = {
        !           320:        { "virtual",    0x0001, (1<<24)-1 },
        !           321:        { "obmem",      0x0002, (1<<23)-1 },
        !           322:        { "obio",       0x0004, (1<<23)-1 },
        !           323:        { "mbmem",      0x0010, (1<<20)-1 },
        !           324:        { "mbio",       0x0020, (1<<16)-1 },
        !           325:        { "vme16d16",   0x0100, (1<<16)-1 },
        !           326:        { "vme24d16",   0x0200, (1<<24)-(1<<16)-1 },
        !           327:        { (char *)0,    0,      0 }
        !           328: };
        !           329: 
        !           330: struct bus_info sun3_info[] = {
        !           331:        { "virtual",    0x0001, (1<<32)-1 },
        !           332:        { "obmem",      0x0002, (1<<32)-1 },
        !           333:        { "obio",       0x0004, (1<<21)-1 },
        !           334:        { "vme16d16",   0x0100, (1<<16)-1 },
        !           335:        { "vme24d16",   0x0200, (1<<24)-(1<<16)-1 },
        !           336:        { "vme32d16",   0x0400, (1<<32)-(1<<24)-1 },
        !           337:        { "vme16d32",   0x1000, (1<<16) },
        !           338:        { "vme24d32",   0x2000, (1<<24)-(1<<16)-1 },
        !           339:        { "vme32d32",   0x4000, (1<<32)-(1<<24)-1 },
        !           340:        { (char *)0,    0,      0 }
        !           341: };
        !           342: 
        !           343: bus_encode(addr, dp)
        !           344:        u_int addr;
        !           345:        register struct device *dp;
        !           346: {
        !           347:        register char *busname;
        !           348:        register struct bus_info *bip;
        !           349:        register int num;
        !           350: 
        !           351:        if (machine == MACHINE_SUN2)
        !           352:                bip = sun2_info;
        !           353:        else if (machine == MACHINE_SUN3)
        !           354:                bip = sun3_info;
        !           355:        else {
        !           356:                yyerror("bad machine type for bus_encode");
        !           357:                exit(1);
        !           358:        }
        !           359: 
        !           360:        if (dp->d_conn == TO_NEXUS || dp->d_conn == 0) {
        !           361:                yyerror("bad connection");
        !           362:                exit(1);
        !           363:        }
        !           364: 
        !           365:        busname = dp->d_conn->d_name;
        !           366:        num = dp->d_conn->d_unit;
        !           367: 
        !           368:        for (; bip->bi_name != 0; bip++)
        !           369:                if (eq(busname, bip->bi_name))
        !           370:                        break;
        !           371: 
        !           372:        if (bip->bi_name == 0) {
        !           373:                (void)sprintf(errbuf, "bad bus type '%s' for machine %s",
        !           374:                        busname, machinename);
        !           375:                yyerror(errbuf);
        !           376:        } else if (addr > bip->bi_max) {
        !           377:                (void)sprintf(errbuf,
        !           378:                        "0x%x exceeds maximum address 0x%x allowed for %s",
        !           379:                        addr, bip->bi_max, busname);
        !           380:                yyerror(errbuf);
        !           381:        } else {
        !           382:                dp->d_bus = bip->bi_info;       /* set up bus type info */
        !           383:                if (num != QUES)
        !           384:                        /*
        !           385:                         * Set up cpu type since the connecting
        !           386:                         * bus type is not wildcarded.
        !           387:                         */
        !           388:                        dp->d_mach = num;
        !           389:        }
        !           390: }
        !           391: short yyexca[] ={
        !           392: -1, 1,
        !           393:        0, -1,
        !           394:        -2, 0,
        !           395: -1, 2,
        !           396:        0, 1,
        !           397:        -2, 0,
        !           398:        };
        !           399: # define YYNPROD 66
        !           400: # define YYLAST 168
        !           401: short yyact[]={
        !           402: 
        !           403:    8,  15,  17,  18,  74,   9,  86,  65,  52,  53,
        !           404:   77,  85,  16,  12,  13,  84,  68,   7,  60,  45,
        !           405:    6,  11,  67, 104,  19,  20,  73,  23,  10,  22,
        !           406:   50,  21,  14,  52,  53, 103,  54,  55,  56,  57,
        !           407:   58,  59, 102,  60,  91,  92,  69,  70,  43,  44,
        !           408:   94, 101,  35,  88,  99,  97,  96,  93,  95,  87,
        !           409:   82,  54,  55,  56,  57,  58,  59,  78,  47,  42,
        !           410:   27,  26,  25,  24,  35,  66,  46,  40,  74,  72,
        !           411:   89,  51,  90,  75,  38,  71,  48,  49,  37,  28,
        !           412:   29,   5,   4,   3,   2,  34,  36,  39,   1,  41,
        !           413:   30,  31,  32,   0,  33,   0,   0,   0,   0,   0,
        !           414:    0,   0,   0,   0,   0,  64,   0,  61,  62,  63,
        !           415:    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
        !           416:    0,   0,  76,   0,   0,   0,   0,   0,   0,   0,
        !           417:    0,   0,   0, 100,   0,   0,  39,  79,  80,  81,
        !           418:   83,   0,   0, 105,   0,   0,   0,   0,   0,   0,
        !           419:    0,   0,   0,   0,   0,   0,   0,  98 };
        !           420: short yypact[]={
        !           421: 
        !           422: -1000,-1000,-256,-1000,-200,-201,-202,-1000,-203,-1000,
        !           423: -1000,-1000,-1000,-1000,-198,-198,-198,-195,-198,-205,
        !           424: -226,-262,-196,-206,-1000,-1000,-1000,-1000,-249,-229,
        !           425: -249,-249,-249,-229,-1000,-1000,-1000,-279,-1000,-1000,
        !           426: -1000,-197,-1000,-260,-266,-228,-1000,-1000,-263,-1000,
        !           427: -254,-207,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
        !           428: -1000,-263,-263,-263,-214,-198,-1000,-1000,-1000,-267,
        !           429: -271,-1000,-283,-215,-198,-221,-216,-218,-1000,-1000,
        !           430: -1000,-1000,-1000,-1000,-1000,-1000,-219,-189,-1000,-220,
        !           431: -1000,-223,-232,-239,-251,-1000,-1000,-1000,-1000,-198,
        !           432: -1000,-1000,-1000,-1000,-1000,-1000 };
        !           433: short yypgo[]={
        !           434: 
        !           435:    0,  80,  81,  53,  98,  94,  93,  92,  91,  88,
        !           436:   84,  89,  86,  85,  90,  87,  83,  82,  79 };
        !           437: short yyr1[]={
        !           438: 
        !           439:    0,   4,   5,   5,   6,   6,   6,   6,   6,   8,
        !           440:    8,   8,   8,   8,   8,   8,   8,   8,   8,   8,
        !           441:    8,   8,   8,   8,   8,   9,   9,  10,   1,   2,
        !           442:    2,   2,   2,   2,   2,   2,   2,   2,   7,   7,
        !           443:    7,   7,   7,   7,  11,  14,  12,  12,  15,  15,
        !           444:   16,  16,  17,  17,  17,  17,  13,  13,  13,  13,
        !           445:   13,  18,   3,   3,   3,   3 };
        !           446: short yyr2[]={
        !           447: 
        !           448:    0,   1,   2,   0,   2,   2,   2,   1,   2,   2,
        !           449:    2,   2,   2,   3,   2,   2,   3,   2,   3,   3,
        !           450:    4,   3,   4,   2,   2,   3,   1,   1,   1,   1,
        !           451:    1,   1,   1,   1,   1,   1,   1,   1,   4,   4,
        !           452:    4,   4,   3,   4,   3,   0,   2,   0,   3,   3,
        !           453:    2,   0,   2,   2,   2,   2,   1,   2,   3,   3,
        !           454:    0,   2,   1,   2,   2,   3 };
        !           455: short yychk[]={
        !           456: 
        !           457: -1000,  -4,  -5,  -6,  -7,  -8, 276, 273, 256, 261,
        !           458:  284, 277, 269, 270, 288, 257, 268, 258, 259, 280,
        !           459:  281, 287, 285, 283, 273, 273, 273, 273, -11, -14,
        !           460:  -11, -11, -11, -14,  -1, 272,  -1,  -9, -10,  -1,
        !           461:  272,  -1, 274, 274, 275, 281, 272, 274, -12, -15,
        !           462:  279,  -2, 262, 263, 290, 291, 292, 293, 294, 295,
        !           463:  272, -12, -12, -12,  -2, 286, 272, 282, 282, 274,
        !           464:  275, -13, -18, 289, 267, -16,  -2, 264, 274, -13,
        !           465:  -13, -13, 274, -10, 282, 282, 289, 274,  -3,  -1,
        !           466:  -17, 265, 266, 278, 271, 274, 274, 274, -18, 274,
        !           467:   -3, 274, 274, 274, 274,  -3 };
        !           468: short yydef[]={
        !           469: 
        !           470:    3,  -2,  -2,   2,   0,   0,   0,   7,   0,  45,
        !           471:   45,  45,  45,  45,   0,   0,   0,   0,   0,   0,
        !           472:    0,   0,   0,   0,   4,   5,   6,   8,  47,   0,
        !           473:   47,  47,  47,   0,   9,  28,  10,  11,  26,  27,
        !           474:   12,   0,  14,  15,  17,   0,  23,  24,  60,  51,
        !           475:    0,   0,  29,  30,  31,  32,  33,  34,  35,  36,
        !           476:   37,  60,  60,  60,  42,   0,  13,  16,  18,  19,
        !           477:   21,  38,  56,   0,   0,  46,   0,   0,  44,  39,
        !           478:   40,  41,  43,  25,  20,  22,   0,  57,  61,  62,
        !           479:   50,   0,   0,   0,   0,  48,  49,  58,  59,  63,
        !           480:   64,  52,  53,  54,  55,  65 };
        !           481: # ifdef YYDEBUG
        !           482: # include "y.debug"
        !           483: # endif
        !           484: 
        !           485: # define YYFLAG -1000
        !           486: # define YYERROR goto yyerrlab
        !           487: # define YYACCEPT return(0)
        !           488: # define YYABORT return(1)
        !           489: 
        !           490: /*     parser for yacc output  */
        !           491: 
        !           492: #ifdef YYDEBUG
        !           493: int yydebug = 0; /* 1 for debugging */
        !           494: #endif
        !           495: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
        !           496: int yychar = -1; /* current input token number */
        !           497: int yynerrs = 0;  /* number of errors */
        !           498: short yyerrflag = 0;  /* error recovery flag */
        !           499: 
        !           500: yyparse()
        !           501: {      short yys[YYMAXDEPTH];
        !           502:        int yyj, yym;
        !           503:        register YYSTYPE *yypvt;
        !           504:        register int yystate, yyn;
        !           505:        register short *yyps;
        !           506:        register YYSTYPE *yypv;
        !           507:        register short *yyxi;
        !           508: 
        !           509:        yystate = 0;
        !           510:        yychar = -1;
        !           511:        yynerrs = 0;
        !           512:        yyerrflag = 0;
        !           513:        yyps= &yys[-1];
        !           514:        yypv= &yyv[-1];
        !           515: 
        !           516: yystack:    /* put a state and value onto the stack */
        !           517: #ifdef YYDEBUG
        !           518:        if(yydebug >= 3)
        !           519:                if(yychar < 0 || yytoknames[yychar] == 0)
        !           520:                        printf("char %d in %s", yychar, yystates[yystate]);
        !           521:                else
        !           522:                        printf("%s in %s", yytoknames[yychar], yystates[yystate]);
        !           523: #endif
        !           524:        if( ++yyps >= &yys[YYMAXDEPTH] ) { 
        !           525:                yyerror( "yacc stack overflow" ); 
        !           526:                return(1)        !           527:        }
        !           528:        *yyps = yystate;
        !           529:        ++yypv;
        !           530:        *yypv = yyval;
        !           531: yynewstate:
        !           532:        yyn = yypact[yystate];
        !           533:        if(yyn <= YYFLAG) goto yydefault; /* simple state */
        !           534:        if(yychar<0) {
        !           535:                yychar = yylex();
        !           536: #ifdef YYDEBUG
        !           537:                if(yydebug >= 2) {
        !           538:                        if(yychar <= 0)
        !           539:                                printf("lex EOF\n");
        !           540:                        else if(yytoknames[yychar])
        !           541:                                printf("lex %s\n", yytoknames[yychar]);
        !           542:                        else
        !           543:                                printf("lex (%c)\n", yychar);
        !           544:                }
        !           545: #endif
        !           546:                if(yychar < 0)
        !           547:                        yychar = 0;
        !           548:        }
        !           549:        if((yyn += yychar) < 0 || yyn >= YYLAST)
        !           550:                goto yydefault;
        !           551:        if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
        !           552:                yychar = -1;
        !           553:                yyval = yylval;
        !           554:                yystate = yyn;
        !           555:                if( yyerrflag > 0 ) --yyerrflag;
        !           556:                goto yystack;
        !           557:        }
        !           558: yydefault:
        !           559:        /* default state action */
        !           560:        if( (yyn=yydef[yystate]) == -2 ) {
        !           561:                if(yychar < 0) {
        !           562:                        yychar = yylex();
        !           563: #ifdef YYDEBUG
        !           564:                        if(yydebug >= 2)
        !           565:                                if(yychar < 0)
        !           566:                                        printf("lex EOF\n");
        !           567:                                else
        !           568:                                        printf("lex %s\n", yytoknames[yychar]);
        !           569: #endif
        !           570:                        if(yychar < 0)
        !           571:                                yychar = 0;
        !           572:                }
        !           573:                /* look through exception table */
        !           574:                for(yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate);
        !           575:                        yyxi += 2 ) ; /* VOID */
        !           576:                while( *(yyxi+=2) >= 0 ){
        !           577:                        if( *yyxi == yychar ) break;
        !           578:                }
        !           579:                if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
        !           580:        }
        !           581:        if( yyn == 0 ){ /* error */
        !           582:                /* error ... attempt to resume parsing */
        !           583:                switch( yyerrflag ){
        !           584:                case 0:   /* brand new error */
        !           585: #ifdef YYDEBUG
        !           586:                        yyerror("syntax error\n%s", yystates[yystate]);
        !           587:                        if(yytoknames[yychar])
        !           588:                                yyerror("saw %s\n", yytoknames[yychar]);
        !           589:                        else if(yychar >= ' ' && yychar < '\177')
        !           590:                                yyerror("saw `%c'\n", yychar);
        !           591:                        else if(yychar == 0)
        !           592:                                yyerror("saw EOF\n");
        !           593:                        else
        !           594:                                yyerror("saw char 0%o\n", yychar);
        !           595: #else
        !           596:                        yyerror( "syntax error" );
        !           597: #endif
        !           598: yyerrlab:
        !           599:                        ++yynerrs;
        !           600:                case 1:
        !           601:                case 2: /* incompletely recovered error ... try again */
        !           602:                        yyerrflag = 3;
        !           603:                        /* find a state where "error" is a legal shift action */
        !           604:                        while ( yyps >= yys ) {
        !           605:                                yyn = yypact[*yyps] + YYERRCODE;
        !           606:                                if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
        !           607:                                        yystate = yyact[yyn];  /* simulate a shift of "error" */
        !           608:                                        goto yystack;
        !           609:                                }
        !           610:                                yyn = yypact[*yyps];
        !           611:                                /* the current yyps has no shift onn "error", pop stack */
        !           612: #ifdef YYDEBUG
        !           613:                                if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
        !           614: #endif
        !           615:                                --yyps;
        !           616:                                --yypv;
        !           617:                        }
        !           618:                        /* there is no state on the stack with an error shift ... abort */
        !           619: yyabort:
        !           620:                        return(1);
        !           621:                case 3:  /* no shift yet; clobber input char */
        !           622: #ifdef YYDEBUG
        !           623:                        if( yydebug ) {
        !           624:                                printf("error recovery discards ");
        !           625:                                if(yytoknames[yychar])
        !           626:                                        printf("%s\n", yytoknames[yychar]);
        !           627:                                else if(yychar >= ' ' && yychar < '\177')
        !           628:                                        printf("`%c'\n", yychar);
        !           629:                                else if(yychar == 0)
        !           630:                                        printf("EOF\n");
        !           631:                                else
        !           632:                                        printf("char 0%o\n", yychar);
        !           633:                        }
        !           634: #endif
        !           635:                        if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
        !           636:                        yychar = -1;
        !           637:                        goto yynewstate;   /* try again in the same state */
        !           638:                }
        !           639:        }
        !           640:        /* reduction by production yyn */
        !           641: #ifdef YYDEBUG
        !           642:        if(yydebug) {   char *s;
        !           643:                printf("reduce %d in:\n\t", yyn);
        !           644:                for(s = yystates[yystate]; *s; s++) {
        !           645:                        putchar(*s);
        !           646:                        if(*s == '\n' && *(s+1))
        !           647:                                putchar('\t');
        !           648:                }
        !           649:        }
        !           650: #endif
        !           651:        yyps -= yyr2[yyn];
        !           652:        yypvt = yypv;
        !           653:        yypv -= yyr2[yyn];
        !           654:        yyval = yypv[1];
        !           655:        yym=yyn;
        !           656:        /* consult goto table to find next state */
        !           657:        yyn = yyr1[yyn];
        !           658:        yyj = yypgo[yyn] + *yyps + 1;
        !           659:        if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
        !           660:        switch(yym){
        !           661:                
        !           662: case 4:
        !           663: # line 33 "config.y"
        !           664:  { newdev(&cur); } break;
        !           665: case 6:
        !           666: # line 35 "config.y"
        !           667:  { do_trace = ! do_trace; } break;
        !           668: case 9:
        !           669: # line 42 "config.y"
        !           670:  {
        !           671:                if (eq(yypvt[-0].cp, "vax")) {
        !           672:                        machine = MACHINE_VAX;
        !           673:                        machinename = "vax";
        !           674:                } else if (eq(yypvt[-0].cp, "sun2")) {
        !           675:                        machine = MACHINE_SUN2;
        !           676:                        machinename = "sun2";
        !           677:                } else if (eq(yypvt[-0].cp, "sun3")) {
        !           678:                        machine = MACHINE_SUN3;
        !           679:                        machinename = "sun3";
        !           680:                } else
        !           681:                        yyerror("Unknown machine type");
        !           682:              } break;
        !           683: case 10:
        !           684: # line 55 "config.y"
        !           685:  {
        !           686:                    struct cputype *cp = (struct cputype *)malloc(sizeof (struct cputype));
        !           687:                    cp->cpu_name = ns(yypvt[-0].cp);
        !           688:                    cp->cpu_next = cputype;
        !           689:                    cputype = cp;
        !           690:                    free(temp_id);
        !           691:                    } break;
        !           692: case 12:
        !           693: # line 63 "config.y"
        !           694: { ident = ns(yypvt[-0].cp); } break;
        !           695: case 13:
        !           696: # line 64 "config.y"
        !           697:  { mkconf(temp_id, yypvt[-0].cp); free(temp_id); } break;
        !           698: case 14:
        !           699: # line 65 "config.y"
        !           700:  {
        !           701:                yyerror("HZ specification obsolete; delete");
        !           702:                hz = 60;
        !           703:                } break;
        !           704: case 15:
        !           705: # line 69 "config.y"
        !           706:  { timezone = 60 * yypvt[-0].i; check_tz(); } break;
        !           707: case 16:
        !           708: # line 70 "config.y"
        !           709:  { timezone = 60 * yypvt[-1].i; dst = 1; check_tz(); } break;
        !           710: case 17:
        !           711: # line 71 "config.y"
        !           712:  { timezone = yypvt[-0].i; check_tz(); } break;
        !           713: case 18:
        !           714: # line 72 "config.y"
        !           715:  { timezone = yypvt[-1].i; dst = 1; check_tz(); } break;
        !           716: case 19:
        !           717: # line 73 "config.y"
        !           718: 
        !           719:            { timezone = -60 * yypvt[-0].i; check_tz(); } break;
        !           720: case 20:
        !           721: # line 75 "config.y"
        !           722: 
        !           723:            { timezone = -60 * yypvt[-1].i; dst = 1; check_tz(); } break;
        !           724: case 21:
        !           725: # line 77 "config.y"
        !           726: 
        !           727:            { timezone = -yypvt[-0].i; check_tz(); } break;
        !           728: case 22:
        !           729: # line 79 "config.y"
        !           730: 
        !           731:            { timezone = -yypvt[-1].i; dst = 1; check_tz(); } break;
        !           732: case 23:
        !           733: # line 81 "config.y"
        !           734: 
        !           735:            { mkfile = ns(yypvt[-0].cp); } break;
        !           736: case 24:
        !           737: # line 83 "config.y"
        !           738:  { maxusers = yypvt[-0].i; } break;
        !           739: case 27:
        !           740: # line 92 "config.y"
        !           741:  {
        !           742:                    struct opt *op = (struct opt *)malloc(sizeof (struct opt));
        !           743:                    op->op_name = ns(yypvt[-0].cp);
        !           744:                    op->op_next = opt;
        !           745:                    opt = op;
        !           746:                    free(temp_id);
        !           747:        } break;
        !           748: case 28:
        !           749: # line 102 "config.y"
        !           750:  { yyval.cp = temp_id = ns(yypvt[-0].cp); } break;
        !           751: case 29:
        !           752: # line 107 "config.y"
        !           753:  {
        !           754:                if (machine != MACHINE_VAX)
        !           755:                        yyerror("wrong machine type for uba");
        !           756:                yyval.cp = ns("uba");
        !           757:                } break;
        !           758: case 30:
        !           759: # line 113 "config.y"
        !           760:  {
        !           761:                if (machine != MACHINE_VAX)
        !           762:                        yyerror("wrong machine type for mba");
        !           763:                yyval.cp = ns("mba");
        !           764:                } break;
        !           765: case 31:
        !           766: # line 119 "config.y"
        !           767:  {
        !           768:                if (machine != MACHINE_SUN2 && machine != MACHINE_SUN3)
        !           769:                        yyerror("wrong machine type for vme16d16");
        !           770:                yyval.cp = ns("vme16d16");
        !           771:                } break;
        !           772: case 32:
        !           773: # line 125 "config.y"
        !           774:  {
        !           775:                if (machine != MACHINE_SUN2 && machine != MACHINE_SUN3)
        !           776:                        yyerror("wrong machine type for vme24d16");
        !           777:                yyval.cp = ns("vme24d16");
        !           778:                } break;
        !           779: case 33:
        !           780: # line 131 "config.y"
        !           781:  {
        !           782:                if (machine != MACHINE_SUN3)
        !           783:                        yyerror("wrong machine type for vme32d16");
        !           784:                yyval.cp = ns("vme32d16");
        !           785:                } break;
        !           786: case 34:
        !           787: # line 137 "config.y"
        !           788:  {
        !           789:                if (machine != MACHINE_SUN3)
        !           790:                        yyerror("wrong machine type for vme16d32");
        !           791:                yyval.cp = ns("vme16d32");
        !           792:                } break;
        !           793: case 35:
        !           794: # line 143 "config.y"
        !           795:  {
        !           796:                if (machine != MACHINE_SUN3)
        !           797:                        yyerror("wrong machine type for vme24d32");
        !           798:                yyval.cp = ns("vme24d32");
        !           799:                } break;
        !           800: case 36:
        !           801: # line 149 "config.y"
        !           802:  {
        !           803:                if (machine != MACHINE_SUN3)
        !           804:                        yyerror("wrong machine type for vme32d32");
        !           805:                yyval.cp = ns("vme32d32");
        !           806:                } break;
        !           807: case 37:
        !           808: # line 154 "config.y"
        !           809:  { yyval.cp = ns(yypvt[-0].cp); } break;
        !           810: case 38:
        !           811: # line 158 "config.y"
        !           812:  {  cur.d_type = DEVICE; } break;
        !           813: case 39:
        !           814: # line 159 "config.y"
        !           815:  {  cur.d_type = MASTER; } break;
        !           816: case 40:
        !           817: # line 160 "config.y"
        !           818: 
        !           819:                                {  cur.d_dk = 1; cur.d_type = DEVICE; } break;
        !           820: case 41:
        !           821: # line 162 "config.y"
        !           822:  {  cur.d_type = CONTROLLER; } break;
        !           823: case 42:
        !           824: # line 163 "config.y"
        !           825: 
        !           826:                        { cur.d_name = yypvt[-0].cp; cur.d_type = PSEUDO_DEVICE; } break;
        !           827: case 43:
        !           828: # line 165 "config.y"
        !           829: 
        !           830:                        { cur.d_name = yypvt[-1].cp; cur.d_type = PSEUDO_DEVICE;
        !           831:                          cur.d_count = yypvt[-0].i; } break;
        !           832: case 44:
        !           833: # line 171 "config.y"
        !           834:        {
        !           835:                        cur.d_name = yypvt[-1].cp;
        !           836:                        if (eq(yypvt[-1].cp, "mba"))
        !           837:                            seen_mba = TRUE;
        !           838:                        else if (eq(yypvt[-1].cp, "uba"))
        !           839:                            seen_uba = TRUE;
        !           840:                        cur.d_unit = yypvt[-0].i;
        !           841:                } break;
        !           842: case 45:
        !           843: # line 182 "config.y"
        !           844:  { init_dev(&cur); } break;
        !           845: case 48:
        !           846: # line 191 "config.y"
        !           847:  {
        !           848:                if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba")) {
        !           849:                        sprintf(errbuf,
        !           850:                                "%s must be connected to a nexus", cur.d_name);
        !           851:                        yyerror(errbuf);
        !           852:                }
        !           853:                cur.d_conn = connect(yypvt[-1].cp, yypvt[-0].i);
        !           854:        } break;
        !           855: case 49:
        !           856: # line 199 "config.y"
        !           857:  { check_nexus(&cur, yypvt[-0].i); cur.d_conn = TO_NEXUS; } break;
        !           858: case 52:
        !           859: # line 209 "config.y"
        !           860: {
        !           861:                cur.d_addr = yypvt[-0].i;
        !           862:                if (machine == MACHINE_SUN2 || machine == MACHINE_SUN3)
        !           863:                        bus_encode(yypvt[-0].i, &cur);
        !           864:                } break;
        !           865: case 53:
        !           866: # line 214 "config.y"
        !           867:  { cur.d_drive = yypvt[-0].i; } break;
        !           868: case 54:
        !           869: # line 215 "config.y"
        !           870: 
        !           871:        {
        !           872:                if (cur.d_conn != NULL && cur.d_conn != TO_NEXUS
        !           873:                    && cur.d_conn->d_type == MASTER)
        !           874:                        cur.d_slave = yypvt[-0].i;
        !           875:                else
        !           876:                        yyerror("can't specify slave--not to master");
        !           877:        } break;
        !           878: case 55:
        !           879: # line 223 "config.y"
        !           880:  { cur.d_flags = yypvt[-0].i; } break;
        !           881: case 56:
        !           882: # line 228 "config.y"
        !           883:  { cur.d_pri = 0; } break;
        !           884: case 57:
        !           885: # line 230 "config.y"
        !           886:  { cur.d_pri = yypvt[-0].i; } break;
        !           887: case 58:
        !           888: # line 232 "config.y"
        !           889:  { cur.d_pri = yypvt[-0].i; } break;
        !           890: case 59:
        !           891: # line 234 "config.y"
        !           892:  { cur.d_pri = yypvt[-1].i; } break;
        !           893: case 61:
        !           894: # line 239 "config.y"
        !           895:  { cur.d_vec = yypvt[-0].idlst; } break;
        !           896: case 62:
        !           897: # line 242 "config.y"
        !           898: 
        !           899:            { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
        !           900:              a->id = yypvt[-0].cp; a->id_next = 0; a->vec = 0; yyval.idlst = a; } break;
        !           901: case 63:
        !           902: # line 245 "config.y"
        !           903: 
        !           904:            { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
        !           905:              a->id = yypvt[-1].cp; a->id_next = 0; a->vec = yypvt[-0].i; yyval.idlst = a; } break;
        !           906: case 64:
        !           907: # line 248 "config.y"
        !           908: 
        !           909:            { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
        !           910:              a->id = yypvt[-1].cp; a->id_next = yypvt[-0].idlst; a->vec = 0; yyval.idlst = a; } break;
        !           911: case 65:
        !           912: # line 252 "config.y"
        !           913: { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
        !           914:              a->id = yypvt[-2].cp; a->id_next = yypvt[-0].idlst; a->vec = yypvt[-1].i; yyval.idlst = a; } break;
        !           915:        }
        !           916:        goto yystack;  /* stack new state and value */
        !           917: }

unix.superglobalmegacorp.com

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