xref: /freebsd/contrib/byacc/test/btyacc/calc_code_imports.tab.c (revision 8ddb146abcdf061be9f2c0db7e391697dafad85c)
1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
4 
5 #define YYBYACC 1
6 #define YYMAJOR 1
7 #define YYMINOR 9
8 #define YYCHECK "yyyymmdd"
9 
10 #define YYEMPTY        (-1)
11 #define yyclearin      (yychar = YYEMPTY)
12 #define yyerrok        (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
14 #define YYENOMEM       (-2)
15 #define YYEOF          0
16 #undef YYBTYACC
17 #define YYBTYACC 0
18 #define YYDEBUGSTR YYPREFIX "debug"
19 
20 #ifndef yyparse
21 #define yyparse    calc_code_imports_parse
22 #endif /* yyparse */
23 
24 #ifndef yylex
25 #define yylex      calc_code_imports_lex
26 #endif /* yylex */
27 
28 #ifndef yyerror
29 #define yyerror    calc_code_imports_error
30 #endif /* yyerror */
31 
32 #ifndef yychar
33 #define yychar     calc_code_imports_char
34 #endif /* yychar */
35 
36 #ifndef yyval
37 #define yyval      calc_code_imports_val
38 #endif /* yyval */
39 
40 #ifndef yylval
41 #define yylval     calc_code_imports_lval
42 #endif /* yylval */
43 
44 #ifndef yydebug
45 #define yydebug    calc_code_imports_debug
46 #endif /* yydebug */
47 
48 #ifndef yynerrs
49 #define yynerrs    calc_code_imports_nerrs
50 #endif /* yynerrs */
51 
52 #ifndef yyerrflag
53 #define yyerrflag  calc_code_imports_errflag
54 #endif /* yyerrflag */
55 
56 #ifndef yylhs
57 #define yylhs      calc_code_imports_lhs
58 #endif /* yylhs */
59 
60 #ifndef yylen
61 #define yylen      calc_code_imports_len
62 #endif /* yylen */
63 
64 #ifndef yydefred
65 #define yydefred   calc_code_imports_defred
66 #endif /* yydefred */
67 
68 #ifndef yystos
69 #define yystos     calc_code_imports_stos
70 #endif /* yystos */
71 
72 #ifndef yydgoto
73 #define yydgoto    calc_code_imports_dgoto
74 #endif /* yydgoto */
75 
76 #ifndef yysindex
77 #define yysindex   calc_code_imports_sindex
78 #endif /* yysindex */
79 
80 #ifndef yyrindex
81 #define yyrindex   calc_code_imports_rindex
82 #endif /* yyrindex */
83 
84 #ifndef yygindex
85 #define yygindex   calc_code_imports_gindex
86 #endif /* yygindex */
87 
88 #ifndef yytable
89 #define yytable    calc_code_imports_table
90 #endif /* yytable */
91 
92 #ifndef yycheck
93 #define yycheck    calc_code_imports_check
94 #endif /* yycheck */
95 
96 #ifndef yyname
97 #define yyname     calc_code_imports_name
98 #endif /* yyname */
99 
100 #ifndef yyrule
101 #define yyrule     calc_code_imports_rule
102 #endif /* yyrule */
103 
104 #if YYBTYACC
105 
106 #ifndef yycindex
107 #define yycindex   calc_code_imports_cindex
108 #endif /* yycindex */
109 
110 #ifndef yyctable
111 #define yyctable   calc_code_imports_ctable
112 #endif /* yyctable */
113 
114 #endif /* YYBTYACC */
115 
116 #define YYPREFIX "calc_code_imports_"
117 
118 #define YYPURE 0
119 
120 #line 5 "calc_code_imports.y"
121 # include <stdio.h>
122 # include <ctype.h>
123 
124 int regs[26];
125 int base;
126 
127 extern int yylex(void);
128 static void yyerror(const char *s);
129 
130 #line 131 "calc_code_imports.tab.c"
131 
132 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
133 /* Default: YYSTYPE is the semantic value type. */
134 typedef int YYSTYPE;
135 # define YYSTYPE_IS_DECLARED 1
136 #endif
137 
138 /* compatibility with bison */
139 #ifdef YYPARSE_PARAM
140 /* compatibility with FreeBSD */
141 # ifdef YYPARSE_PARAM_TYPE
142 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
143 # else
144 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
145 # endif
146 #else
147 # define YYPARSE_DECL() yyparse(void)
148 #endif
149 
150 /* Parameters sent to lex. */
151 #ifdef YYLEX_PARAM
152 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
153 # define YYLEX yylex(YYLEX_PARAM)
154 #else
155 # define YYLEX_DECL() yylex(void)
156 # define YYLEX yylex()
157 #endif
158 
159 /* Parameters sent to yyerror. */
160 #ifndef YYERROR_DECL
161 #define YYERROR_DECL() yyerror(const char *s)
162 #endif
163 #ifndef YYERROR_CALL
164 #define YYERROR_CALL(msg) yyerror(msg)
165 #endif
166 
167 extern int YYPARSE_DECL();
168 
169 #define DIGIT 257
170 #define LETTER 258
171 #define UMINUS 259
172 #define YYERRCODE 256
173 typedef int YYINT;
174 static const YYINT calc_code_imports_lhs[] = {           -1,
175     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
176     2,    2,    2,    2,    2,    2,    3,    3,
177 };
178 static const YYINT calc_code_imports_len[] = {            2,
179     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
180     3,    3,    3,    2,    1,    1,    1,    2,
181 };
182 static const YYINT calc_code_imports_defred[] = {         1,
183     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
184     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
185     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
186    10,   11,
187 };
188 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
189 static const YYINT calc_code_imports_stos[] = {           0,
190   261,  256,  257,  258,   45,   40,  262,  263,  264,   10,
191    61,  258,  263,  263,   10,  124,   38,   43,   45,   42,
192    47,   37,  257,  263,   41,  263,  263,  263,  263,  263,
193   263,  263,
194 };
195 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
196 static const YYINT calc_code_imports_dgoto[] = {          1,
197     7,    8,    9,
198 };
199 static const YYINT calc_code_imports_sindex[] = {         0,
200   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
201   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
202   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
203     0,    0,
204 };
205 static const YYINT calc_code_imports_rindex[] = {         0,
206     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
207     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
208     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
209     0,    0,
210 };
211 #if YYBTYACC
212 static const YYINT calc_code_imports_cindex[] = {         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,
217 };
218 #endif
219 static const YYINT calc_code_imports_gindex[] = {         0,
220     0,   65,    0,
221 };
222 #define YYTABLESIZE 220
223 static const YYINT calc_code_imports_table[] = {          6,
224    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
225    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
226     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
227     0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
228     0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
229     8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
230     0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
231    14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
232    26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
233     0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
234     0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
235     0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
236     0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
237     0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
238     0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
239     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
240     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
241     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
242     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
243     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
244     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
245     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
246 };
247 static const YYINT calc_code_imports_check[] = {         40,
248    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
249    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
250    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
251    -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
252    -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
253    38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
254    -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
255     6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
256    16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
257    -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
258    -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
259    -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
260    -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
261    -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
262    -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
263    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
264    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
265    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
266    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
267    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
268    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
269    -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
270 };
271 #if YYBTYACC
272 static const YYINT calc_code_imports_ctable[] = {        -1,
273    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
274    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
275    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
276    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
277    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
278    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
279    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
280    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
281    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
282    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
283    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
284    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
285    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
286    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
287    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
288    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
289    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
290    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
291    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
292    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
293    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
294    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
295 };
296 #endif
297 #define YYFINAL 1
298 #ifndef YYDEBUG
299 #define YYDEBUG 0
300 #endif
301 #define YYMAXTOKEN 259
302 #define YYUNDFTOKEN 265
303 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
304 #if YYDEBUG
305 static const char *const calc_code_imports_name[] = {
306 
307 "$end",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,0,0,0,
308 0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,
309 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,
310 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,
311 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,
312 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,
313 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,
314 0,0,"error","DIGIT","LETTER","UMINUS","$accept","list","stat","expr","number",
315 "illegal-symbol",
316 };
317 static const char *const calc_code_imports_rule[] = {
318 "$accept : list",
319 "list :",
320 "list : list stat '\\n'",
321 "list : list error '\\n'",
322 "stat : expr",
323 "stat : LETTER '=' expr",
324 "expr : '(' expr ')'",
325 "expr : expr '+' expr",
326 "expr : expr '-' expr",
327 "expr : expr '*' expr",
328 "expr : expr '/' expr",
329 "expr : expr '%' expr",
330 "expr : expr '&' expr",
331 "expr : expr '|' expr",
332 "expr : '-' expr",
333 "expr : LETTER",
334 "expr : number",
335 "number : DIGIT",
336 "number : number DIGIT",
337 
338 };
339 #endif
340 
341 #if YYDEBUG
342 int      yydebug;
343 #endif
344 
345 int      yyerrflag;
346 int      yychar;
347 YYSTYPE  yyval;
348 YYSTYPE  yylval;
349 int      yynerrs;
350 
351 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
352 YYLTYPE  yyloc; /* position returned by actions */
353 YYLTYPE  yylloc; /* position from the lexer */
354 #endif
355 
356 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
357 #ifndef YYLLOC_DEFAULT
358 #define YYLLOC_DEFAULT(loc, rhs, n) \
359 do \
360 { \
361     if (n == 0) \
362     { \
363         (loc).first_line   = YYRHSLOC(rhs, 0).last_line; \
364         (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
365         (loc).last_line    = YYRHSLOC(rhs, 0).last_line; \
366         (loc).last_column  = YYRHSLOC(rhs, 0).last_column; \
367     } \
368     else \
369     { \
370         (loc).first_line   = YYRHSLOC(rhs, 1).first_line; \
371         (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
372         (loc).last_line    = YYRHSLOC(rhs, n).last_line; \
373         (loc).last_column  = YYRHSLOC(rhs, n).last_column; \
374     } \
375 } while (0)
376 #endif /* YYLLOC_DEFAULT */
377 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
378 #if YYBTYACC
379 
380 #ifndef YYLVQUEUEGROWTH
381 #define YYLVQUEUEGROWTH 32
382 #endif
383 #endif /* YYBTYACC */
384 
385 /* define the initial stack-sizes */
386 #ifdef YYSTACKSIZE
387 #undef YYMAXDEPTH
388 #define YYMAXDEPTH  YYSTACKSIZE
389 #else
390 #ifdef YYMAXDEPTH
391 #define YYSTACKSIZE YYMAXDEPTH
392 #else
393 #define YYSTACKSIZE 10000
394 #define YYMAXDEPTH  10000
395 #endif
396 #endif
397 
398 #ifndef YYINITSTACKSIZE
399 #define YYINITSTACKSIZE 200
400 #endif
401 
402 typedef struct {
403     unsigned stacksize;
404     YYINT    *s_base;
405     YYINT    *s_mark;
406     YYINT    *s_last;
407     YYSTYPE  *l_base;
408     YYSTYPE  *l_mark;
409 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
410     YYLTYPE  *p_base;
411     YYLTYPE  *p_mark;
412 #endif
413 } YYSTACKDATA;
414 #if YYBTYACC
415 
416 struct YYParseState_s
417 {
418     struct YYParseState_s *save;    /* Previously saved parser state */
419     YYSTACKDATA            yystack; /* saved parser stack */
420     int                    state;   /* saved parser state */
421     int                    errflag; /* saved error recovery status */
422     int                    lexeme;  /* saved index of the conflict lexeme in the lexical queue */
423     YYINT                  ctry;    /* saved index in yyctable[] for this conflict */
424 };
425 typedef struct YYParseState_s YYParseState;
426 #endif /* YYBTYACC */
427 /* variables for the parser stack */
428 static YYSTACKDATA yystack;
429 #if YYBTYACC
430 
431 /* Current parser state */
432 static YYParseState *yyps = 0;
433 
434 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
435 static YYParseState *yypath = 0;
436 
437 /* Base of the lexical value queue */
438 static YYSTYPE *yylvals = 0;
439 
440 /* Current position at lexical value queue */
441 static YYSTYPE *yylvp = 0;
442 
443 /* End position of lexical value queue */
444 static YYSTYPE *yylve = 0;
445 
446 /* The last allocated position at the lexical value queue */
447 static YYSTYPE *yylvlim = 0;
448 
449 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
450 /* Base of the lexical position queue */
451 static YYLTYPE *yylpsns = 0;
452 
453 /* Current position at lexical position queue */
454 static YYLTYPE *yylpp = 0;
455 
456 /* End position of lexical position queue */
457 static YYLTYPE *yylpe = 0;
458 
459 /* The last allocated position at the lexical position queue */
460 static YYLTYPE *yylplim = 0;
461 #endif
462 
463 /* Current position at lexical token queue */
464 static YYINT  *yylexp = 0;
465 
466 static YYINT  *yylexemes = 0;
467 #endif /* YYBTYACC */
468 #line 69 "calc_code_imports.y"
469  /* start of programs */
470 
471 int
472 main (void)
473 {
474     while(!feof(stdin)) {
475 	yyparse();
476     }
477     return 0;
478 }
479 
480 static void
481 yyerror(const char *s)
482 {
483     fprintf(stderr, "%s\n", s);
484 }
485 
486 int
487 yylex(void)
488 {
489 	/* lexical analysis routine */
490 	/* returns LETTER for a lower case letter, yylval = 0 through 25 */
491 	/* return DIGIT for a digit, yylval = 0 through 9 */
492 	/* all other characters are returned immediately */
493 
494     int c;
495 
496     while( (c=getchar()) == ' ' )   { /* skip blanks */ }
497 
498     /* c is now nonblank */
499 
500     if( islower( c )) {
501 	yylval = c - 'a';
502 	return ( LETTER );
503     }
504     if( isdigit( c )) {
505 	yylval = c - '0';
506 	return ( DIGIT );
507     }
508     return( c );
509 }
510 #line 511 "calc_code_imports.tab.c"
511 
512 /* For use in generated program */
513 #define yydepth (int)(yystack.s_mark - yystack.s_base)
514 #if YYBTYACC
515 #define yytrial (yyps->save)
516 #endif /* YYBTYACC */
517 
518 #if YYDEBUG
519 #include <stdio.h>	/* needed for printf */
520 #endif
521 
522 #include <stdlib.h>	/* needed for malloc, etc */
523 #include <string.h>	/* needed for memset */
524 
525 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
526 static int yygrowstack(YYSTACKDATA *data)
527 {
528     int i;
529     unsigned newsize;
530     YYINT *newss;
531     YYSTYPE *newvs;
532 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
533     YYLTYPE *newps;
534 #endif
535 
536     if ((newsize = data->stacksize) == 0)
537         newsize = YYINITSTACKSIZE;
538     else if (newsize >= YYMAXDEPTH)
539         return YYENOMEM;
540     else if ((newsize *= 2) > YYMAXDEPTH)
541         newsize = YYMAXDEPTH;
542 
543     i = (int) (data->s_mark - data->s_base);
544     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
545     if (newss == NULL)
546         return YYENOMEM;
547 
548     data->s_base = newss;
549     data->s_mark = newss + i;
550 
551     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
552     if (newvs == NULL)
553         return YYENOMEM;
554 
555     data->l_base = newvs;
556     data->l_mark = newvs + i;
557 
558 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
559     newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
560     if (newps == NULL)
561         return YYENOMEM;
562 
563     data->p_base = newps;
564     data->p_mark = newps + i;
565 #endif
566 
567     data->stacksize = newsize;
568     data->s_last = data->s_base + newsize - 1;
569 
570 #if YYDEBUG
571     if (yydebug)
572         fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
573 #endif
574     return 0;
575 }
576 
577 #if YYPURE || defined(YY_NO_LEAKS)
578 static void yyfreestack(YYSTACKDATA *data)
579 {
580     free(data->s_base);
581     free(data->l_base);
582 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
583     free(data->p_base);
584 #endif
585     memset(data, 0, sizeof(*data));
586 }
587 #else
588 #define yyfreestack(data) /* nothing */
589 #endif /* YYPURE || defined(YY_NO_LEAKS) */
590 #if YYBTYACC
591 
592 static YYParseState *
593 yyNewState(unsigned size)
594 {
595     YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
596     if (p == NULL) return NULL;
597 
598     p->yystack.stacksize = size;
599     if (size == 0)
600     {
601         p->yystack.s_base = NULL;
602         p->yystack.l_base = NULL;
603 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
604         p->yystack.p_base = NULL;
605 #endif
606         return p;
607     }
608     p->yystack.s_base    = (YYINT *) malloc(size * sizeof(YYINT));
609     if (p->yystack.s_base == NULL) return NULL;
610     p->yystack.l_base    = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
611     if (p->yystack.l_base == NULL) return NULL;
612     memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
613 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
614     p->yystack.p_base    = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
615     if (p->yystack.p_base == NULL) return NULL;
616     memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
617 #endif
618 
619     return p;
620 }
621 
622 static void
623 yyFreeState(YYParseState *p)
624 {
625     yyfreestack(&p->yystack);
626     free(p);
627 }
628 #endif /* YYBTYACC */
629 
630 #define YYABORT  goto yyabort
631 #define YYREJECT goto yyabort
632 #define YYACCEPT goto yyaccept
633 #define YYERROR  goto yyerrlab
634 #if YYBTYACC
635 #define YYVALID        do { if (yyps->save)            goto yyvalid; } while(0)
636 #define YYVALID_NESTED do { if (yyps->save && \
637                                 yyps->save->save == 0) goto yyvalid; } while(0)
638 #endif /* YYBTYACC */
639 
640 int
641 YYPARSE_DECL()
642 {
643     int yym, yyn, yystate, yyresult;
644 #if YYBTYACC
645     int yynewerrflag;
646     YYParseState *yyerrctx = NULL;
647 #endif /* YYBTYACC */
648 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
649     YYLTYPE  yyerror_loc_range[3]; /* position of error start/end (0 unused) */
650 #endif
651 #if YYDEBUG
652     const char *yys;
653 
654     if ((yys = getenv("YYDEBUG")) != NULL)
655     {
656         yyn = *yys;
657         if (yyn >= '0' && yyn <= '9')
658             yydebug = yyn - '0';
659     }
660     if (yydebug)
661         fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
662 #endif
663 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
664     memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
665 #endif
666 
667 #if YYBTYACC
668     yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
669     yyps->save = 0;
670 #endif /* YYBTYACC */
671     yym = 0;
672     yyn = 0;
673     yynerrs = 0;
674     yyerrflag = 0;
675     yychar = YYEMPTY;
676     yystate = 0;
677 
678 #if YYPURE
679     memset(&yystack, 0, sizeof(yystack));
680 #endif
681 
682     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
683     yystack.s_mark = yystack.s_base;
684     yystack.l_mark = yystack.l_base;
685 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
686     yystack.p_mark = yystack.p_base;
687 #endif
688     yystate = 0;
689     *yystack.s_mark = 0;
690 
691 yyloop:
692     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
693     if (yychar < 0)
694     {
695 #if YYBTYACC
696         do {
697         if (yylvp < yylve)
698         {
699             /* we're currently re-reading tokens */
700             yylval = *yylvp++;
701 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
702             yylloc = *yylpp++;
703 #endif
704             yychar = *yylexp++;
705             break;
706         }
707         if (yyps->save)
708         {
709             /* in trial mode; save scanner results for future parse attempts */
710             if (yylvp == yylvlim)
711             {   /* Enlarge lexical value queue */
712                 size_t p = (size_t) (yylvp - yylvals);
713                 size_t s = (size_t) (yylvlim - yylvals);
714 
715                 s += YYLVQUEUEGROWTH;
716                 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
717                 if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
718 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
719                 if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
720 #endif
721                 yylvp   = yylve = yylvals + p;
722                 yylvlim = yylvals + s;
723 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
724                 yylpp   = yylpe = yylpsns + p;
725                 yylplim = yylpsns + s;
726 #endif
727                 yylexp  = yylexemes + p;
728             }
729             *yylexp = (YYINT) YYLEX;
730             *yylvp++ = yylval;
731             yylve++;
732 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
733             *yylpp++ = yylloc;
734             yylpe++;
735 #endif
736             yychar = *yylexp++;
737             break;
738         }
739         /* normal operation, no conflict encountered */
740 #endif /* YYBTYACC */
741         yychar = YYLEX;
742 #if YYBTYACC
743         } while (0);
744 #endif /* YYBTYACC */
745         if (yychar < 0) yychar = YYEOF;
746 #if YYDEBUG
747         if (yydebug)
748         {
749             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
750             fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
751                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
752 #ifdef YYSTYPE_TOSTRING
753 #if YYBTYACC
754             if (!yytrial)
755 #endif /* YYBTYACC */
756                 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
757 #endif
758             fputc('\n', stderr);
759         }
760 #endif
761     }
762 #if YYBTYACC
763 
764     /* Do we have a conflict? */
765     if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
766         yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
767     {
768         YYINT ctry;
769 
770         if (yypath)
771         {
772             YYParseState *save;
773 #if YYDEBUG
774             if (yydebug)
775                 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
776                                 YYDEBUGSTR, yydepth, yystate);
777 #endif
778             /* Switch to the next conflict context */
779             save = yypath;
780             yypath = save->save;
781             save->save = NULL;
782             ctry = save->ctry;
783             if (save->state != yystate) YYABORT;
784             yyFreeState(save);
785 
786         }
787         else
788         {
789 
790             /* Unresolved conflict - start/continue trial parse */
791             YYParseState *save;
792 #if YYDEBUG
793             if (yydebug)
794             {
795                 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
796                 if (yyps->save)
797                     fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
798                 else
799                     fputs("Starting trial parse.\n", stderr);
800             }
801 #endif
802             save                  = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
803             if (save == NULL) goto yyenomem;
804             save->save            = yyps->save;
805             save->state           = yystate;
806             save->errflag         = yyerrflag;
807             save->yystack.s_mark  = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
808             memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
809             save->yystack.l_mark  = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
810             memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
811 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
812             save->yystack.p_mark  = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
813             memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
814 #endif
815             ctry                  = yytable[yyn];
816             if (yyctable[ctry] == -1)
817             {
818 #if YYDEBUG
819                 if (yydebug && yychar >= YYEOF)
820                     fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
821 #endif
822                 ctry++;
823             }
824             save->ctry = ctry;
825             if (yyps->save == NULL)
826             {
827                 /* If this is a first conflict in the stack, start saving lexemes */
828                 if (!yylexemes)
829                 {
830                     yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
831                     if (yylexemes == NULL) goto yyenomem;
832                     yylvals   = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
833                     if (yylvals == NULL) goto yyenomem;
834                     yylvlim   = yylvals + YYLVQUEUEGROWTH;
835 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
836                     yylpsns   = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
837                     if (yylpsns == NULL) goto yyenomem;
838                     yylplim   = yylpsns + YYLVQUEUEGROWTH;
839 #endif
840                 }
841                 if (yylvp == yylve)
842                 {
843                     yylvp  = yylve = yylvals;
844 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
845                     yylpp  = yylpe = yylpsns;
846 #endif
847                     yylexp = yylexemes;
848                     if (yychar >= YYEOF)
849                     {
850                         *yylve++ = yylval;
851 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
852                         *yylpe++ = yylloc;
853 #endif
854                         *yylexp  = (YYINT) yychar;
855                         yychar   = YYEMPTY;
856                     }
857                 }
858             }
859             if (yychar >= YYEOF)
860             {
861                 yylvp--;
862 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
863                 yylpp--;
864 #endif
865                 yylexp--;
866                 yychar = YYEMPTY;
867             }
868             save->lexeme = (int) (yylvp - yylvals);
869             yyps->save   = save;
870         }
871         if (yytable[yyn] == ctry)
872         {
873 #if YYDEBUG
874             if (yydebug)
875                 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
876                                 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
877 #endif
878             if (yychar < 0)
879             {
880                 yylvp++;
881 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
882                 yylpp++;
883 #endif
884                 yylexp++;
885             }
886             if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
887                 goto yyoverflow;
888             yystate = yyctable[ctry];
889             *++yystack.s_mark = (YYINT) yystate;
890             *++yystack.l_mark = yylval;
891 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
892             *++yystack.p_mark = yylloc;
893 #endif
894             yychar  = YYEMPTY;
895             if (yyerrflag > 0) --yyerrflag;
896             goto yyloop;
897         }
898         else
899         {
900             yyn = yyctable[ctry];
901             goto yyreduce;
902         }
903     } /* End of code dealing with conflicts */
904 #endif /* YYBTYACC */
905     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
906             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
907     {
908 #if YYDEBUG
909         if (yydebug)
910             fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
911                             YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
912 #endif
913         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
914         yystate = yytable[yyn];
915         *++yystack.s_mark = yytable[yyn];
916         *++yystack.l_mark = yylval;
917 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
918         *++yystack.p_mark = yylloc;
919 #endif
920         yychar = YYEMPTY;
921         if (yyerrflag > 0)  --yyerrflag;
922         goto yyloop;
923     }
924     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
925             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
926     {
927         yyn = yytable[yyn];
928         goto yyreduce;
929     }
930     if (yyerrflag != 0) goto yyinrecovery;
931 #if YYBTYACC
932 
933     yynewerrflag = 1;
934     goto yyerrhandler;
935     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
936 
937 yyerrlab:
938     /* explicit YYERROR from an action -- pop the rhs of the rule reduced
939      * before looking for error recovery */
940     yystack.s_mark -= yym;
941     yystate = *yystack.s_mark;
942     yystack.l_mark -= yym;
943 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
944     yystack.p_mark -= yym;
945 #endif
946 
947     yynewerrflag = 0;
948 yyerrhandler:
949     while (yyps->save)
950     {
951         int ctry;
952         YYParseState *save = yyps->save;
953 #if YYDEBUG
954         if (yydebug)
955             fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
956                             YYDEBUGSTR, yydepth, yystate, yyps->save->state,
957                     (int)(yylvp - yylvals - yyps->save->lexeme));
958 #endif
959         /* Memorize most forward-looking error state in case it's really an error. */
960         if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
961         {
962             /* Free old saved error context state */
963             if (yyerrctx) yyFreeState(yyerrctx);
964             /* Create and fill out new saved error context state */
965             yyerrctx                 = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
966             if (yyerrctx == NULL) goto yyenomem;
967             yyerrctx->save           = yyps->save;
968             yyerrctx->state          = yystate;
969             yyerrctx->errflag        = yyerrflag;
970             yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
971             memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
972             yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
973             memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
974 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
975             yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
976             memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
977 #endif
978             yyerrctx->lexeme         = (int) (yylvp - yylvals);
979         }
980         yylvp          = yylvals   + save->lexeme;
981 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
982         yylpp          = yylpsns   + save->lexeme;
983 #endif
984         yylexp         = yylexemes + save->lexeme;
985         yychar         = YYEMPTY;
986         yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
987         memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
988         yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
989         memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
990 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
991         yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
992         memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
993 #endif
994         ctry           = ++save->ctry;
995         yystate        = save->state;
996         /* We tried shift, try reduce now */
997         if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
998         yyps->save     = save->save;
999         save->save     = NULL;
1000         yyFreeState(save);
1001 
1002         /* Nothing left on the stack -- error */
1003         if (!yyps->save)
1004         {
1005 #if YYDEBUG
1006             if (yydebug)
1007                 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1008                                 YYPREFIX, yydepth);
1009 #endif
1010             /* Restore state as it was in the most forward-advanced error */
1011             yylvp          = yylvals   + yyerrctx->lexeme;
1012 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1013             yylpp          = yylpsns   + yyerrctx->lexeme;
1014 #endif
1015             yylexp         = yylexemes + yyerrctx->lexeme;
1016             yychar         = yylexp[-1];
1017             yylval         = yylvp[-1];
1018 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1019             yylloc         = yylpp[-1];
1020 #endif
1021             yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1022             memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1023             yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1024             memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1025 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1026             yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1027             memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1028 #endif
1029             yystate        = yyerrctx->state;
1030             yyFreeState(yyerrctx);
1031             yyerrctx       = NULL;
1032         }
1033         yynewerrflag = 1;
1034     }
1035     if (yynewerrflag == 0) goto yyinrecovery;
1036 #endif /* YYBTYACC */
1037 
1038     YYERROR_CALL("syntax error");
1039 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1040     yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
1041 #endif
1042 
1043 #if !YYBTYACC
1044     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1045 yyerrlab:
1046 #endif
1047     ++yynerrs;
1048 
1049 yyinrecovery:
1050     if (yyerrflag < 3)
1051     {
1052         yyerrflag = 3;
1053         for (;;)
1054         {
1055             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1056                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1057             {
1058 #if YYDEBUG
1059                 if (yydebug)
1060                     fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1061                                     YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1062 #endif
1063                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1064                 yystate = yytable[yyn];
1065                 *++yystack.s_mark = yytable[yyn];
1066                 *++yystack.l_mark = yylval;
1067 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1068                 /* lookahead position is error end position */
1069                 yyerror_loc_range[2] = yylloc;
1070                 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1071                 *++yystack.p_mark = yyloc;
1072 #endif
1073                 goto yyloop;
1074             }
1075             else
1076             {
1077 #if YYDEBUG
1078                 if (yydebug)
1079                     fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1080                                     YYDEBUGSTR, yydepth, *yystack.s_mark);
1081 #endif
1082                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1083 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1084                 /* the current TOS position is the error start position */
1085                 yyerror_loc_range[1] = *yystack.p_mark;
1086 #endif
1087 #if defined(YYDESTRUCT_CALL)
1088 #if YYBTYACC
1089                 if (!yytrial)
1090 #endif /* YYBTYACC */
1091 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1092                     YYDESTRUCT_CALL("error: discarding state",
1093                                     yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1094 #else
1095                     YYDESTRUCT_CALL("error: discarding state",
1096                                     yystos[*yystack.s_mark], yystack.l_mark);
1097 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1098 #endif /* defined(YYDESTRUCT_CALL) */
1099                 --yystack.s_mark;
1100                 --yystack.l_mark;
1101 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1102                 --yystack.p_mark;
1103 #endif
1104             }
1105         }
1106     }
1107     else
1108     {
1109         if (yychar == YYEOF) goto yyabort;
1110 #if YYDEBUG
1111         if (yydebug)
1112         {
1113             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1114             fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1115                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
1116         }
1117 #endif
1118 #if defined(YYDESTRUCT_CALL)
1119 #if YYBTYACC
1120         if (!yytrial)
1121 #endif /* YYBTYACC */
1122 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1123             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1124 #else
1125             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1126 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1127 #endif /* defined(YYDESTRUCT_CALL) */
1128         yychar = YYEMPTY;
1129         goto yyloop;
1130     }
1131 
1132 yyreduce:
1133     yym = yylen[yyn];
1134 #if YYDEBUG
1135     if (yydebug)
1136     {
1137         fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1138                         YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1139 #ifdef YYSTYPE_TOSTRING
1140 #if YYBTYACC
1141         if (!yytrial)
1142 #endif /* YYBTYACC */
1143             if (yym > 0)
1144             {
1145                 int i;
1146                 fputc('<', stderr);
1147                 for (i = yym; i > 0; i--)
1148                 {
1149                     if (i != yym) fputs(", ", stderr);
1150                     fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1151                                            yystack.l_mark[1-i]), stderr);
1152                 }
1153                 fputc('>', stderr);
1154             }
1155 #endif
1156         fputc('\n', stderr);
1157     }
1158 #endif
1159     if (yym > 0)
1160         yyval = yystack.l_mark[1-yym];
1161     else
1162         memset(&yyval, 0, sizeof yyval);
1163 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1164 
1165     /* Perform position reduction */
1166     memset(&yyloc, 0, sizeof(yyloc));
1167 #if YYBTYACC
1168     if (!yytrial)
1169 #endif /* YYBTYACC */
1170     {
1171         YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
1172         /* just in case YYERROR is invoked within the action, save
1173            the start of the rhs as the error start position */
1174         yyerror_loc_range[1] = yystack.p_mark[1-yym];
1175     }
1176 #endif
1177 
1178     switch (yyn)
1179     {
1180 case 3:
1181 #line 31 "calc_code_imports.y"
1182 	{  yyerrok ; }
1183 break;
1184 case 4:
1185 #line 35 "calc_code_imports.y"
1186 	{  printf("%d\n",yystack.l_mark[0]);}
1187 break;
1188 case 5:
1189 #line 37 "calc_code_imports.y"
1190 	{  regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
1191 break;
1192 case 6:
1193 #line 41 "calc_code_imports.y"
1194 	{  yyval = yystack.l_mark[-1]; }
1195 break;
1196 case 7:
1197 #line 43 "calc_code_imports.y"
1198 	{  yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
1199 break;
1200 case 8:
1201 #line 45 "calc_code_imports.y"
1202 	{  yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
1203 break;
1204 case 9:
1205 #line 47 "calc_code_imports.y"
1206 	{  yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
1207 break;
1208 case 10:
1209 #line 49 "calc_code_imports.y"
1210 	{  yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
1211 break;
1212 case 11:
1213 #line 51 "calc_code_imports.y"
1214 	{  yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
1215 break;
1216 case 12:
1217 #line 53 "calc_code_imports.y"
1218 	{  yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
1219 break;
1220 case 13:
1221 #line 55 "calc_code_imports.y"
1222 	{  yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
1223 break;
1224 case 14:
1225 #line 57 "calc_code_imports.y"
1226 	{  yyval = - yystack.l_mark[0]; }
1227 break;
1228 case 15:
1229 #line 59 "calc_code_imports.y"
1230 	{  yyval = regs[yystack.l_mark[0]]; }
1231 break;
1232 case 17:
1233 #line 64 "calc_code_imports.y"
1234 	{  yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
1235 break;
1236 case 18:
1237 #line 66 "calc_code_imports.y"
1238 	{  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
1239 break;
1240 #line 1241 "calc_code_imports.tab.c"
1241     default:
1242         break;
1243     }
1244     yystack.s_mark -= yym;
1245     yystate = *yystack.s_mark;
1246     yystack.l_mark -= yym;
1247 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1248     yystack.p_mark -= yym;
1249 #endif
1250     yym = yylhs[yyn];
1251     if (yystate == 0 && yym == 0)
1252     {
1253 #if YYDEBUG
1254         if (yydebug)
1255         {
1256             fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1257 #ifdef YYSTYPE_TOSTRING
1258 #if YYBTYACC
1259             if (!yytrial)
1260 #endif /* YYBTYACC */
1261                 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1262 #endif
1263             fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1264         }
1265 #endif
1266         yystate = YYFINAL;
1267         *++yystack.s_mark = YYFINAL;
1268         *++yystack.l_mark = yyval;
1269 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1270         *++yystack.p_mark = yyloc;
1271 #endif
1272         if (yychar < 0)
1273         {
1274 #if YYBTYACC
1275             do {
1276             if (yylvp < yylve)
1277             {
1278                 /* we're currently re-reading tokens */
1279                 yylval = *yylvp++;
1280 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1281                 yylloc = *yylpp++;
1282 #endif
1283                 yychar = *yylexp++;
1284                 break;
1285             }
1286             if (yyps->save)
1287             {
1288                 /* in trial mode; save scanner results for future parse attempts */
1289                 if (yylvp == yylvlim)
1290                 {   /* Enlarge lexical value queue */
1291                     size_t p = (size_t) (yylvp - yylvals);
1292                     size_t s = (size_t) (yylvlim - yylvals);
1293 
1294                     s += YYLVQUEUEGROWTH;
1295                     if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
1296                         goto yyenomem;
1297                     if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1298                         goto yyenomem;
1299 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1300                     if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1301                         goto yyenomem;
1302 #endif
1303                     yylvp   = yylve = yylvals + p;
1304                     yylvlim = yylvals + s;
1305 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1306                     yylpp   = yylpe = yylpsns + p;
1307                     yylplim = yylpsns + s;
1308 #endif
1309                     yylexp  = yylexemes + p;
1310                 }
1311                 *yylexp = (YYINT) YYLEX;
1312                 *yylvp++ = yylval;
1313                 yylve++;
1314 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1315                 *yylpp++ = yylloc;
1316                 yylpe++;
1317 #endif
1318                 yychar = *yylexp++;
1319                 break;
1320             }
1321             /* normal operation, no conflict encountered */
1322 #endif /* YYBTYACC */
1323             yychar = YYLEX;
1324 #if YYBTYACC
1325             } while (0);
1326 #endif /* YYBTYACC */
1327             if (yychar < 0) yychar = YYEOF;
1328 #if YYDEBUG
1329             if (yydebug)
1330             {
1331                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1332                 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1333                                 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1334             }
1335 #endif
1336         }
1337         if (yychar == YYEOF) goto yyaccept;
1338         goto yyloop;
1339     }
1340     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1341             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1342         yystate = yytable[yyn];
1343     else
1344         yystate = yydgoto[yym];
1345 #if YYDEBUG
1346     if (yydebug)
1347     {
1348         fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1349 #ifdef YYSTYPE_TOSTRING
1350 #if YYBTYACC
1351         if (!yytrial)
1352 #endif /* YYBTYACC */
1353             fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1354 #endif
1355         fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1356     }
1357 #endif
1358     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1359     *++yystack.s_mark = (YYINT) yystate;
1360     *++yystack.l_mark = yyval;
1361 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1362     *++yystack.p_mark = yyloc;
1363 #endif
1364     goto yyloop;
1365 #if YYBTYACC
1366 
1367     /* Reduction declares that this path is valid. Set yypath and do a full parse */
1368 yyvalid:
1369     if (yypath) YYABORT;
1370     while (yyps->save)
1371     {
1372         YYParseState *save = yyps->save;
1373         yyps->save = save->save;
1374         save->save = yypath;
1375         yypath = save;
1376     }
1377 #if YYDEBUG
1378     if (yydebug)
1379         fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1380                         YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1381 #endif
1382     if (yyerrctx)
1383     {
1384         yyFreeState(yyerrctx);
1385         yyerrctx = NULL;
1386     }
1387     yylvp          = yylvals + yypath->lexeme;
1388 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1389     yylpp          = yylpsns + yypath->lexeme;
1390 #endif
1391     yylexp         = yylexemes + yypath->lexeme;
1392     yychar         = YYEMPTY;
1393     yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1394     memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1395     yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1396     memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1397 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1398     yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1399     memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1400 #endif
1401     yystate        = yypath->state;
1402     goto yyloop;
1403 #endif /* YYBTYACC */
1404 
1405 yyoverflow:
1406     YYERROR_CALL("yacc stack overflow");
1407 #if YYBTYACC
1408     goto yyabort_nomem;
1409 yyenomem:
1410     YYERROR_CALL("memory exhausted");
1411 yyabort_nomem:
1412 #endif /* YYBTYACC */
1413     yyresult = 2;
1414     goto yyreturn;
1415 
1416 yyabort:
1417     yyresult = 1;
1418     goto yyreturn;
1419 
1420 yyaccept:
1421 #if YYBTYACC
1422     if (yyps->save) goto yyvalid;
1423 #endif /* YYBTYACC */
1424     yyresult = 0;
1425 
1426 yyreturn:
1427 #if defined(YYDESTRUCT_CALL)
1428     if (yychar != YYEOF && yychar != YYEMPTY)
1429 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1430         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1431 #else
1432         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1433 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1434 
1435     {
1436         YYSTYPE *pv;
1437 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1438         YYLTYPE *pp;
1439 
1440         for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1441              YYDESTRUCT_CALL("cleanup: discarding state",
1442                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1443 #else
1444         for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1445              YYDESTRUCT_CALL("cleanup: discarding state",
1446                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1447 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1448     }
1449 #endif /* defined(YYDESTRUCT_CALL) */
1450 
1451 #if YYBTYACC
1452     if (yyerrctx)
1453     {
1454         yyFreeState(yyerrctx);
1455         yyerrctx = NULL;
1456     }
1457     while (yyps)
1458     {
1459         YYParseState *save = yyps;
1460         yyps = save->save;
1461         save->save = NULL;
1462         yyFreeState(save);
1463     }
1464     while (yypath)
1465     {
1466         YYParseState *save = yypath;
1467         yypath = save->save;
1468         save->save = NULL;
1469         yyFreeState(save);
1470     }
1471 #endif /* YYBTYACC */
1472     yyfreestack(&yystack);
1473     return (yyresult);
1474 }
1475