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