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