Home | History | Annotate | Line # | Download | only in yacc
calc_code_provides.tab.c revision 1.1.1.3
      1 /*	$NetBSD: calc_code_provides.tab.c,v 1.1.1.3 2026/01/18 16:39:07 christos Exp $	*/
      2 
      3 /* original parser id follows */
      4 /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
      5 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
      6 
      7 #define YYBYACC 1
      8 #define YYMAJOR 2
      9 #define YYMINOR 0
     10 #define YYCHECK "yyyymmdd"
     11 
     12 #define YYEMPTY        (-1)
     13 #define yyclearin      (yychar = YYEMPTY)
     14 #define yyerrok        (yyerrflag = 0)
     15 #define YYRECOVERING() (yyerrflag != 0)
     16 #define YYENOMEM       (-2)
     17 #define YYEOF          0
     18 
     19 #ifndef yyparse
     20 #define yyparse    calc_code_provides_parse
     21 #endif /* yyparse */
     22 
     23 #ifndef yylex
     24 #define yylex      calc_code_provides_lex
     25 #endif /* yylex */
     26 
     27 #ifndef yyerror
     28 #define yyerror    calc_code_provides_error
     29 #endif /* yyerror */
     30 
     31 #ifndef yychar
     32 #define yychar     calc_code_provides_char
     33 #endif /* yychar */
     34 
     35 #ifndef yyval
     36 #define yyval      calc_code_provides_val
     37 #endif /* yyval */
     38 
     39 #ifndef yylval
     40 #define yylval     calc_code_provides_lval
     41 #endif /* yylval */
     42 
     43 #ifndef yydebug
     44 #define yydebug    calc_code_provides_debug
     45 #endif /* yydebug */
     46 
     47 #ifndef yynerrs
     48 #define yynerrs    calc_code_provides_nerrs
     49 #endif /* yynerrs */
     50 
     51 #ifndef yyerrflag
     52 #define yyerrflag  calc_code_provides_errflag
     53 #endif /* yyerrflag */
     54 
     55 #ifndef yylhs
     56 #define yylhs      calc_code_provides_lhs
     57 #endif /* yylhs */
     58 
     59 #ifndef yylen
     60 #define yylen      calc_code_provides_len
     61 #endif /* yylen */
     62 
     63 #ifndef yydefred
     64 #define yydefred   calc_code_provides_defred
     65 #endif /* yydefred */
     66 
     67 #ifndef yydgoto
     68 #define yydgoto    calc_code_provides_dgoto
     69 #endif /* yydgoto */
     70 
     71 #ifndef yysindex
     72 #define yysindex   calc_code_provides_sindex
     73 #endif /* yysindex */
     74 
     75 #ifndef yyrindex
     76 #define yyrindex   calc_code_provides_rindex
     77 #endif /* yyrindex */
     78 
     79 #ifndef yygindex
     80 #define yygindex   calc_code_provides_gindex
     81 #endif /* yygindex */
     82 
     83 #ifndef yytable
     84 #define yytable    calc_code_provides_table
     85 #endif /* yytable */
     86 
     87 #ifndef yycheck
     88 #define yycheck    calc_code_provides_check
     89 #endif /* yycheck */
     90 
     91 #ifndef yyname
     92 #define yyname     calc_code_provides_name
     93 #endif /* yyname */
     94 
     95 #ifndef yyrule
     96 #define yyrule     calc_code_provides_rule
     97 #endif /* yyrule */
     98 #define YYPREFIX "calc_code_provides_"
     99 
    100 #define YYPURE 0
    101 
    102 #line 5 "calc_code_provides.y"
    103 # include <stdio.h>
    104 # include <ctype.h>
    105 
    106 int regs[26];
    107 int base;
    108 
    109 extern int yylex(void);
    110 static void yyerror(const char *s);
    111 
    112 #line 111 "calc_code_provides.tab.c"
    113 
    114 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
    115 /* Default: YYSTYPE is the semantic value type. */
    116 typedef int YYSTYPE;
    117 # define YYSTYPE_IS_DECLARED 1
    118 #endif
    119 
    120 /* compatibility with bison */
    121 #ifdef YYPARSE_PARAM
    122 /* compatibility with FreeBSD */
    123 # ifdef YYPARSE_PARAM_TYPE
    124 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
    125 # else
    126 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
    127 # endif
    128 #else
    129 # define YYPARSE_DECL() yyparse(void)
    130 #endif
    131 
    132 /* Parameters sent to lex. */
    133 #ifdef YYLEX_PARAM
    134 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
    135 # define YYLEX yylex(YYLEX_PARAM)
    136 #else
    137 # define YYLEX_DECL() yylex(void)
    138 # define YYLEX yylex()
    139 #endif
    140 
    141 /* Parameters sent to yyerror. */
    142 #ifndef YYERROR_DECL
    143 #define YYERROR_DECL() yyerror(const char *s)
    144 #endif
    145 #ifndef YYERROR_CALL
    146 #define YYERROR_CALL(msg) yyerror(msg)
    147 #endif
    148 
    149 extern int YYPARSE_DECL();
    150 
    151 #define DIGIT 257
    152 #define LETTER 258
    153 #define UMINUS 259
    154 #define YYERRCODE 256
    155 typedef int YYINT;
    156 static const YYINT calc_code_provides_lhs[] = {          -1,
    157     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
    158     2,    2,    2,    2,    2,    2,    3,    3,
    159 };
    160 static const YYINT calc_code_provides_len[] = {           2,
    161     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
    162     3,    3,    3,    2,    1,    1,    1,    2,
    163 };
    164 static const YYINT calc_code_provides_defred[] = {        1,
    165     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
    166     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
    167     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
    168    10,   11,
    169 };
    170 static const YYINT calc_code_provides_dgoto[] = {         1,
    171     7,    8,    9,
    172 };
    173 static const YYINT calc_code_provides_sindex[] = {        0,
    174   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
    175   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
    176   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
    177     0,    0,
    178 };
    179 static const YYINT calc_code_provides_rindex[] = {        0,
    180     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
    181     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    182     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
    183     0,    0,
    184 };
    185 static const YYINT calc_code_provides_gindex[] = {        0,
    186     0,   65,    0,
    187 };
    188 #define YYTABLESIZE 220
    189 static const YYINT calc_code_provides_table[] = {         6,
    190    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
    191    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
    192     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
    193     0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
    194     0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
    195     8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
    196     0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
    197    14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
    198    26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
    199     0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
    200     0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
    201     0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
    202     0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
    203     0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
    204     0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
    205     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    206     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    207     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    208     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    209     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    210     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    211     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
    212 };
    213 static const YYINT calc_code_provides_check[] = {        40,
    214    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
    215    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
    216    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
    217    -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
    218    -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
    219    38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
    220    -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
    221     6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
    222    16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
    223    -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
    224    -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
    225    -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
    226    -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
    227    -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
    228    -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
    229    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    230    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    231    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    232    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    233    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    234    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    235    -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
    236 };
    237 #define YYFINAL 1
    238 #ifndef YYDEBUG
    239 #define YYDEBUG 0
    240 #endif
    241 #define YYMAXTOKEN 259
    242 #define YYUNDFTOKEN 265
    243 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
    244 #if YYDEBUG
    245 #ifndef NULL
    246 #define NULL (void*)0
    247 #endif
    248 static const char *const calc_code_provides_name[] = {
    249 
    250 "end-of-file",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"'\\n'",NULL,NULL,
    251 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    252 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"'%'","'&'",NULL,"'('","')'","'*'",
    253 "'+'",NULL,"'-'",NULL,"'/'",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    254 NULL,NULL,NULL,"'='",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    255 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    256 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    257 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    258 NULL,NULL,NULL,"'|'",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    259 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    260 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    261 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    262 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    263 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    264 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    265 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    266 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"DIGIT","LETTER","UMINUS",NULL,
    267 NULL,NULL,NULL,NULL,"illegal-symbol",
    268 };
    269 static const char *const calc_code_provides_rule[] = {
    270 "$accept : list",
    271 "list :",
    272 "list : list stat '\\n'",
    273 "list : list error '\\n'",
    274 "stat : expr",
    275 "stat : LETTER '=' expr",
    276 "expr : '(' expr ')'",
    277 "expr : expr '+' expr",
    278 "expr : expr '-' expr",
    279 "expr : expr '*' expr",
    280 "expr : expr '/' expr",
    281 "expr : expr '%' expr",
    282 "expr : expr '&' expr",
    283 "expr : expr '|' expr",
    284 "expr : '-' expr",
    285 "expr : LETTER",
    286 "expr : number",
    287 "number : DIGIT",
    288 "number : number DIGIT",
    289 
    290 };
    291 #endif
    292 
    293 #if YYDEBUG
    294 int      yydebug;
    295 #endif
    296 
    297 int      yyerrflag;
    298 int      yychar;
    299 YYSTYPE  yyval;
    300 YYSTYPE  yylval;
    301 int      yynerrs;
    302 
    303 /* define the initial stack-sizes */
    304 #ifdef YYSTACKSIZE
    305 #undef YYMAXDEPTH
    306 #define YYMAXDEPTH  YYSTACKSIZE
    307 #else
    308 #ifdef YYMAXDEPTH
    309 #define YYSTACKSIZE YYMAXDEPTH
    310 #else
    311 #define YYSTACKSIZE 10000
    312 #define YYMAXDEPTH  10000
    313 #endif
    314 #endif
    315 
    316 #define YYINITSTACKSIZE 200
    317 
    318 typedef struct {
    319     unsigned stacksize;
    320     YYINT    *s_base;
    321     YYINT    *s_mark;
    322     YYINT    *s_last;
    323     YYSTYPE  *l_base;
    324     YYSTYPE  *l_mark;
    325 } YYSTACKDATA;
    326 /* variables for the parser stack */
    327 static YYSTACKDATA yystack;
    328 
    329 /* %code "provides" block start */
    330 #line 1 "calc_code_provides.y"
    331 /* CODE-PROVIDES */
    332 #line 2 "calc_code_provides.y"
    333 /* CODE-PROVIDES2 */
    334 /* %code "provides" block end */
    335 #line 334 "calc_code_provides.tab.c"
    336 #line 69 "calc_code_provides.y"
    337  /* start of programs */
    338 
    339 int
    340 main (void)
    341 {
    342     while(!feof(stdin)) {
    343 	yyparse();
    344     }
    345     return 0;
    346 }
    347 
    348 static void
    349 yyerror(const char *s)
    350 {
    351     fprintf(stderr, "%s\n", s);
    352 }
    353 
    354 int
    355 yylex(void)
    356 {
    357 	/* lexical analysis routine */
    358 	/* returns LETTER for a lower case letter, yylval = 0 through 25 */
    359 	/* return DIGIT for a digit, yylval = 0 through 9 */
    360 	/* all other characters are returned immediately */
    361 
    362     int c;
    363 
    364     while( (c=getchar()) == ' ' )   { /* skip blanks */ }
    365 
    366     /* c is now nonblank */
    367 
    368     if( islower( c )) {
    369 	yylval = c - 'a';
    370 	return ( LETTER );
    371     }
    372     if( isdigit( c )) {
    373 	yylval = c - '0';
    374 	return ( DIGIT );
    375     }
    376     return( c );
    377 }
    378 #line 377 "calc_code_provides.tab.c"
    379 
    380 #if YYDEBUG
    381 #include <stdio.h>	/* needed for printf */
    382 #endif
    383 
    384 #include <stdlib.h>	/* needed for malloc, etc */
    385 #include <string.h>	/* needed for memset */
    386 
    387 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
    388 static int yygrowstack(YYSTACKDATA *data)
    389 {
    390     int i;
    391     unsigned newsize;
    392     YYINT *newss;
    393     YYSTYPE *newvs;
    394 
    395     if ((newsize = data->stacksize) == 0)
    396         newsize = YYINITSTACKSIZE;
    397     else if (newsize >= YYMAXDEPTH)
    398         return YYENOMEM;
    399     else if ((newsize *= 2) > YYMAXDEPTH)
    400         newsize = YYMAXDEPTH;
    401 
    402     i = (int) (data->s_mark - data->s_base);
    403     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
    404     if (newss == NULL)
    405         return YYENOMEM;
    406 
    407     data->s_base = newss;
    408     data->s_mark = newss + i;
    409 
    410     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
    411     if (newvs == NULL)
    412         return YYENOMEM;
    413 
    414     data->l_base = newvs;
    415     data->l_mark = newvs + i;
    416 
    417     data->stacksize = newsize;
    418     data->s_last = data->s_base + newsize - 1;
    419     return 0;
    420 }
    421 
    422 #if YYPURE || defined(YY_NO_LEAKS)
    423 static void yyfreestack(YYSTACKDATA *data)
    424 {
    425     free(data->s_base);
    426     free(data->l_base);
    427     memset(data, 0, sizeof(*data));
    428 }
    429 #else
    430 #define yyfreestack(data) /* nothing */
    431 #endif
    432 
    433 #define YYABORT  goto yyabort
    434 #define YYREJECT goto yyabort
    435 #define YYACCEPT goto yyaccept
    436 #define YYERROR  goto yyerrlab
    437 
    438 int
    439 YYPARSE_DECL()
    440 {
    441     int yym, yyn, yystate;
    442 #if YYDEBUG
    443     const char *yys;
    444 
    445     if ((yys = getenv("YYDEBUG")) != NULL)
    446     {
    447         yyn = *yys;
    448         if (yyn >= '0' && yyn <= '9')
    449             yydebug = yyn - '0';
    450     }
    451 #endif
    452 
    453     /* yym is set below */
    454     /* yyn is set below */
    455     yynerrs = 0;
    456     yyerrflag = 0;
    457     yychar = YYEMPTY;
    458     yystate = 0;
    459 
    460 #if YYPURE
    461     memset(&yystack, 0, sizeof(yystack));
    462 #endif
    463 
    464     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    465     yystack.s_mark = yystack.s_base;
    466     yystack.l_mark = yystack.l_base;
    467     yystate = 0;
    468     *yystack.s_mark = 0;
    469 
    470 yyloop:
    471     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
    472     if (yychar < 0)
    473     {
    474         yychar = YYLEX;
    475         if (yychar < 0) yychar = YYEOF;
    476 #if YYDEBUG
    477         if (yydebug)
    478         {
    479             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
    480             printf("%sdebug: state %d, reading %d (%s)\n",
    481                     YYPREFIX, yystate, yychar, yys);
    482         }
    483 #endif
    484     }
    485     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
    486             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
    487     {
    488 #if YYDEBUG
    489         if (yydebug)
    490             printf("%sdebug: state %d, shifting to state %d\n",
    491                     YYPREFIX, yystate, yytable[yyn]);
    492 #endif
    493         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    494         yystate = yytable[yyn];
    495         *++yystack.s_mark = yytable[yyn];
    496         *++yystack.l_mark = yylval;
    497         yychar = YYEMPTY;
    498         if (yyerrflag > 0)  --yyerrflag;
    499         goto yyloop;
    500     }
    501     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
    502             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
    503     {
    504         yyn = yytable[yyn];
    505         goto yyreduce;
    506     }
    507     if (yyerrflag != 0) goto yyinrecovery;
    508 
    509     YYERROR_CALL("syntax error");
    510 
    511     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
    512 yyerrlab:
    513     ++yynerrs;
    514 
    515 yyinrecovery:
    516     if (yyerrflag < 3)
    517     {
    518         yyerrflag = 3;
    519         for (;;)
    520         {
    521             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
    522                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
    523             {
    524 #if YYDEBUG
    525                 if (yydebug)
    526                     printf("%sdebug: state %d, error recovery shifting\
    527  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
    528 #endif
    529                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    530                 yystate = yytable[yyn];
    531                 *++yystack.s_mark = yytable[yyn];
    532                 *++yystack.l_mark = yylval;
    533                 goto yyloop;
    534             }
    535             else
    536             {
    537 #if YYDEBUG
    538                 if (yydebug)
    539                     printf("%sdebug: error recovery discarding state %d\n",
    540                             YYPREFIX, *yystack.s_mark);
    541 #endif
    542                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
    543                 --yystack.s_mark;
    544                 --yystack.l_mark;
    545             }
    546         }
    547     }
    548     else
    549     {
    550         if (yychar == YYEOF) goto yyabort;
    551 #if YYDEBUG
    552         if (yydebug)
    553         {
    554             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
    555             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
    556                     YYPREFIX, yystate, yychar, yys);
    557         }
    558 #endif
    559         yychar = YYEMPTY;
    560         goto yyloop;
    561     }
    562 
    563 yyreduce:
    564 #if YYDEBUG
    565     if (yydebug)
    566         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
    567                 YYPREFIX, yystate, yyn, yyrule[yyn]);
    568 #endif
    569     yym = yylen[yyn];
    570     if (yym > 0)
    571         yyval = yystack.l_mark[1-yym];
    572     else
    573         memset(&yyval, 0, sizeof yyval);
    574 
    575     switch (yyn)
    576     {
    577 case 3:
    578 #line 31 "calc_code_provides.y"
    579 	{  yyerrok ; }
    580 #line 579 "calc_code_provides.tab.c"
    581 break;
    582 case 4:
    583 #line 35 "calc_code_provides.y"
    584 	{  printf("%d\n",yystack.l_mark[0]);}
    585 #line 584 "calc_code_provides.tab.c"
    586 break;
    587 case 5:
    588 #line 37 "calc_code_provides.y"
    589 	{  regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
    590 #line 589 "calc_code_provides.tab.c"
    591 break;
    592 case 6:
    593 #line 41 "calc_code_provides.y"
    594 	{  yyval = yystack.l_mark[-1]; }
    595 #line 594 "calc_code_provides.tab.c"
    596 break;
    597 case 7:
    598 #line 43 "calc_code_provides.y"
    599 	{  yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
    600 #line 599 "calc_code_provides.tab.c"
    601 break;
    602 case 8:
    603 #line 45 "calc_code_provides.y"
    604 	{  yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
    605 #line 604 "calc_code_provides.tab.c"
    606 break;
    607 case 9:
    608 #line 47 "calc_code_provides.y"
    609 	{  yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
    610 #line 609 "calc_code_provides.tab.c"
    611 break;
    612 case 10:
    613 #line 49 "calc_code_provides.y"
    614 	{  yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
    615 #line 614 "calc_code_provides.tab.c"
    616 break;
    617 case 11:
    618 #line 51 "calc_code_provides.y"
    619 	{  yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
    620 #line 619 "calc_code_provides.tab.c"
    621 break;
    622 case 12:
    623 #line 53 "calc_code_provides.y"
    624 	{  yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
    625 #line 624 "calc_code_provides.tab.c"
    626 break;
    627 case 13:
    628 #line 55 "calc_code_provides.y"
    629 	{  yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
    630 #line 629 "calc_code_provides.tab.c"
    631 break;
    632 case 14:
    633 #line 57 "calc_code_provides.y"
    634 	{  yyval = - yystack.l_mark[0]; }
    635 #line 634 "calc_code_provides.tab.c"
    636 break;
    637 case 15:
    638 #line 59 "calc_code_provides.y"
    639 	{  yyval = regs[yystack.l_mark[0]]; }
    640 #line 639 "calc_code_provides.tab.c"
    641 break;
    642 case 17:
    643 #line 64 "calc_code_provides.y"
    644 	{  yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
    645 #line 644 "calc_code_provides.tab.c"
    646 break;
    647 case 18:
    648 #line 66 "calc_code_provides.y"
    649 	{  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
    650 #line 649 "calc_code_provides.tab.c"
    651 break;
    652 #line 651 "calc_code_provides.tab.c"
    653     }
    654     yystack.s_mark -= yym;
    655     yystate = *yystack.s_mark;
    656     yystack.l_mark -= yym;
    657     yym = yylhs[yyn];
    658     if (yystate == 0 && yym == 0)
    659     {
    660 #if YYDEBUG
    661         if (yydebug)
    662             printf("%sdebug: after reduction, shifting from state 0 to\
    663  state %d\n", YYPREFIX, YYFINAL);
    664 #endif
    665         yystate = YYFINAL;
    666         *++yystack.s_mark = YYFINAL;
    667         *++yystack.l_mark = yyval;
    668         if (yychar < 0)
    669         {
    670             yychar = YYLEX;
    671             if (yychar < 0) yychar = YYEOF;
    672 #if YYDEBUG
    673             if (yydebug)
    674             {
    675                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
    676                 printf("%sdebug: state %d, reading %d (%s)\n",
    677                         YYPREFIX, YYFINAL, yychar, yys);
    678             }
    679 #endif
    680         }
    681         if (yychar == YYEOF) goto yyaccept;
    682         goto yyloop;
    683     }
    684     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
    685             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
    686         yystate = yytable[yyn];
    687     else
    688         yystate = yydgoto[yym];
    689 #if YYDEBUG
    690     if (yydebug)
    691         printf("%sdebug: after reduction, shifting from state %d \
    692 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
    693 #endif
    694     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    695     *++yystack.s_mark = (YYINT) yystate;
    696     *++yystack.l_mark = yyval;
    697     goto yyloop;
    698 
    699 yyoverflow:
    700     YYERROR_CALL("yacc stack overflow");
    701 
    702 yyabort:
    703     yyfreestack(&yystack);
    704     return (1);
    705 
    706 yyaccept:
    707     yyfreestack(&yystack);
    708     return (0);
    709 }
    710