1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent of 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"
21 #define yyparse empty_parse
25 #define yylex empty_lex
29 #define yyerror empty_error
33 #define yychar empty_char
37 #define yyval empty_val
41 #define yylval empty_lval
45 #define yydebug empty_debug
49 #define yynerrs empty_nerrs
53 #define yyerrflag empty_errflag
54 #endif /* yyerrflag */
57 #define yylhs empty_lhs
61 #define yylen empty_len
65 #define yydefred empty_defred
69 #define yystos empty_stos
73 #define yydgoto empty_dgoto
77 #define yysindex empty_sindex
81 #define yyrindex empty_rindex
85 #define yygindex empty_gindex
89 #define yytable empty_table
93 #define yycheck empty_check
97 #define yyname empty_name
101 #define yyrule empty_rule
107 #define yycindex empty_cindex
108 #endif /* yycindex */
111 #define yyctable empty_ctable
112 #endif /* yyctable */
114 #endif /* YYBTYACC */
116 #define YYPREFIX "empty_"
122 #define YYLEX_DECL() yylex(void)
123 #define YYERROR_DECL() yyerror(const char *s)
124 static int YYLEX_DECL();
125 static void YYERROR_DECL();
127 #line 128 "empty.tab.c"
129 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
130 /* Default: YYSTYPE is the semantic value type. */
132 # define YYSTYPE_IS_DECLARED 1
135 /* compatibility with bison */
137 /* compatibility with FreeBSD */
138 # ifdef YYPARSE_PARAM_TYPE
139 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
141 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
144 # define YYPARSE_DECL() yyparse(void)
147 /* Parameters sent to lex. */
149 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
150 # define YYLEX yylex(YYLEX_PARAM)
152 # define YYLEX_DECL() yylex(void)
153 # define YYLEX yylex()
156 /* Parameters sent to yyerror. */
158 #define YYERROR_DECL() yyerror(const char *s)
161 #define YYERROR_CALL(msg) yyerror(msg)
164 extern int YYPARSE_DECL();
166 #define YYERRCODE 256
168 static const YYINT empty_lhs[] = { -1,
171 static const YYINT empty_len[] = { 2,
174 static const YYINT empty_defred[] = { 1,
177 static const YYINT empty_stos[] = { 0,
180 static const YYINT empty_dgoto[] = { 1,
182 static const YYINT empty_sindex[] = { 0,
185 static const YYINT empty_rindex[] = { 0,
189 static const YYINT empty_cindex[] = { 0,
193 static const YYINT empty_gindex[] = { 0,
195 #define YYTABLESIZE 0
196 static const YYINT empty_table[] = { 0,
198 static const YYINT empty_check[] = { -1,
201 static const YYINT empty_ctable[] = { -1,
208 #define YYMAXTOKEN 256
209 #define YYUNDFTOKEN 259
210 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
212 static const char *const empty_name[] = {
214 "$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,
215 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
216 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
217 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
218 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
220 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","start",
223 static const char *const empty_rule[] = {
237 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
238 YYLTYPE yyloc; /* position returned by actions */
239 YYLTYPE yylloc; /* position from the lexer */
242 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
243 #ifndef YYLLOC_DEFAULT
244 #define YYLLOC_DEFAULT(loc, rhs, n) \
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; \
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; \
262 #endif /* YYLLOC_DEFAULT */
263 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
266 #ifndef YYLVQUEUEGROWTH
267 #define YYLVQUEUEGROWTH 32
269 #endif /* YYBTYACC */
271 /* define the initial stack-sizes */
274 #define YYMAXDEPTH YYSTACKSIZE
277 #define YYSTACKSIZE YYMAXDEPTH
279 #define YYSTACKSIZE 10000
280 #define YYMAXDEPTH 10000
284 #ifndef YYINITSTACKSIZE
285 #define YYINITSTACKSIZE 200
295 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
302 struct YYParseState_s
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 */
311 typedef struct YYParseState_s YYParseState;
312 #endif /* YYBTYACC */
313 /* variables for the parser stack */
314 static YYSTACKDATA yystack;
317 /* Current parser state */
318 static YYParseState *yyps = 0;
320 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
321 static YYParseState *yypath = 0;
323 /* Base of the lexical value queue */
324 static YYSTYPE *yylvals = 0;
326 /* Current position at lexical value queue */
327 static YYSTYPE *yylvp = 0;
329 /* End position of lexical value queue */
330 static YYSTYPE *yylve = 0;
332 /* The last allocated position at the lexical value queue */
333 static YYSTYPE *yylvlim = 0;
335 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
336 /* Base of the lexical position queue */
337 static YYLTYPE *yylpsns = 0;
339 /* Current position at lexical position queue */
340 static YYLTYPE *yylpp = 0;
342 /* End position of lexical position queue */
343 static YYLTYPE *yylpe = 0;
345 /* The last allocated position at the lexical position queue */
346 static YYLTYPE *yylplim = 0;
349 /* Current position at lexical token queue */
350 static short *yylexp = 0;
352 static short *yylexemes = 0;
353 #endif /* YYBTYACC */
367 #line 368 "empty.tab.c"
369 /* For use in generated program */
370 #define yydepth (int)(yystack.s_mark - yystack.s_base)
372 #define yytrial (yyps->save)
373 #endif /* YYBTYACC */
376 #include <stdio.h> /* needed for printf */
379 #include <stdlib.h> /* needed for malloc, etc */
380 #include <string.h> /* needed for memset */
382 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
383 static int yygrowstack(YYSTACKDATA *data)
389 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
393 if ((newsize = data->stacksize) == 0)
394 newsize = YYINITSTACKSIZE;
395 else if (newsize >= YYMAXDEPTH)
397 else if ((newsize *= 2) > YYMAXDEPTH)
398 newsize = YYMAXDEPTH;
400 i = (int) (data->s_mark - data->s_base);
401 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
405 data->s_base = newss;
406 data->s_mark = newss + i;
408 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
412 data->l_base = newvs;
413 data->l_mark = newvs + i;
415 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
416 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
420 data->p_base = newps;
421 data->p_mark = newps + i;
424 data->stacksize = newsize;
425 data->s_last = data->s_base + newsize - 1;
429 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
434 #if YYPURE || defined(YY_NO_LEAKS)
435 static void yyfreestack(YYSTACKDATA *data)
439 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
442 memset(data, 0, sizeof(*data));
445 #define yyfreestack(data) /* nothing */
446 #endif /* YYPURE || defined(YY_NO_LEAKS) */
449 static YYParseState *
450 yyNewState(unsigned size)
452 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
453 if (p == NULL) return NULL;
455 p->yystack.stacksize = size;
458 p->yystack.s_base = NULL;
459 p->yystack.l_base = NULL;
460 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
461 p->yystack.p_base = NULL;
465 p->yystack.s_base = (short *) malloc(size * sizeof(short));
466 if (p->yystack.s_base == NULL) return NULL;
467 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
468 if (p->yystack.l_base == NULL) return NULL;
469 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
470 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
471 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
472 if (p->yystack.p_base == NULL) return NULL;
473 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
480 yyFreeState(YYParseState *p)
482 yyfreestack(&p->yystack);
485 #endif /* YYBTYACC */
487 #define YYABORT goto yyabort
488 #define YYREJECT goto yyabort
489 #define YYACCEPT goto yyaccept
490 #define YYERROR goto yyerrlab
492 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
493 #define YYVALID_NESTED do { if (yyps->save && \
494 yyps->save->save == 0) goto yyvalid; } while(0)
495 #endif /* YYBTYACC */
500 int yym, yyn, yystate, yyresult;
503 YYParseState *yyerrctx = NULL;
504 #endif /* YYBTYACC */
505 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
506 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
511 if ((yys = getenv("YYDEBUG")) != 0)
514 if (yyn >= '0' && yyn <= '9')
518 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
522 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
524 #endif /* YYBTYACC */
531 memset(&yystack, 0, sizeof(yystack));
534 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
535 yystack.s_mark = yystack.s_base;
536 yystack.l_mark = yystack.l_base;
537 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
538 yystack.p_mark = yystack.p_base;
544 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
551 /* we're currently re-reading tokens */
553 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
561 /* in trial mode; save scanner results for future parse attempts */
562 if (yylvp == yylvlim)
563 { /* Enlarge lexical value queue */
564 size_t p = (size_t) (yylvp - yylvals);
565 size_t s = (size_t) (yylvlim - yylvals);
567 s += YYLVQUEUEGROWTH;
568 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
569 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
570 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
571 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
573 yylvp = yylve = yylvals + p;
574 yylvlim = yylvals + s;
575 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
576 yylpp = yylpe = yylpsns + p;
577 yylplim = yylpsns + s;
579 yylexp = yylexemes + p;
581 *yylexp = (short) YYLEX;
584 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
591 /* normal operation, no conflict encountered */
592 #endif /* YYBTYACC */
596 #endif /* YYBTYACC */
597 if (yychar < 0) yychar = YYEOF;
598 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
602 yys = yyname[YYTRANSLATE(yychar)];
603 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
604 YYDEBUGSTR, yydepth, yystate, yychar, yys);
605 #ifdef YYSTYPE_TOSTRING
608 #endif /* YYBTYACC */
609 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
617 /* Do we have a conflict? */
618 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
619 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
628 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
629 YYDEBUGSTR, yydepth, yystate);
631 /* Switch to the next conflict context */
636 if (save->state != yystate) YYABORT;
643 /* Unresolved conflict - start/continue trial parse */
648 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
650 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
652 fputs("Starting trial parse.\n", stderr);
655 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
656 if (save == NULL) goto yyenomem;
657 save->save = yyps->save;
658 save->state = yystate;
659 save->errflag = yyerrflag;
660 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
661 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
662 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
663 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
664 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
665 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
666 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
669 if (yyctable[ctry] == -1)
672 if (yydebug && yychar >= YYEOF)
673 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
678 if (yyps->save == NULL)
680 /* If this is a first conflict in the stack, start saving lexemes */
683 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
684 if (yylexemes == NULL) goto yyenomem;
685 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
686 if (yylvals == NULL) goto yyenomem;
687 yylvlim = yylvals + YYLVQUEUEGROWTH;
688 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
689 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
690 if (yylpsns == NULL) goto yyenomem;
691 yylplim = yylpsns + YYLVQUEUEGROWTH;
696 yylvp = yylve = yylvals;
697 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
698 yylpp = yylpe = yylpsns;
704 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
707 *yylexp = (short) yychar;
715 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
721 save->lexeme = (int) (yylvp - yylvals);
724 if (yytable[yyn] == ctry)
728 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
729 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
734 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
739 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
741 yystate = yyctable[ctry];
742 *++yystack.s_mark = (short) yystate;
743 *++yystack.l_mark = yylval;
744 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
745 *++yystack.p_mark = yylloc;
748 if (yyerrflag > 0) --yyerrflag;
753 yyn = yyctable[ctry];
756 } /* End of code dealing with conflicts */
757 #endif /* YYBTYACC */
758 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
759 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
763 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
764 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
766 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
767 yystate = yytable[yyn];
768 *++yystack.s_mark = yytable[yyn];
769 *++yystack.l_mark = yylval;
770 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
771 *++yystack.p_mark = yylloc;
774 if (yyerrflag > 0) --yyerrflag;
777 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
778 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
783 if (yyerrflag != 0) goto yyinrecovery;
796 YYParseState *save = yyps->save;
799 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
800 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
801 (int)(yylvp - yylvals - yyps->save->lexeme));
803 /* Memorize most forward-looking error state in case it's really an error. */
804 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
806 /* Free old saved error context state */
807 if (yyerrctx) yyFreeState(yyerrctx);
808 /* Create and fill out new saved error context state */
809 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
810 if (yyerrctx == NULL) goto yyenomem;
811 yyerrctx->save = yyps->save;
812 yyerrctx->state = yystate;
813 yyerrctx->errflag = yyerrflag;
814 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
815 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
816 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
817 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
818 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
819 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
820 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
822 yyerrctx->lexeme = (int) (yylvp - yylvals);
824 yylvp = yylvals + save->lexeme;
825 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
826 yylpp = yylpsns + save->lexeme;
828 yylexp = yylexemes + save->lexeme;
830 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
831 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
832 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
833 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
834 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
835 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
836 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
839 yystate = save->state;
840 /* We tried shift, try reduce now */
841 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
842 yyps->save = save->save;
846 /* Nothing left on the stack -- error */
851 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
854 /* Restore state as it was in the most forward-advanced error */
855 yylvp = yylvals + yyerrctx->lexeme;
856 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
857 yylpp = yylpsns + yyerrctx->lexeme;
859 yylexp = yylexemes + yyerrctx->lexeme;
862 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
865 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
866 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
867 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
868 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
869 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
870 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
871 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
873 yystate = yyerrctx->state;
874 yyFreeState(yyerrctx);
879 if (yynewerrflag == 0) goto yyinrecovery;
880 #endif /* YYBTYACC */
882 YYERROR_CALL("syntax error");
883 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
884 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
899 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
900 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
904 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
905 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
907 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
908 yystate = yytable[yyn];
909 *++yystack.s_mark = yytable[yyn];
910 *++yystack.l_mark = yylval;
911 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
912 /* lookahead position is error end position */
913 yyerror_loc_range[1] = yylloc;
914 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
915 *++yystack.p_mark = yyloc;
923 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
924 YYDEBUGSTR, yydepth, *yystack.s_mark);
926 if (yystack.s_mark <= yystack.s_base) goto yyabort;
927 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
928 /* the current TOS position is the error start position */
929 yyerror_loc_range[0] = *yystack.p_mark;
931 #if defined(YYDESTRUCT_CALL)
934 #endif /* YYBTYACC */
935 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
936 YYDESTRUCT_CALL("error: discarding state",
937 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
939 YYDESTRUCT_CALL("error: discarding state",
940 yystos[*yystack.s_mark], yystack.l_mark);
941 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
942 #endif /* defined(YYDESTRUCT_CALL) */
945 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
953 if (yychar == YYEOF) goto yyabort;
957 yys = yyname[YYTRANSLATE(yychar)];
958 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
959 YYDEBUGSTR, yydepth, yystate, yychar, yys);
962 #if defined(YYDESTRUCT_CALL)
965 #endif /* YYBTYACC */
966 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
967 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
969 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
970 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
971 #endif /* defined(YYDESTRUCT_CALL) */
981 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
982 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
983 #ifdef YYSTYPE_TOSTRING
986 #endif /* YYBTYACC */
991 for (i = yym; i > 0; i--)
993 if (i != yym) fputs(", ", stderr);
994 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
995 yystack.l_mark[1-i]), stderr);
1000 fputc('\n', stderr);
1004 yyval = yystack.l_mark[1-yym];
1006 memset(&yyval, 0, sizeof yyval);
1007 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1009 /* Perform position reduction */
1010 memset(&yyloc, 0, sizeof(yyloc));
1013 #endif /* YYBTYACC */
1015 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1016 /* just in case YYERROR is invoked within the action, save
1017 the start of the rhs as the error start position */
1018 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1027 yystack.s_mark -= yym;
1028 yystate = *yystack.s_mark;
1029 yystack.l_mark -= yym;
1030 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1031 yystack.p_mark -= yym;
1034 if (yystate == 0 && yym == 0)
1039 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1040 #ifdef YYSTYPE_TOSTRING
1043 #endif /* YYBTYACC */
1044 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1046 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1050 *++yystack.s_mark = YYFINAL;
1051 *++yystack.l_mark = yyval;
1052 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1053 *++yystack.p_mark = yyloc;
1061 /* we're currently re-reading tokens */
1063 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1071 /* in trial mode; save scanner results for future parse attempts */
1072 if (yylvp == yylvlim)
1073 { /* Enlarge lexical value queue */
1074 size_t p = (size_t) (yylvp - yylvals);
1075 size_t s = (size_t) (yylvlim - yylvals);
1077 s += YYLVQUEUEGROWTH;
1078 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
1080 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1082 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1083 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1086 yylvp = yylve = yylvals + p;
1087 yylvlim = yylvals + s;
1088 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1089 yylpp = yylpe = yylpsns + p;
1090 yylplim = yylpsns + s;
1092 yylexp = yylexemes + p;
1094 *yylexp = (short) YYLEX;
1097 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1104 /* normal operation, no conflict encountered */
1105 #endif /* YYBTYACC */
1109 #endif /* YYBTYACC */
1110 if (yychar < 0) yychar = YYEOF;
1111 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
1115 yys = yyname[YYTRANSLATE(yychar)];
1116 fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
1117 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1121 if (yychar == YYEOF) goto yyaccept;
1124 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1125 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1126 yystate = yytable[yyn];
1128 yystate = yydgoto[yym];
1132 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1133 #ifdef YYSTYPE_TOSTRING
1136 #endif /* YYBTYACC */
1137 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1139 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1142 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1143 *++yystack.s_mark = (short) yystate;
1144 *++yystack.l_mark = yyval;
1145 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1146 *++yystack.p_mark = yyloc;
1151 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1153 if (yypath) YYABORT;
1156 YYParseState *save = yyps->save;
1157 yyps->save = save->save;
1158 save->save = yypath;
1163 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1164 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1168 yyFreeState(yyerrctx);
1171 yylvp = yylvals + yypath->lexeme;
1172 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1173 yylpp = yylpsns + yypath->lexeme;
1175 yylexp = yylexemes + yypath->lexeme;
1177 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1178 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1179 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1180 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1181 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1182 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1183 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1185 yystate = yypath->state;
1187 #endif /* YYBTYACC */
1190 YYERROR_CALL("yacc stack overflow");
1194 YYERROR_CALL("memory exhausted");
1196 #endif /* YYBTYACC */
1206 if (yyps->save) goto yyvalid;
1207 #endif /* YYBTYACC */
1211 #if defined(YYDESTRUCT_CALL)
1212 if (yychar != YYEOF && yychar != YYEMPTY)
1213 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1214 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1216 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1217 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1221 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1224 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1225 YYDESTRUCT_CALL("cleanup: discarding state",
1226 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1228 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1229 YYDESTRUCT_CALL("cleanup: discarding state",
1230 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1231 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1233 #endif /* defined(YYDESTRUCT_CALL) */
1238 yyFreeState(yyerrctx);
1243 YYParseState *save = yyps;
1250 YYParseState *save = yypath;
1251 yypath = save->save;
1255 #endif /* YYBTYACC */
1256 yyfreestack(&yystack);