calc_code_provides.tab.c revision 1.2 1 /* $NetBSD: calc_code_provides.tab.c,v 1.2 2024/09/14 21:29:04 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 static const char *const calc_code_provides_name[] = {
246
247 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
248 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,
249 0,0,0,0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
250 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0,
251 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
252 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
253 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
254 0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",0,0,0,0,0,"illegal-symbol",
255 };
256 static const char *const calc_code_provides_rule[] = {
257 "$accept : list",
258 "list :",
259 "list : list stat '\\n'",
260 "list : list error '\\n'",
261 "stat : expr",
262 "stat : LETTER '=' expr",
263 "expr : '(' expr ')'",
264 "expr : expr '+' expr",
265 "expr : expr '-' expr",
266 "expr : expr '*' expr",
267 "expr : expr '/' expr",
268 "expr : expr '%' expr",
269 "expr : expr '&' expr",
270 "expr : expr '|' expr",
271 "expr : '-' expr",
272 "expr : LETTER",
273 "expr : number",
274 "number : DIGIT",
275 "number : number DIGIT",
276
277 };
278 #endif
279
280 #if YYDEBUG
281 int yydebug;
282 #endif
283
284 int yyerrflag;
285 int yychar;
286 YYSTYPE yyval;
287 YYSTYPE yylval;
288 int yynerrs;
289
290 /* define the initial stack-sizes */
291 #ifdef YYSTACKSIZE
292 #undef YYMAXDEPTH
293 #define YYMAXDEPTH YYSTACKSIZE
294 #else
295 #ifdef YYMAXDEPTH
296 #define YYSTACKSIZE YYMAXDEPTH
297 #else
298 #define YYSTACKSIZE 10000
299 #define YYMAXDEPTH 10000
300 #endif
301 #endif
302
303 #define YYINITSTACKSIZE 200
304
305 typedef struct {
306 unsigned stacksize;
307 YYINT *s_base;
308 YYINT *s_mark;
309 YYINT *s_last;
310 YYSTYPE *l_base;
311 YYSTYPE *l_mark;
312 } YYSTACKDATA;
313 /* variables for the parser stack */
314 static YYSTACKDATA yystack;
315
316 /* %code "provides" block start */
317 #line 1 "calc_code_provides.y"
318 /* CODE-PROVIDES */
319 #line 2 "calc_code_provides.y"
320 /* CODE-PROVIDES2 */
321 /* %code "provides" block end */
322 #line 321 "calc_code_provides.tab.c"
323 #line 69 "calc_code_provides.y"
324 /* start of programs */
325
326 int
327 main (void)
328 {
329 while(!feof(stdin)) {
330 yyparse();
331 }
332 return 0;
333 }
334
335 static void
336 yyerror(const char *s)
337 {
338 fprintf(stderr, "%s\n", s);
339 }
340
341 int
342 yylex(void)
343 {
344 /* lexical analysis routine */
345 /* returns LETTER for a lower case letter, yylval = 0 through 25 */
346 /* return DIGIT for a digit, yylval = 0 through 9 */
347 /* all other characters are returned immediately */
348
349 int c;
350
351 while( (c=getchar()) == ' ' ) { /* skip blanks */ }
352
353 /* c is now nonblank */
354
355 if( islower( c )) {
356 yylval = c - 'a';
357 return ( LETTER );
358 }
359 if( isdigit( c )) {
360 yylval = c - '0';
361 return ( DIGIT );
362 }
363 return( c );
364 }
365 #line 364 "calc_code_provides.tab.c"
366
367 #if YYDEBUG
368 #include <stdio.h> /* needed for printf */
369 #endif
370
371 #include <stdlib.h> /* needed for malloc, etc */
372 #include <string.h> /* needed for memset */
373
374 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
375 static int yygrowstack(YYSTACKDATA *data)
376 {
377 int i;
378 unsigned newsize;
379 YYINT *newss;
380 YYSTYPE *newvs;
381
382 if ((newsize = data->stacksize) == 0)
383 newsize = YYINITSTACKSIZE;
384 else if (newsize >= YYMAXDEPTH)
385 return YYENOMEM;
386 else if ((newsize *= 2) > YYMAXDEPTH)
387 newsize = YYMAXDEPTH;
388
389 i = (int) (data->s_mark - data->s_base);
390 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
391 if (newss == 0)
392 return YYENOMEM;
393
394 data->s_base = newss;
395 data->s_mark = newss + i;
396
397 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
398 if (newvs == 0)
399 return YYENOMEM;
400
401 data->l_base = newvs;
402 data->l_mark = newvs + i;
403
404 data->stacksize = newsize;
405 data->s_last = data->s_base + newsize - 1;
406 return 0;
407 }
408
409 #if YYPURE || defined(YY_NO_LEAKS)
410 static void yyfreestack(YYSTACKDATA *data)
411 {
412 free(data->s_base);
413 free(data->l_base);
414 memset(data, 0, sizeof(*data));
415 }
416 #else
417 #define yyfreestack(data) /* nothing */
418 #endif
419
420 #define YYABORT goto yyabort
421 #define YYREJECT goto yyabort
422 #define YYACCEPT goto yyaccept
423 #define YYERROR goto yyerrlab
424
425 int
426 YYPARSE_DECL()
427 {
428 int yym, yyn, yystate;
429 #if YYDEBUG
430 const char *yys;
431
432 if ((yys = getenv("YYDEBUG")) != 0)
433 {
434 yyn = *yys;
435 if (yyn >= '0' && yyn <= '9')
436 yydebug = yyn - '0';
437 }
438 #endif
439
440 /* yym is set below */
441 /* yyn is set below */
442 yynerrs = 0;
443 yyerrflag = 0;
444 yychar = YYEMPTY;
445 yystate = 0;
446
447 #if YYPURE
448 memset(&yystack, 0, sizeof(yystack));
449 #endif
450
451 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
452 yystack.s_mark = yystack.s_base;
453 yystack.l_mark = yystack.l_base;
454 yystate = 0;
455 *yystack.s_mark = 0;
456
457 yyloop:
458 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
459 if (yychar < 0)
460 {
461 yychar = YYLEX;
462 if (yychar < 0) yychar = YYEOF;
463 #if YYDEBUG
464 if (yydebug)
465 {
466 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
467 printf("%sdebug: state %d, reading %d (%s)\n",
468 YYPREFIX, yystate, yychar, yys);
469 }
470 #endif
471 }
472 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
473 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
474 {
475 #if YYDEBUG
476 if (yydebug)
477 printf("%sdebug: state %d, shifting to state %d\n",
478 YYPREFIX, yystate, yytable[yyn]);
479 #endif
480 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
481 yystate = yytable[yyn];
482 *++yystack.s_mark = yytable[yyn];
483 *++yystack.l_mark = yylval;
484 yychar = YYEMPTY;
485 if (yyerrflag > 0) --yyerrflag;
486 goto yyloop;
487 }
488 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
489 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
490 {
491 yyn = yytable[yyn];
492 goto yyreduce;
493 }
494 if (yyerrflag != 0) goto yyinrecovery;
495
496 YYERROR_CALL("syntax error");
497
498 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
499 yyerrlab:
500 ++yynerrs;
501
502 yyinrecovery:
503 if (yyerrflag < 3)
504 {
505 yyerrflag = 3;
506 for (;;)
507 {
508 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
509 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
510 {
511 #if YYDEBUG
512 if (yydebug)
513 printf("%sdebug: state %d, error recovery shifting\
514 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
515 #endif
516 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
517 yystate = yytable[yyn];
518 *++yystack.s_mark = yytable[yyn];
519 *++yystack.l_mark = yylval;
520 goto yyloop;
521 }
522 else
523 {
524 #if YYDEBUG
525 if (yydebug)
526 printf("%sdebug: error recovery discarding state %d\n",
527 YYPREFIX, *yystack.s_mark);
528 #endif
529 if (yystack.s_mark <= yystack.s_base) goto yyabort;
530 --yystack.s_mark;
531 --yystack.l_mark;
532 }
533 }
534 }
535 else
536 {
537 if (yychar == YYEOF) goto yyabort;
538 #if YYDEBUG
539 if (yydebug)
540 {
541 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
542 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
543 YYPREFIX, yystate, yychar, yys);
544 }
545 #endif
546 yychar = YYEMPTY;
547 goto yyloop;
548 }
549
550 yyreduce:
551 #if YYDEBUG
552 if (yydebug)
553 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
554 YYPREFIX, yystate, yyn, yyrule[yyn]);
555 #endif
556 yym = yylen[yyn];
557 if (yym > 0)
558 yyval = yystack.l_mark[1-yym];
559 else
560 memset(&yyval, 0, sizeof yyval);
561
562 switch (yyn)
563 {
564 case 3:
565 #line 31 "calc_code_provides.y"
566 { yyerrok ; }
567 #line 566 "calc_code_provides.tab.c"
568 break;
569 case 4:
570 #line 35 "calc_code_provides.y"
571 { printf("%d\n",yystack.l_mark[0]);}
572 #line 571 "calc_code_provides.tab.c"
573 break;
574 case 5:
575 #line 37 "calc_code_provides.y"
576 { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
577 #line 576 "calc_code_provides.tab.c"
578 break;
579 case 6:
580 #line 41 "calc_code_provides.y"
581 { yyval = yystack.l_mark[-1]; }
582 #line 581 "calc_code_provides.tab.c"
583 break;
584 case 7:
585 #line 43 "calc_code_provides.y"
586 { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
587 #line 586 "calc_code_provides.tab.c"
588 break;
589 case 8:
590 #line 45 "calc_code_provides.y"
591 { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
592 #line 591 "calc_code_provides.tab.c"
593 break;
594 case 9:
595 #line 47 "calc_code_provides.y"
596 { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
597 #line 596 "calc_code_provides.tab.c"
598 break;
599 case 10:
600 #line 49 "calc_code_provides.y"
601 { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
602 #line 601 "calc_code_provides.tab.c"
603 break;
604 case 11:
605 #line 51 "calc_code_provides.y"
606 { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
607 #line 606 "calc_code_provides.tab.c"
608 break;
609 case 12:
610 #line 53 "calc_code_provides.y"
611 { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
612 #line 611 "calc_code_provides.tab.c"
613 break;
614 case 13:
615 #line 55 "calc_code_provides.y"
616 { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
617 #line 616 "calc_code_provides.tab.c"
618 break;
619 case 14:
620 #line 57 "calc_code_provides.y"
621 { yyval = - yystack.l_mark[0]; }
622 #line 621 "calc_code_provides.tab.c"
623 break;
624 case 15:
625 #line 59 "calc_code_provides.y"
626 { yyval = regs[yystack.l_mark[0]]; }
627 #line 626 "calc_code_provides.tab.c"
628 break;
629 case 17:
630 #line 64 "calc_code_provides.y"
631 { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
632 #line 631 "calc_code_provides.tab.c"
633 break;
634 case 18:
635 #line 66 "calc_code_provides.y"
636 { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
637 #line 636 "calc_code_provides.tab.c"
638 break;
639 #line 638 "calc_code_provides.tab.c"
640 }
641 yystack.s_mark -= yym;
642 yystate = *yystack.s_mark;
643 yystack.l_mark -= yym;
644 yym = yylhs[yyn];
645 if (yystate == 0 && yym == 0)
646 {
647 #if YYDEBUG
648 if (yydebug)
649 printf("%sdebug: after reduction, shifting from state 0 to\
650 state %d\n", YYPREFIX, YYFINAL);
651 #endif
652 yystate = YYFINAL;
653 *++yystack.s_mark = YYFINAL;
654 *++yystack.l_mark = yyval;
655 if (yychar < 0)
656 {
657 yychar = YYLEX;
658 if (yychar < 0) yychar = YYEOF;
659 #if YYDEBUG
660 if (yydebug)
661 {
662 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
663 printf("%sdebug: state %d, reading %d (%s)\n",
664 YYPREFIX, YYFINAL, yychar, yys);
665 }
666 #endif
667 }
668 if (yychar == YYEOF) goto yyaccept;
669 goto yyloop;
670 }
671 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
672 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
673 yystate = yytable[yyn];
674 else
675 yystate = yydgoto[yym];
676 #if YYDEBUG
677 if (yydebug)
678 printf("%sdebug: after reduction, shifting from state %d \
679 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
680 #endif
681 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
682 *++yystack.s_mark = (YYINT) yystate;
683 *++yystack.l_mark = yyval;
684 goto yyloop;
685
686 yyoverflow:
687 YYERROR_CALL("yacc stack overflow");
688
689 yyabort:
690 yyfreestack(&yystack);
691 return (1);
692
693 yyaccept:
694 yyfreestack(&yystack);
695 return (0);
696 }
697