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