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