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);
389 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
390 memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
394 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
396 #endif /* YYBTYACC */
405 memset(&yystack, 0, sizeof(yystack));
408 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
409 yystack.s_mark = yystack.s_base;
410 yystack.l_mark = yystack.l_base;
411 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
412 yystack.p_mark = yystack.p_base;
418 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
425 /* we're currently re-reading tokens */
427 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
435 /* in trial mode; save scanner results for future parse attempts */
436 if (yylvp == yylvlim)
437 { /* Enlarge lexical value queue */
438 size_t p = (size_t) (yylvp - yylvals);
439 size_t s = (size_t) (yylvlim - yylvals);
441 s += YYLVQUEUEGROWTH;
442 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
443 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
444 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
445 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
447 yylvp = yylve = yylvals + p;
448 yylvlim = yylvals + s;
449 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
450 yylpp = yylpe = yylpsns + p;
451 yylplim = yylpsns + s;
453 yylexp = yylexemes + p;
455 *yylexp = (YYINT) YYLEX;
458 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
465 /* normal operation, no conflict encountered */
466 #endif /* YYBTYACC */
470 #endif /* YYBTYACC */
471 if (yychar < 0) yychar = YYEOF;
475 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
476 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
477 YYDEBUGSTR, yydepth, yystate, yychar, yys);
478 #ifdef YYSTYPE_TOSTRING
481 #endif /* YYBTYACC */
482 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
490 /* Do we have a conflict? */
491 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
492 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
501 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
502 YYDEBUGSTR, yydepth, yystate);
504 /* Switch to the next conflict context */
509 if (save->state != yystate) YYABORT;
516 /* Unresolved conflict - start/continue trial parse */
521 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
523 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
525 fputs("Starting trial parse.\n", stderr);
528 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
529 if (save == NULL) goto yyenomem;
530 save->save = yyps->save;
531 save->state = yystate;
532 save->errflag = yyerrflag;
533 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
534 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
535 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
536 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
537 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
538 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
539 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
542 if (yyctable[ctry] == -1)
545 if (yydebug && yychar >= YYEOF)
546 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
551 if (yyps->save == NULL)
553 /* If this is a first conflict in the stack, start saving lexemes */
556 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
557 if (yylexemes == NULL) goto yyenomem;
558 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
559 if (yylvals == NULL) goto yyenomem;
560 yylvlim = yylvals + YYLVQUEUEGROWTH;
561 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
562 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
563 if (yylpsns == NULL) goto yyenomem;
564 yylplim = yylpsns + YYLVQUEUEGROWTH;
569 yylvp = yylve = yylvals;
570 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
571 yylpp = yylpe = yylpsns;
577 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
580 *yylexp = (YYINT) yychar;
588 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
594 save->lexeme = (int) (yylvp - yylvals);
597 if (yytable[yyn] == ctry)
601 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
602 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
607 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
612 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
614 yystate = yyctable[ctry];
615 *++yystack.s_mark = (YYINT) yystate;
616 *++yystack.l_mark = yylval;
617 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
618 *++yystack.p_mark = yylloc;
621 if (yyerrflag > 0) --yyerrflag;
626 yyn = yyctable[ctry];
629 } /* End of code dealing with conflicts */
630 #endif /* YYBTYACC */
631 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
632 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
636 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
637 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
639 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
640 yystate = yytable[yyn];
641 *++yystack.s_mark = yytable[yyn];
642 *++yystack.l_mark = yylval;
643 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
644 *++yystack.p_mark = yylloc;
647 if (yyerrflag > 0) --yyerrflag;
650 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
651 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
656 if (yyerrflag != 0) goto yyinrecovery;
661 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
664 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
665 * before looking for error recovery */
666 yystack.s_mark -= yym;
667 yystate = *yystack.s_mark;
668 yystack.l_mark -= yym;
669 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
670 yystack.p_mark -= yym;
678 YYParseState *save = yyps->save;
681 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
682 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
683 (int)(yylvp - yylvals - yyps->save->lexeme));
685 /* Memorize most forward-looking error state in case it's really an error. */
686 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
688 /* Free old saved error context state */
689 if (yyerrctx) yyFreeState(yyerrctx);
690 /* Create and fill out new saved error context state */
691 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
692 if (yyerrctx == NULL) goto yyenomem;
693 yyerrctx->save = yyps->save;
694 yyerrctx->state = yystate;
695 yyerrctx->errflag = yyerrflag;
696 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
697 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
698 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
699 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
700 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
701 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
702 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
704 yyerrctx->lexeme = (int) (yylvp - yylvals);
706 yylvp = yylvals + save->lexeme;
707 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
708 yylpp = yylpsns + save->lexeme;
710 yylexp = yylexemes + save->lexeme;
712 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
713 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
714 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
715 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
716 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
717 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
718 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
721 yystate = save->state;
722 /* We tried shift, try reduce now */
723 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
724 yyps->save = save->save;
728 /* Nothing left on the stack -- error */
733 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
736 /* Restore state as it was in the most forward-advanced error */
737 yylvp = yylvals + yyerrctx->lexeme;
738 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
739 yylpp = yylpsns + yyerrctx->lexeme;
741 yylexp = yylexemes + yyerrctx->lexeme;
744 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
747 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
748 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
749 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
750 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
751 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
752 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
753 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
755 yystate = yyerrctx->state;
756 yyFreeState(yyerrctx);
761 if (yynewerrflag == 0) goto yyinrecovery;
762 #endif /* YYBTYACC */
764 YYERROR_CALL("syntax error");
765 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
766 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
770 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
781 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
782 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
786 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
787 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
789 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
790 yystate = yytable[yyn];
791 *++yystack.s_mark = yytable[yyn];
792 *++yystack.l_mark = yylval;
793 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
794 /* lookahead position is error end position */
795 yyerror_loc_range[1] = yylloc;
796 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
797 *++yystack.p_mark = yyloc;
805 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
806 YYDEBUGSTR, yydepth, *yystack.s_mark);
808 if (yystack.s_mark <= yystack.s_base) goto yyabort;
809 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
810 /* the current TOS position is the error start position */
811 yyerror_loc_range[0] = *yystack.p_mark;
813 #if defined(YYDESTRUCT_CALL)
816 #endif /* YYBTYACC */
817 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
818 YYDESTRUCT_CALL("error: discarding state",
819 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
821 YYDESTRUCT_CALL("error: discarding state",
822 yystos[*yystack.s_mark], yystack.l_mark);
823 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
824 #endif /* defined(YYDESTRUCT_CALL) */
827 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
835 if (yychar == YYEOF) goto yyabort;
839 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
840 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
841 YYDEBUGSTR, yydepth, yystate, yychar, yys);
844 #if defined(YYDESTRUCT_CALL)
847 #endif /* YYBTYACC */
848 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
849 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
851 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
852 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
853 #endif /* defined(YYDESTRUCT_CALL) */
863 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
864 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
865 #ifdef YYSTYPE_TOSTRING
868 #endif /* YYBTYACC */
873 for (i = yym; i > 0; i--)
875 if (i != yym) fputs(", ", stderr);
876 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
877 yystack.l_mark[1-i]), stderr);
886 yyval = yystack.l_mark[1-yym];
888 memset(&yyval, 0, sizeof yyval);
889 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
891 /* Perform position reduction */
892 memset(&yyloc, 0, sizeof(yyloc));
895 #endif /* YYBTYACC */
897 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
898 /* just in case YYERROR is invoked within the action, save
899 the start of the rhs as the error start position */
900 yyerror_loc_range[0] = yystack.p_mark[1-yym];
909 yystack.s_mark -= yym;
910 yystate = *yystack.s_mark;
911 yystack.l_mark -= yym;
912 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
913 yystack.p_mark -= yym;
916 if (yystate == 0 && yym == 0)
921 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
922 #ifdef YYSTYPE_TOSTRING
925 #endif /* YYBTYACC */
926 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
928 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
932 *++yystack.s_mark = YYFINAL;
933 *++yystack.l_mark = yyval;
934 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
935 *++yystack.p_mark = yyloc;
943 /* we're currently re-reading tokens */
945 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
953 /* in trial mode; save scanner results for future parse attempts */
954 if (yylvp == yylvlim)
955 { /* Enlarge lexical value queue */
956 size_t p = (size_t) (yylvp - yylvals);
957 size_t s = (size_t) (yylvlim - yylvals);
959 s += YYLVQUEUEGROWTH;
960 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)
962 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
964 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
965 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
968 yylvp = yylve = yylvals + p;
969 yylvlim = yylvals + s;
970 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
971 yylpp = yylpe = yylpsns + p;
972 yylplim = yylpsns + s;
974 yylexp = yylexemes + p;
976 *yylexp = (YYINT) YYLEX;
979 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
986 /* normal operation, no conflict encountered */
987 #endif /* YYBTYACC */
991 #endif /* YYBTYACC */
992 if (yychar < 0) yychar = YYEOF;
996 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
997 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
998 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1002 if (yychar == YYEOF) goto yyaccept;
1005 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1006 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1007 yystate = yytable[yyn];
1009 yystate = yydgoto[yym];
1013 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1014 #ifdef YYSTYPE_TOSTRING
1017 #endif /* YYBTYACC */
1018 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1020 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1023 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1024 *++yystack.s_mark = (YYINT) yystate;
1025 *++yystack.l_mark = yyval;
1026 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1027 *++yystack.p_mark = yyloc;
1032 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1034 if (yypath) YYABORT;
1037 YYParseState *save = yyps->save;
1038 yyps->save = save->save;
1039 save->save = yypath;
1044 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1045 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1049 yyFreeState(yyerrctx);
1052 yylvp = yylvals + yypath->lexeme;
1053 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1054 yylpp = yylpsns + yypath->lexeme;
1056 yylexp = yylexemes + yypath->lexeme;
1058 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1059 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1060 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1061 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1062 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1063 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1064 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1066 yystate = yypath->state;
1068 #endif /* YYBTYACC */
1071 YYERROR_CALL("yacc stack overflow");
1075 YYERROR_CALL("memory exhausted");
1077 #endif /* YYBTYACC */
1087 if (yyps->save) goto yyvalid;
1088 #endif /* YYBTYACC */
1092 #if defined(YYDESTRUCT_CALL)
1093 if (yychar != YYEOF && yychar != YYEMPTY)
1094 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1095 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1097 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1098 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1102 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1105 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1106 YYDESTRUCT_CALL("cleanup: discarding state",
1107 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1109 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1110 YYDESTRUCT_CALL("cleanup: discarding state",
1111 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1112 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1114 #endif /* defined(YYDESTRUCT_CALL) */
1119 yyFreeState(yyerrctx);
1124 YYParseState *save = yyps;
1131 YYParseState *save = yypath;
1132 yypath = save->save;
1136 #endif /* YYBTYACC */
1137 yyfreestack(&yystack);