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