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[] = {
93 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
94 YYLTYPE yyloc; /* position returned by actions */
95 YYLTYPE yylloc; /* position from the lexer */
98 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
99 #ifndef YYLLOC_DEFAULT
100 #define YYLLOC_DEFAULT(loc, rhs, n) \
105 (loc).first_line = ((rhs)[-1]).last_line; \
106 (loc).first_column = ((rhs)[-1]).last_column; \
107 (loc).last_line = ((rhs)[-1]).last_line; \
108 (loc).last_column = ((rhs)[-1]).last_column; \
112 (loc).first_line = ((rhs)[ 0 ]).first_line; \
113 (loc).first_column = ((rhs)[ 0 ]).first_column; \
114 (loc).last_line = ((rhs)[n-1]).last_line; \
115 (loc).last_column = ((rhs)[n-1]).last_column; \
118 #endif /* YYLLOC_DEFAULT */
119 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
122 #ifndef YYLVQUEUEGROWTH
123 #define YYLVQUEUEGROWTH 32
125 #endif /* YYBTYACC */
127 /* define the initial stack-sizes */
130 #define YYMAXDEPTH YYSTACKSIZE
133 #define YYSTACKSIZE YYMAXDEPTH
135 #define YYSTACKSIZE 10000
136 #define YYMAXDEPTH 10000
140 #ifndef YYINITSTACKSIZE
141 #define YYINITSTACKSIZE 200
151 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
158 struct YYParseState_s
160 struct YYParseState_s *save; /* Previously saved parser state */
161 YYSTACKDATA yystack; /* saved parser stack */
162 int state; /* saved parser state */
163 int errflag; /* saved error recovery status */
164 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
165 YYINT ctry; /* saved index in yyctable[] for this conflict */
167 typedef struct YYParseState_s YYParseState;
168 #endif /* YYBTYACC */
169 /* variables for the parser stack */
170 static YYSTACKDATA yystack;
173 /* Current parser state */
174 static YYParseState *yyps = 0;
176 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
177 static YYParseState *yypath = 0;
179 /* Base of the lexical value queue */
180 static YYSTYPE *yylvals = 0;
182 /* Current position at lexical value queue */
183 static YYSTYPE *yylvp = 0;
185 /* End position of lexical value queue */
186 static YYSTYPE *yylve = 0;
188 /* The last allocated position at the lexical value queue */
189 static YYSTYPE *yylvlim = 0;
191 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
192 /* Base of the lexical position queue */
193 static YYLTYPE *yylpsns = 0;
195 /* Current position at lexical position queue */
196 static YYLTYPE *yylpp = 0;
198 /* End position of lexical position queue */
199 static YYLTYPE *yylpe = 0;
201 /* The last allocated position at the lexical position queue */
202 static YYLTYPE *yylplim = 0;
205 /* Current position at lexical token queue */
206 static YYINT *yylexp = 0;
208 static YYINT *yylexemes = 0;
209 #endif /* YYBTYACC */
210 #line 12 "code_debug.y"
215 extern int YYLEX_DECL();
221 printf("yyparse() = %d\n", yyparse());
232 yyerror(const char* s)
236 #line 238 "rename_debug.c"
238 /* For use in generated program */
239 #define yydepth (int)(yystack.s_mark - yystack.s_base)
241 #define yytrial (yyps->save)
242 #endif /* YYBTYACC */
245 #include <stdio.h> /* needed for printf */
248 #include <stdlib.h> /* needed for malloc, etc */
249 #include <string.h> /* needed for memset */
251 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
252 static int yygrowstack(YYSTACKDATA *data)
258 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
262 if ((newsize = data->stacksize) == 0)
263 newsize = YYINITSTACKSIZE;
264 else if (newsize >= YYMAXDEPTH)
266 else if ((newsize *= 2) > YYMAXDEPTH)
267 newsize = YYMAXDEPTH;
269 i = (int) (data->s_mark - data->s_base);
270 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
274 data->s_base = newss;
275 data->s_mark = newss + i;
277 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
281 data->l_base = newvs;
282 data->l_mark = newvs + i;
284 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
285 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
289 data->p_base = newps;
290 data->p_mark = newps + i;
293 data->stacksize = newsize;
294 data->s_last = data->s_base + newsize - 1;
298 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
303 #if YYPURE || defined(YY_NO_LEAKS)
304 static void yyfreestack(YYSTACKDATA *data)
308 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
311 memset(data, 0, sizeof(*data));
314 #define yyfreestack(data) /* nothing */
315 #endif /* YYPURE || defined(YY_NO_LEAKS) */
318 static YYParseState *
319 yyNewState(unsigned size)
321 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
322 if (p == NULL) return NULL;
324 p->yystack.stacksize = size;
327 p->yystack.s_base = NULL;
328 p->yystack.l_base = NULL;
329 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
330 p->yystack.p_base = NULL;
334 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
335 if (p->yystack.s_base == NULL) return NULL;
336 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
337 if (p->yystack.l_base == NULL) return NULL;
338 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
339 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
340 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
341 if (p->yystack.p_base == NULL) return NULL;
342 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
349 yyFreeState(YYParseState *p)
351 yyfreestack(&p->yystack);
354 #endif /* YYBTYACC */
356 #define YYABORT goto yyabort
357 #define YYREJECT goto yyabort
358 #define YYACCEPT goto yyaccept
359 #define YYERROR goto yyerrlab
361 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
362 #define YYVALID_NESTED do { if (yyps->save && \
363 yyps->save->save == 0) goto yyvalid; } while(0)
364 #endif /* YYBTYACC */
369 int yym, yyn, yystate, yyresult;
372 YYParseState *yyerrctx = NULL;
373 #endif /* YYBTYACC */
374 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
375 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
380 if ((yys = getenv("YYDEBUG")) != 0)
383 if (yyn >= '0' && yyn <= '9')
387 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
391 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
393 #endif /* YYBTYACC */
402 memset(&yystack, 0, sizeof(yystack));
405 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
406 yystack.s_mark = yystack.s_base;
407 yystack.l_mark = yystack.l_base;
408 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
409 yystack.p_mark = yystack.p_base;
415 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
422 /* we're currently re-reading tokens */
424 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
432 /* in trial mode; save scanner results for future parse attempts */
433 if (yylvp == yylvlim)
434 { /* Enlarge lexical value queue */
435 size_t p = (size_t) (yylvp - yylvals);
436 size_t s = (size_t) (yylvlim - yylvals);
438 s += YYLVQUEUEGROWTH;
439 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
440 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
441 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
442 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
444 yylvp = yylve = yylvals + p;
445 yylvlim = yylvals + s;
446 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
447 yylpp = yylpe = yylpsns + p;
448 yylplim = yylpsns + s;
450 yylexp = yylexemes + p;
452 *yylexp = (YYINT) YYLEX;
455 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
462 /* normal operation, no conflict encountered */
463 #endif /* YYBTYACC */
467 #endif /* YYBTYACC */
468 if (yychar < 0) yychar = YYEOF;
472 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
473 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
474 YYDEBUGSTR, yydepth, yystate, yychar, yys);
475 #ifdef YYSTYPE_TOSTRING
478 #endif /* YYBTYACC */
479 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
487 /* Do we have a conflict? */
488 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
489 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
498 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
499 YYDEBUGSTR, yydepth, yystate);
501 /* Switch to the next conflict context */
506 if (save->state != yystate) YYABORT;
513 /* Unresolved conflict - start/continue trial parse */
518 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
520 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
522 fputs("Starting trial parse.\n", stderr);
525 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
526 if (save == NULL) goto yyenomem;
527 save->save = yyps->save;
528 save->state = yystate;
529 save->errflag = yyerrflag;
530 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
531 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
532 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
533 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
534 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
535 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
536 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
539 if (yyctable[ctry] == -1)
542 if (yydebug && yychar >= YYEOF)
543 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
548 if (yyps->save == NULL)
550 /* If this is a first conflict in the stack, start saving lexemes */
553 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
554 if (yylexemes == NULL) goto yyenomem;
555 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
556 if (yylvals == NULL) goto yyenomem;
557 yylvlim = yylvals + YYLVQUEUEGROWTH;
558 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
559 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
560 if (yylpsns == NULL) goto yyenomem;
561 yylplim = yylpsns + YYLVQUEUEGROWTH;
566 yylvp = yylve = yylvals;
567 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
568 yylpp = yylpe = yylpsns;
574 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
577 *yylexp = (YYINT) yychar;
585 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
591 save->lexeme = (int) (yylvp - yylvals);
594 if (yytable[yyn] == ctry)
598 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
599 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
604 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
609 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
611 yystate = yyctable[ctry];
612 *++yystack.s_mark = (YYINT) yystate;
613 *++yystack.l_mark = yylval;
614 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
615 *++yystack.p_mark = yylloc;
618 if (yyerrflag > 0) --yyerrflag;
623 yyn = yyctable[ctry];
626 } /* End of code dealing with conflicts */
627 #endif /* YYBTYACC */
628 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
629 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
633 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
634 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
636 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
637 yystate = yytable[yyn];
638 *++yystack.s_mark = yytable[yyn];
639 *++yystack.l_mark = yylval;
640 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
641 *++yystack.p_mark = yylloc;
644 if (yyerrflag > 0) --yyerrflag;
647 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
648 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
653 if (yyerrflag != 0) goto yyinrecovery;
658 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
661 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
662 * before looking for error recovery */
663 yystack.s_mark -= yym;
664 yystate = *yystack.s_mark;
665 yystack.l_mark -= yym;
666 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
667 yystack.p_mark -= yym;
675 YYParseState *save = yyps->save;
678 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
679 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
680 (int)(yylvp - yylvals - yyps->save->lexeme));
682 /* Memorize most forward-looking error state in case it's really an error. */
683 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
685 /* Free old saved error context state */
686 if (yyerrctx) yyFreeState(yyerrctx);
687 /* Create and fill out new saved error context state */
688 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
689 if (yyerrctx == NULL) goto yyenomem;
690 yyerrctx->save = yyps->save;
691 yyerrctx->state = yystate;
692 yyerrctx->errflag = yyerrflag;
693 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
694 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
695 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
696 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
697 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
698 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
699 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
701 yyerrctx->lexeme = (int) (yylvp - yylvals);
703 yylvp = yylvals + save->lexeme;
704 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
705 yylpp = yylpsns + save->lexeme;
707 yylexp = yylexemes + save->lexeme;
709 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
710 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
711 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
712 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
713 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
714 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
715 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
718 yystate = save->state;
719 /* We tried shift, try reduce now */
720 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
721 yyps->save = save->save;
725 /* Nothing left on the stack -- error */
730 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
733 /* Restore state as it was in the most forward-advanced error */
734 yylvp = yylvals + yyerrctx->lexeme;
735 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
736 yylpp = yylpsns + yyerrctx->lexeme;
738 yylexp = yylexemes + yyerrctx->lexeme;
741 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
744 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
745 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
746 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
747 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
748 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
749 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
750 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
752 yystate = yyerrctx->state;
753 yyFreeState(yyerrctx);
758 if (yynewerrflag == 0) goto yyinrecovery;
759 #endif /* YYBTYACC */
761 YYERROR_CALL("syntax error");
762 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
763 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
767 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
778 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
779 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
783 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
784 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
786 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
787 yystate = yytable[yyn];
788 *++yystack.s_mark = yytable[yyn];
789 *++yystack.l_mark = yylval;
790 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
791 /* lookahead position is error end position */
792 yyerror_loc_range[1] = yylloc;
793 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
794 *++yystack.p_mark = yyloc;
802 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
803 YYDEBUGSTR, yydepth, *yystack.s_mark);
805 if (yystack.s_mark <= yystack.s_base) goto yyabort;
806 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
807 /* the current TOS position is the error start position */
808 yyerror_loc_range[0] = *yystack.p_mark;
810 #if defined(YYDESTRUCT_CALL)
813 #endif /* YYBTYACC */
814 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
815 YYDESTRUCT_CALL("error: discarding state",
816 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
818 YYDESTRUCT_CALL("error: discarding state",
819 yystos[*yystack.s_mark], yystack.l_mark);
820 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
821 #endif /* defined(YYDESTRUCT_CALL) */
824 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
832 if (yychar == YYEOF) goto yyabort;
836 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
837 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
838 YYDEBUGSTR, yydepth, yystate, yychar, yys);
841 #if defined(YYDESTRUCT_CALL)
844 #endif /* YYBTYACC */
845 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
846 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
848 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
849 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
850 #endif /* defined(YYDESTRUCT_CALL) */
860 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
861 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
862 #ifdef YYSTYPE_TOSTRING
865 #endif /* YYBTYACC */
870 for (i = yym; i > 0; i--)
872 if (i != yym) fputs(", ", stderr);
873 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
874 yystack.l_mark[1-i]), stderr);
883 yyval = yystack.l_mark[1-yym];
885 memset(&yyval, 0, sizeof yyval);
886 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
888 /* Perform position reduction */
889 memset(&yyloc, 0, sizeof(yyloc));
892 #endif /* YYBTYACC */
894 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
895 /* just in case YYERROR is invoked within the action, save
896 the start of the rhs as the error start position */
897 yyerror_loc_range[0] = yystack.p_mark[1-yym];
906 yystack.s_mark -= yym;
907 yystate = *yystack.s_mark;
908 yystack.l_mark -= yym;
909 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
910 yystack.p_mark -= yym;
913 if (yystate == 0 && yym == 0)
918 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
919 #ifdef YYSTYPE_TOSTRING
922 #endif /* YYBTYACC */
923 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
925 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
929 *++yystack.s_mark = YYFINAL;
930 *++yystack.l_mark = yyval;
931 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
932 *++yystack.p_mark = yyloc;
940 /* we're currently re-reading tokens */
942 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
950 /* in trial mode; save scanner results for future parse attempts */
951 if (yylvp == yylvlim)
952 { /* Enlarge lexical value queue */
953 size_t p = (size_t) (yylvp - yylvals);
954 size_t s = (size_t) (yylvlim - yylvals);
956 s += YYLVQUEUEGROWTH;
957 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)
959 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
961 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
962 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
965 yylvp = yylve = yylvals + p;
966 yylvlim = yylvals + s;
967 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
968 yylpp = yylpe = yylpsns + p;
969 yylplim = yylpsns + s;
971 yylexp = yylexemes + p;
973 *yylexp = (YYINT) YYLEX;
976 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
983 /* normal operation, no conflict encountered */
984 #endif /* YYBTYACC */
988 #endif /* YYBTYACC */
989 if (yychar < 0) yychar = YYEOF;
993 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
994 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
995 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
999 if (yychar == YYEOF) goto yyaccept;
1002 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1003 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1004 yystate = yytable[yyn];
1006 yystate = yydgoto[yym];
1010 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1011 #ifdef YYSTYPE_TOSTRING
1014 #endif /* YYBTYACC */
1015 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1017 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1020 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1021 *++yystack.s_mark = (YYINT) yystate;
1022 *++yystack.l_mark = yyval;
1023 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1024 *++yystack.p_mark = yyloc;
1029 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1031 if (yypath) YYABORT;
1034 YYParseState *save = yyps->save;
1035 yyps->save = save->save;
1036 save->save = yypath;
1041 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1042 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1046 yyFreeState(yyerrctx);
1049 yylvp = yylvals + yypath->lexeme;
1050 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1051 yylpp = yylpsns + yypath->lexeme;
1053 yylexp = yylexemes + yypath->lexeme;
1055 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1056 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1057 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1058 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1059 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1060 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1061 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1063 yystate = yypath->state;
1065 #endif /* YYBTYACC */
1068 YYERROR_CALL("yacc stack overflow");
1072 YYERROR_CALL("memory exhausted");
1074 #endif /* YYBTYACC */
1084 if (yyps->save) goto yyvalid;
1085 #endif /* YYBTYACC */
1089 #if defined(YYDESTRUCT_CALL)
1090 if (yychar != YYEOF && yychar != YYEMPTY)
1091 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1092 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1094 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1095 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1099 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1102 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1103 YYDESTRUCT_CALL("cleanup: discarding state",
1104 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1106 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1107 YYDESTRUCT_CALL("cleanup: discarding state",
1108 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1109 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1111 #endif /* defined(YYDESTRUCT_CALL) */
1116 yyFreeState(yyerrctx);
1121 YYParseState *save = yyps;
1128 YYParseState *save = yypath;
1129 yypath = save->save;
1133 #endif /* YYBTYACC */
1134 yyfreestack(&yystack);