1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
8 #define YYCHECK "yyyymmdd"
11 #define yyclearin (yychar = YYEMPTY)
12 #define yyerrok (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
18 #define YYDEBUGSTR YYPREFIX "debug"
19 #line 20 "rename_debug.c"
20 #include "rename_debug.i"
21 #include "rename_debug.h"
23 static const YYINT yylhs[] = { -1,
26 static const YYINT yylen[] = { 2,
29 static const YYINT yydefred[] = { 0,
32 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
33 static const YYINT yystos[] = { 0,
36 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
37 static const YYINT yydgoto[] = { 2,
39 static const YYINT yysindex[] = { -256,
42 static const YYINT yyrindex[] = { 0,
46 static const YYINT yycindex[] = { 0,
50 static const YYINT yygindex[] = { 0,
53 static const YYINT yytable[] = { 1,
55 static const YYINT yycheck[] = { 256,
58 static const YYINT yyctable[] = { -1,
65 #define YYMAXTOKEN 256
66 #define YYUNDFTOKEN 259
67 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
69 static const char *const yyname[] = {
71 "$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,
72 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,
73 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,
74 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,
75 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,
76 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,
77 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","S","illegal-symbol",
79 static const char *const yyrule[] = {
96 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
97 YYLTYPE yyloc; /* position returned by actions */
98 YYLTYPE yylloc; /* position from the lexer */
101 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
102 #ifndef YYLLOC_DEFAULT
103 #define YYLLOC_DEFAULT(loc, rhs, n) \
108 (loc).first_line = YYRHSLOC(rhs, 0).last_line; \
109 (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
110 (loc).last_line = YYRHSLOC(rhs, 0).last_line; \
111 (loc).last_column = YYRHSLOC(rhs, 0).last_column; \
115 (loc).first_line = YYRHSLOC(rhs, 1).first_line; \
116 (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
117 (loc).last_line = YYRHSLOC(rhs, n).last_line; \
118 (loc).last_column = YYRHSLOC(rhs, n).last_column; \
121 #endif /* YYLLOC_DEFAULT */
122 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
125 #ifndef YYLVQUEUEGROWTH
126 #define YYLVQUEUEGROWTH 32
128 #endif /* YYBTYACC */
130 /* define the initial stack-sizes */
133 #define YYMAXDEPTH YYSTACKSIZE
136 #define YYSTACKSIZE YYMAXDEPTH
138 #define YYSTACKSIZE 10000
139 #define YYMAXDEPTH 10000
143 #ifndef YYINITSTACKSIZE
144 #define YYINITSTACKSIZE 200
154 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
161 struct YYParseState_s
163 struct YYParseState_s *save; /* Previously saved parser state */
164 YYSTACKDATA yystack; /* saved parser stack */
165 int state; /* saved parser state */
166 int errflag; /* saved error recovery status */
167 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
168 YYINT ctry; /* saved index in yyctable[] for this conflict */
170 typedef struct YYParseState_s YYParseState;
171 #endif /* YYBTYACC */
172 /* variables for the parser stack */
173 static YYSTACKDATA yystack;
176 /* Current parser state */
177 static YYParseState *yyps = 0;
179 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
180 static YYParseState *yypath = 0;
182 /* Base of the lexical value queue */
183 static YYSTYPE *yylvals = 0;
185 /* Current position at lexical value queue */
186 static YYSTYPE *yylvp = 0;
188 /* End position of lexical value queue */
189 static YYSTYPE *yylve = 0;
191 /* The last allocated position at the lexical value queue */
192 static YYSTYPE *yylvlim = 0;
194 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
195 /* Base of the lexical position queue */
196 static YYLTYPE *yylpsns = 0;
198 /* Current position at lexical position queue */
199 static YYLTYPE *yylpp = 0;
201 /* End position of lexical position queue */
202 static YYLTYPE *yylpe = 0;
204 /* The last allocated position at the lexical position queue */
205 static YYLTYPE *yylplim = 0;
208 /* Current position at lexical token queue */
209 static YYINT *yylexp = 0;
211 static YYINT *yylexemes = 0;
212 #endif /* YYBTYACC */
213 #line 12 "code_debug.y"
218 extern int YYLEX_DECL();
224 printf("yyparse() = %d\n", yyparse());
235 yyerror(const char* s)
239 #line 241 "rename_debug.c"
241 /* For use in generated program */
242 #define yydepth (int)(yystack.s_mark - yystack.s_base)
244 #define yytrial (yyps->save)
245 #endif /* YYBTYACC */
248 #include <stdio.h> /* needed for printf */
251 #include <stdlib.h> /* needed for malloc, etc */
252 #include <string.h> /* needed for memset */
254 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
255 static int yygrowstack(YYSTACKDATA *data)
261 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
265 if ((newsize = data->stacksize) == 0)
266 newsize = YYINITSTACKSIZE;
267 else if (newsize >= YYMAXDEPTH)
269 else if ((newsize *= 2) > YYMAXDEPTH)
270 newsize = YYMAXDEPTH;
272 i = (int) (data->s_mark - data->s_base);
273 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
277 data->s_base = newss;
278 data->s_mark = newss + i;
280 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
284 data->l_base = newvs;
285 data->l_mark = newvs + i;
287 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
288 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
292 data->p_base = newps;
293 data->p_mark = newps + i;
296 data->stacksize = newsize;
297 data->s_last = data->s_base + newsize - 1;
301 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
306 #if YYPURE || defined(YY_NO_LEAKS)
307 static void yyfreestack(YYSTACKDATA *data)
311 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
314 memset(data, 0, sizeof(*data));
317 #define yyfreestack(data) /* nothing */
318 #endif /* YYPURE || defined(YY_NO_LEAKS) */
321 static YYParseState *
322 yyNewState(unsigned size)
324 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
325 if (p == NULL) return NULL;
327 p->yystack.stacksize = size;
330 p->yystack.s_base = NULL;
331 p->yystack.l_base = NULL;
332 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
333 p->yystack.p_base = NULL;
337 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
338 if (p->yystack.s_base == NULL) return NULL;
339 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
340 if (p->yystack.l_base == NULL) return NULL;
341 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
342 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
343 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
344 if (p->yystack.p_base == NULL) return NULL;
345 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
352 yyFreeState(YYParseState *p)
354 yyfreestack(&p->yystack);
357 #endif /* YYBTYACC */
359 #define YYABORT goto yyabort
360 #define YYREJECT goto yyabort
361 #define YYACCEPT goto yyaccept
362 #define YYERROR goto yyerrlab
364 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
365 #define YYVALID_NESTED do { if (yyps->save && \
366 yyps->save->save == 0) goto yyvalid; } while(0)
367 #endif /* YYBTYACC */
372 int yym, yyn, yystate, yyresult;
375 YYParseState *yyerrctx = NULL;
376 #endif /* YYBTYACC */
377 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
378 YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */
383 if ((yys = getenv("YYDEBUG")) != 0)
386 if (yyn >= '0' && yyn <= '9')
390 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
392 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
393 memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
397 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
399 #endif /* YYBTYACC */
408 memset(&yystack, 0, sizeof(yystack));
411 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
412 yystack.s_mark = yystack.s_base;
413 yystack.l_mark = yystack.l_base;
414 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
415 yystack.p_mark = yystack.p_base;
421 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
428 /* we're currently re-reading tokens */
430 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
438 /* in trial mode; save scanner results for future parse attempts */
439 if (yylvp == yylvlim)
440 { /* Enlarge lexical value queue */
441 size_t p = (size_t) (yylvp - yylvals);
442 size_t s = (size_t) (yylvlim - yylvals);
444 s += YYLVQUEUEGROWTH;
445 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
446 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
447 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
448 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
450 yylvp = yylve = yylvals + p;
451 yylvlim = yylvals + s;
452 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
453 yylpp = yylpe = yylpsns + p;
454 yylplim = yylpsns + s;
456 yylexp = yylexemes + p;
458 *yylexp = (YYINT) YYLEX;
461 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
468 /* normal operation, no conflict encountered */
469 #endif /* YYBTYACC */
473 #endif /* YYBTYACC */
474 if (yychar < 0) yychar = YYEOF;
478 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
479 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
480 YYDEBUGSTR, yydepth, yystate, yychar, yys);
481 #ifdef YYSTYPE_TOSTRING
484 #endif /* YYBTYACC */
485 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
493 /* Do we have a conflict? */
494 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
495 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
504 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
505 YYDEBUGSTR, yydepth, yystate);
507 /* Switch to the next conflict context */
512 if (save->state != yystate) YYABORT;
519 /* Unresolved conflict - start/continue trial parse */
524 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
526 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
528 fputs("Starting trial parse.\n", stderr);
531 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
532 if (save == NULL) goto yyenomem;
533 save->save = yyps->save;
534 save->state = yystate;
535 save->errflag = yyerrflag;
536 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
537 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
538 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
539 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
540 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
541 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
542 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
545 if (yyctable[ctry] == -1)
548 if (yydebug && yychar >= YYEOF)
549 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
554 if (yyps->save == NULL)
556 /* If this is a first conflict in the stack, start saving lexemes */
559 yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
560 if (yylexemes == NULL) goto yyenomem;
561 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
562 if (yylvals == NULL) goto yyenomem;
563 yylvlim = yylvals + YYLVQUEUEGROWTH;
564 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
565 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
566 if (yylpsns == NULL) goto yyenomem;
567 yylplim = yylpsns + YYLVQUEUEGROWTH;
572 yylvp = yylve = yylvals;
573 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
574 yylpp = yylpe = yylpsns;
580 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
583 *yylexp = (YYINT) yychar;
591 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
597 save->lexeme = (int) (yylvp - yylvals);
600 if (yytable[yyn] == ctry)
604 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
605 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
610 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
615 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
617 yystate = yyctable[ctry];
618 *++yystack.s_mark = (YYINT) yystate;
619 *++yystack.l_mark = yylval;
620 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
621 *++yystack.p_mark = yylloc;
624 if (yyerrflag > 0) --yyerrflag;
629 yyn = yyctable[ctry];
632 } /* End of code dealing with conflicts */
633 #endif /* YYBTYACC */
634 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
635 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
639 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
640 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
642 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
643 yystate = yytable[yyn];
644 *++yystack.s_mark = yytable[yyn];
645 *++yystack.l_mark = yylval;
646 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
647 *++yystack.p_mark = yylloc;
650 if (yyerrflag > 0) --yyerrflag;
653 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
654 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
659 if (yyerrflag != 0) goto yyinrecovery;
664 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
667 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
668 * before looking for error recovery */
669 yystack.s_mark -= yym;
670 yystate = *yystack.s_mark;
671 yystack.l_mark -= yym;
672 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
673 yystack.p_mark -= yym;
681 YYParseState *save = yyps->save;
684 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
685 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
686 (int)(yylvp - yylvals - yyps->save->lexeme));
688 /* Memorize most forward-looking error state in case it's really an error. */
689 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
691 /* Free old saved error context state */
692 if (yyerrctx) yyFreeState(yyerrctx);
693 /* Create and fill out new saved error context state */
694 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
695 if (yyerrctx == NULL) goto yyenomem;
696 yyerrctx->save = yyps->save;
697 yyerrctx->state = yystate;
698 yyerrctx->errflag = yyerrflag;
699 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
700 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
701 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
702 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
703 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
704 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
705 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
707 yyerrctx->lexeme = (int) (yylvp - yylvals);
709 yylvp = yylvals + save->lexeme;
710 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
711 yylpp = yylpsns + save->lexeme;
713 yylexp = yylexemes + save->lexeme;
715 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
716 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
717 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
718 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
719 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
720 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
721 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
724 yystate = save->state;
725 /* We tried shift, try reduce now */
726 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
727 yyps->save = save->save;
731 /* Nothing left on the stack -- error */
736 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
739 /* Restore state as it was in the most forward-advanced error */
740 yylvp = yylvals + yyerrctx->lexeme;
741 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
742 yylpp = yylpsns + yyerrctx->lexeme;
744 yylexp = yylexemes + yyerrctx->lexeme;
747 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
750 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
751 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
752 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
753 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
754 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
755 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
756 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
758 yystate = yyerrctx->state;
759 yyFreeState(yyerrctx);
764 if (yynewerrflag == 0) goto yyinrecovery;
765 #endif /* YYBTYACC */
767 YYERROR_CALL("syntax error");
768 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
769 yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
773 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
784 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
785 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
789 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
790 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
792 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
793 yystate = yytable[yyn];
794 *++yystack.s_mark = yytable[yyn];
795 *++yystack.l_mark = yylval;
796 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
797 /* lookahead position is error end position */
798 yyerror_loc_range[2] = yylloc;
799 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
800 *++yystack.p_mark = yyloc;
808 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
809 YYDEBUGSTR, yydepth, *yystack.s_mark);
811 if (yystack.s_mark <= yystack.s_base) goto yyabort;
812 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
813 /* the current TOS position is the error start position */
814 yyerror_loc_range[1] = *yystack.p_mark;
816 #if defined(YYDESTRUCT_CALL)
819 #endif /* YYBTYACC */
820 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
821 YYDESTRUCT_CALL("error: discarding state",
822 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
824 YYDESTRUCT_CALL("error: discarding state",
825 yystos[*yystack.s_mark], yystack.l_mark);
826 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
827 #endif /* defined(YYDESTRUCT_CALL) */
830 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
838 if (yychar == YYEOF) goto yyabort;
842 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
843 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
844 YYDEBUGSTR, yydepth, yystate, yychar, yys);
847 #if defined(YYDESTRUCT_CALL)
850 #endif /* YYBTYACC */
851 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
852 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
854 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
855 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
856 #endif /* defined(YYDESTRUCT_CALL) */
866 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
867 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
868 #ifdef YYSTYPE_TOSTRING
871 #endif /* YYBTYACC */
876 for (i = yym; i > 0; i--)
878 if (i != yym) fputs(", ", stderr);
879 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
880 yystack.l_mark[1-i]), stderr);
889 yyval = yystack.l_mark[1-yym];
891 memset(&yyval, 0, sizeof yyval);
892 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
894 /* Perform position reduction */
895 memset(&yyloc, 0, sizeof(yyloc));
898 #endif /* YYBTYACC */
900 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
901 /* just in case YYERROR is invoked within the action, save
902 the start of the rhs as the error start position */
903 yyerror_loc_range[1] = yystack.p_mark[1-yym];
912 yystack.s_mark -= yym;
913 yystate = *yystack.s_mark;
914 yystack.l_mark -= yym;
915 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
916 yystack.p_mark -= yym;
919 if (yystate == 0 && yym == 0)
924 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
925 #ifdef YYSTYPE_TOSTRING
928 #endif /* YYBTYACC */
929 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
931 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
935 *++yystack.s_mark = YYFINAL;
936 *++yystack.l_mark = yyval;
937 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
938 *++yystack.p_mark = yyloc;
946 /* we're currently re-reading tokens */
948 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
956 /* in trial mode; save scanner results for future parse attempts */
957 if (yylvp == yylvlim)
958 { /* Enlarge lexical value queue */
959 size_t p = (size_t) (yylvp - yylvals);
960 size_t s = (size_t) (yylvlim - yylvals);
962 s += YYLVQUEUEGROWTH;
963 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
965 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
967 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
968 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
971 yylvp = yylve = yylvals + p;
972 yylvlim = yylvals + s;
973 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
974 yylpp = yylpe = yylpsns + p;
975 yylplim = yylpsns + s;
977 yylexp = yylexemes + p;
979 *yylexp = (YYINT) YYLEX;
982 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
989 /* normal operation, no conflict encountered */
990 #endif /* YYBTYACC */
994 #endif /* YYBTYACC */
995 if (yychar < 0) yychar = YYEOF;
999 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1000 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1001 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1005 if (yychar == YYEOF) goto yyaccept;
1008 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1009 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1010 yystate = yytable[yyn];
1012 yystate = yydgoto[yym];
1016 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1017 #ifdef YYSTYPE_TOSTRING
1020 #endif /* YYBTYACC */
1021 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1023 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1026 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1027 *++yystack.s_mark = (YYINT) yystate;
1028 *++yystack.l_mark = yyval;
1029 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1030 *++yystack.p_mark = yyloc;
1035 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1037 if (yypath) YYABORT;
1040 YYParseState *save = yyps->save;
1041 yyps->save = save->save;
1042 save->save = yypath;
1047 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1048 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1052 yyFreeState(yyerrctx);
1055 yylvp = yylvals + yypath->lexeme;
1056 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1057 yylpp = yylpsns + yypath->lexeme;
1059 yylexp = yylexemes + yypath->lexeme;
1061 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1062 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1063 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1064 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1065 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1066 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1067 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1069 yystate = yypath->state;
1071 #endif /* YYBTYACC */
1074 YYERROR_CALL("yacc stack overflow");
1078 YYERROR_CALL("memory exhausted");
1080 #endif /* YYBTYACC */
1090 if (yyps->save) goto yyvalid;
1091 #endif /* YYBTYACC */
1095 #if defined(YYDESTRUCT_CALL)
1096 if (yychar != YYEOF && yychar != YYEMPTY)
1097 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1098 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1100 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1101 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1105 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1108 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1109 YYDESTRUCT_CALL("cleanup: discarding state",
1110 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1112 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1113 YYDESTRUCT_CALL("cleanup: discarding state",
1114 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1115 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1117 #endif /* defined(YYDESTRUCT_CALL) */
1122 yyFreeState(yyerrctx);
1127 YYParseState *save = yyps;
1134 YYParseState *save = yypath;
1135 yypath = save->save;
1139 #endif /* YYBTYACC */
1140 yyfreestack(&yystack);