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