1 %%{section} %%{body} %%".c" %%{yacc}
4 /* A Bison parser, made from %%{filename}
5 by GNU bison %%{version}. */
7 /* Skeleton output parser for bison,
8 Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* As a special exception, when this file is copied by Bison into a
26 Bison output file, you may use that output file without restriction.
27 This special exception was added by the Free Software Foundation
28 in version 1.24 of Bison. */
30 /* This is the parser code that is written into each bison parser when
31 the %semantic_parser declaration is not specified in the grammar.
32 It was written by Richard Stallman by simplifying the hairy parser
33 used when %semantic_parser is specified. */
35 /* Identify Bison output. */
39 #define YYPURE %%{pure}
41 /* Using locations. */
42 #define YYLSP_NEEDED %%{locations-flag}
44 /* If NAME_PREFIX is specified substitute the variables and functions
46 #define yyparse %%{prefix}parse
47 #define yylex %%{prefix}lex
48 #define yyerror %%{prefix}error
49 #define yylval %%{prefix}lval
50 #define yychar %%{prefix}char
51 #define yydebug %%{prefix}debug
52 #define yynerrs %%{prefix}nerrs
54 # define yylloc %%{prefix}lloc
58 /* Copy the user declarations. */
61 /* Enabling traces. */
63 # define YYDEBUG %%{debug}
66 /* Enabling verbose error messages. */
67 #ifdef YYERROR_VERBOSE
68 # undef YYERROR_VERBOSE
69 # define YYERROR_VERBOSE 1
71 # define YYERROR_VERBOSE %%{error-verbose}
75 typedef %%{stype} yystype;
76 # define YYSTYPE yystype
80 typedef struct yyltype
87 # define YYLTYPE %%{ltype}
90 /* Line %%{skeleton-line} of %%{skeleton}. */
91 #line %%{line} "%%{parser-file-name}"
93 /* All symbols defined below should begin with yy or YY, to avoid
94 infringing on user name space. This should be done even for local
95 variables, as they might otherwise be expanded by user macros.
96 There are some unavoidable exceptions within include files to
97 define necessary library symbols; they are noted "INFRINGES ON
98 USER NAME SPACE" below. */
101 # define YYSTD(x) std::x
106 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
108 /* The parser invokes alloca or malloc; define the necessary symbols. */
110 # if YYSTACK_USE_ALLOCA
111 # define YYSTACK_ALLOC alloca
112 # define YYSIZE_T YYSTD (size_t)
114 # ifndef YYSTACK_USE_ALLOCA
115 # if defined (alloca) || defined (_ALLOCA_H)
116 # define YYSTACK_ALLOC alloca
117 # define YYSIZE_T YYSTD (size_t)
120 # define YYSTACK_ALLOC __builtin_alloca
126 # ifdef YYSTACK_ALLOC
127 /* Pacify GCC's `empty if-body' warning. */
128 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
131 # include <cstdlib> /* INFRINGES ON USER NAME SPACE */
132 # define YYSIZE_T std::size_t
135 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
136 # define YYSIZE_T size_t
139 # define YYSTACK_ALLOC YYSTD (malloc)
140 # define YYSTACK_FREE YYSTD (free)
143 /* A type that is properly aligned for any stack member. */
153 /* The size of the maximum gap between one aligned stack and the next. */
154 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
156 /* The size of an array large to enough to hold all stacks, each with
159 # define YYSTACK_BYTES(N) \
160 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
161 + 2 * YYSTACK_GAP_MAX)
163 # define YYSTACK_BYTES(N) \
164 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
168 /* Relocate the TYPE STACK from its old location to the new one. The
169 local variables YYSIZE and YYSTACKSIZE give the old and new number of
170 elements in the stack, and YYPTR gives the new location of the
171 stack. Advance YYPTR to a properly aligned location for the next
173 # define YYSTACK_RELOCATE(Type, Stack) \
176 YYSIZE_T yynewbytes; \
177 yymemcpy ((char *) yyptr, (char *) (Stack), \
178 yysize * (YYSIZE_T) sizeof (Type)); \
179 Stack = &yyptr->Stack; \
180 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
181 yyptr += yynewbytes / sizeof (*yyptr); \
185 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
190 /* YYFINAL -- State number of the termination state. */
191 #define YYFINAL %%{final}
192 #define YYFLAG %%{flag}
193 #define YYLAST %%{last}
195 /* YYNTOKENS -- Number of terminals. */
196 #define YYNTOKENS %%{ntokens}
197 /* YYNNTS -- Number of nonterminals. */
198 #define YYNNTS %%{nnts}
199 /* YYNRULES -- Number of rules. */
200 #define YYNRULES %%{nrules}
201 /* YYNRULES -- Number of states. */
202 #define YYNSTATES %%{nstates}
203 #define YYMAXUTOK %%{maxtok}
205 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
206 #define YYTRANSLATE(x) ((unsigned)(x) <= %%{maxtok} ? yytranslate[x] : %%{nsym})
208 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
209 static const char yytranslate[] =
215 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
217 static const short yyprhs[] =
222 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
223 static const short yyrhs[] =
228 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
229 static const short yyrline[] =
235 #if (YYDEBUG) || YYERROR_VERBOSE
236 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
237 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
238 static const char *const yytname[] =
244 /* YYTOKNUM[YYN] -- Index in YYTNAME corresponding to YYLEX. */
245 static const short yytoknum[] =
250 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
251 static const short yyr1[] =
256 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
257 static const short yyr2[] =
262 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
263 doesn't specify something else to do. Zero means the default is an
265 static const short yydefact[] =
270 /* YYPGOTO[NTERM-NUM]. */
271 static const short yydefgoto[] =
276 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
278 static const short yypact[] =
283 /* YYPGOTO[NTERM-NUM]. */
284 static const short yypgoto[] =
289 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
290 positive, shift that token. If negative, reduce the rule which
291 number is the opposite. If zero, do what YYDEFACT says. */
292 static const short yytable[] =
297 static const short yycheck[] =
303 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
304 # define YYSIZE_T __SIZE_TYPE__
306 #if ! defined (YYSIZE_T) && defined (size_t)
307 # define YYSIZE_T size_t
309 #if ! defined (YYSIZE_T)
311 # include <cstddef> /* INFRINGES ON USER NAME SPACE */
312 # define YYSIZE_T std::size_t
315 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
316 # define YYSIZE_T size_t
320 #if ! defined (YYSIZE_T)
321 # define YYSIZE_T unsigned int
324 #define yyerrok (yyerrstatus = 0)
325 #define yyclearin (yychar = YYEMPTY)
329 #define YYACCEPT goto yyacceptlab
330 #define YYABORT goto yyabortlab
331 #define YYERROR goto yyerrlab1
333 /* Like YYERROR except do call yyerror. This remains here temporarily
334 to ease the transition to the new meaning of YYERROR, for GCC.
335 Once GCC version 2 has supplanted version 1, this can go. */
337 #define YYFAIL goto yyerrlab
339 #define YYRECOVERING() (!!yyerrstatus)
341 #define YYBACKUP(Token, Value) \
343 if (yychar == YYEMPTY && yylen == 1) \
347 yychar1 = YYTRANSLATE (yychar); \
353 yyerror ("syntax error: cannot back up"); \
359 #define YYERRCODE 256
361 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
364 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
365 first token. By default, to implement support for ranges, extend
366 its range to the last symbol. */
368 #ifndef YYLLOC_DEFAULT
369 # define YYLLOC_DEFAULT(Current, Rhs, N) \
370 Current.last_line = Rhs[N].last_line; \
371 Current.last_column = Rhs[N].last_column;
374 /* YYLEX -- calling `yylex' with the right arguments. */
379 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
381 # define YYLEX yylex (&yylval, &yylloc)
383 # else /* !YYLSP_NEEDED */
385 # define YYLEX yylex (&yylval, YYLEX_PARAM)
387 # define YYLEX yylex (&yylval)
389 # endif /* !YYLSP_NEEDED */
391 # define YYLEX yylex ()
394 /* Enable debugging if requested. */
399 # include <cstdio.h> /* INFRINGES ON USER NAME SPACE */
401 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
403 # define YYFPRINTF YYSTD (fprintf)
404 # define YYSTDERR YYSTD (stderr)
407 # define YYDPRINTF(Args) \
412 /* Nonzero means print parse trace. [The following comment makes no
413 sense to me. Could someone clarify it? --akim] Since this is
414 uninitialized, it does not stop multiple parsers from coexisting.
418 # define YYDPRINTF(Args)
419 #endif /* !YYDEBUG */
421 /* YYINITDEPTH -- initial size of the parser's stacks. */
423 # define YYINITDEPTH %%{initdepth}
426 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
427 if the built-in stack extension method is used).
429 Do not make this value too large; the results are undefined if
430 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
431 evaluated with infinite-precision integer arithmetic. */
438 # define YYMAXDEPTH %%{maxdepth}
443 #if ! defined (yyoverflow) && ! defined (yymemcpy)
444 # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
445 # define yymemcpy __builtin_memcpy
446 # else /* not GNU C or C++ */
448 /* This is the most reliable way to avoid incompatibilities
449 in available built-in functions on various systems. */
451 # if defined (__STDC__) || defined (__cplusplus)
452 yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
454 yymemcpy (yyto, yyfrom, yycount)
460 register const char *yyf = yyfrom;
461 register char *yyt = yyto;
462 register YYSIZE_T yyi = yycount;
473 # if defined (__GLIBC__) && defined (_STRING_H)
474 # define yystrlen strlen
476 /* Return the length of YYSTR. */
478 # if defined (__STDC__) || defined (__cplusplus)
479 yystrlen (const char *yystr)
485 register const char *yys = yystr;
487 while (*yys++ != '\0')
490 return yys - yystr - 1;
496 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
497 # define yystpcpy stpcpy
499 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
502 # if defined (__STDC__) || defined (__cplusplus)
503 yystpcpy (char *yydest, const char *yysrc)
505 yystpcpy (yydest, yysrc)
510 register char *yyd = yydest;
511 register const char *yys = yysrc;
513 while ((*yyd++ = *yys++) != '\0')
521 #endif /* !YYERROR_VERBOSE */
525 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
526 into yyparse. The argument should have type void *.
527 It should actually point to an object.
528 Grammar actions can access the variable by casting it
529 to the proper pointer type. */
533 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
534 # define YYPARSE_PARAM_DECL
535 # else /* !__cplusplus */
536 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
537 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
538 # endif /* !__cplusplus */
539 #else /* !YYPARSE_PARAM */
540 # define YYPARSE_PARAM_ARG
541 # define YYPARSE_PARAM_DECL
542 #endif /* !YYPARSE_PARAM */
544 /* Prevent warning if -Wstrict-prototypes. */
546 # ifdef YYPARSE_PARAM
547 int yyparse (void *);
553 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
554 variables are global, or local to YYPARSE. */
556 #define YY_DECL_NON_LSP_VARIABLES \
557 /* The lookahead symbol. */ \
560 /* The semantic value of the lookahead symbol. */ \
563 /* Number of parse errors so far. */ \
567 # define YY_DECL_VARIABLES \
568 YY_DECL_NON_LSP_VARIABLES \
570 /* Location data for the lookahead symbol. */ \
573 # define YY_DECL_VARIABLES \
574 YY_DECL_NON_LSP_VARIABLES
577 /* If nonreentrant, generate the variables here. */
584 yyparse (YYPARSE_PARAM_ARG)
587 /* If reentrant, generate the variables here. */
592 register int yystate;
595 /* Number of tokens to shift before error messages enabled. */
597 /* Lookahead token as an internal (translated) token number. */
600 /* Three stacks and their tools:
601 `yyss': related to states,
602 `yyvs': related to semantic values,
603 `yyls': related to locations.
605 Refer to the stacks thru separate pointers, to allow yyoverflow
606 to reallocate them elsewhere. */
608 /* The state stack. */
609 short yyssa[YYINITDEPTH];
611 register short *yyssp;
613 /* The semantic value stack. */
614 YYSTYPE yyvsa[YYINITDEPTH];
615 YYSTYPE *yyvs = yyvsa;
616 register YYSTYPE *yyvsp;
619 /* The location stack. */
620 YYLTYPE yylsa[YYINITDEPTH];
621 YYLTYPE *yyls = yylsa;
626 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
628 # define YYPOPSTACK (yyvsp--, yyssp--)
631 YYSIZE_T yystacksize = YYINITDEPTH;
633 /* The variables used to return semantic value and location from the
640 /* When reducing, the number of symbols on the RHS of the reduced
644 YYDPRINTF ((YYSTDERR, "Starting parse\n"));
649 yychar = YYEMPTY; /* Cause a token to be read. */
651 /* Initialize stack pointers.
652 Waste one element of value and location stack
653 so that they stay on the same level as the state stack.
654 The wasted elements are never initialized. */
663 /*------------------------------------------------------------.
664 | yynewstate -- Push a new state, which is found in yystate. |
665 `------------------------------------------------------------*/
667 /* In all cases, when you get here, the value and location stacks
668 have just been pushed. so pushing a state here evens the stacks.
675 if (yyssp >= yyss + yystacksize - 1)
677 /* Get the current used size of the three stacks, in elements. */
678 YYSIZE_T yysize = yyssp - yyss + 1;
682 /* Give user a chance to reallocate the stack. Use copies of
683 these so that the &'s don't force the real ones into
685 YYSTYPE *yyvs1 = yyvs;
688 /* Each stack pointer address is followed by the size of the
689 data in use in that stack, in bytes. */
691 YYLTYPE *yyls1 = yyls;
692 /* This used to be a conditional around just the two extra args,
693 but that might be undefined if yyoverflow is a macro. */
694 yyoverflow ("parser stack overflow",
695 &yyss1, yysize * sizeof (*yyssp),
696 &yyvs1, yysize * sizeof (*yyvsp),
697 &yyls1, yysize * sizeof (*yylsp),
701 yyoverflow ("parser stack overflow",
702 &yyss1, yysize * sizeof (*yyssp),
703 &yyvs1, yysize * sizeof (*yyvsp),
709 #else /* no yyoverflow */
710 /* Extend the stack our own way. */
711 if (yystacksize >= YYMAXDEPTH)
714 if (yystacksize > YYMAXDEPTH)
715 yystacksize = YYMAXDEPTH;
719 union yyalloc *yyptr =
720 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
723 YYSTACK_RELOCATE (short, yyss);
724 YYSTACK_RELOCATE (YYSTYPE, yyvs);
726 YYSTACK_RELOCATE (YYLTYPE, yyls);
728 # undef YYSTACK_RELOCATE
730 YYSTACK_FREE (yyss1);
732 #endif /* no yyoverflow */
734 yyssp = yyss + yysize - 1;
735 yyvsp = yyvs + yysize - 1;
737 yylsp = yyls + yysize - 1;
740 YYDPRINTF ((YYSTDERR, "Stack size increased to %lu\n",
741 (unsigned long int) yystacksize));
743 if (yyssp >= yyss + yystacksize - 1)
747 YYDPRINTF ((YYSTDERR, "Entering state %d\n", yystate));
756 /* Do appropriate processing given the current state. */
757 /* Read a lookahead token if we need one and don't already have one. */
760 /* First try to decide what to do without reference to lookahead token. */
762 yyn = yypact[yystate];
766 /* Not known => get a lookahead token if don't already have one. */
768 /* yychar is either YYEMPTY or YYEOF
769 or a valid token in external form. */
771 if (yychar == YYEMPTY)
773 YYDPRINTF ((YYSTDERR, "Reading a token: "));
777 /* Convert token to internal form (in yychar1) for indexing tables with. */
779 if (yychar <= 0) /* This means end of input. */
782 yychar = YYEOF; /* Don't call YYLEX any more. */
784 YYDPRINTF ((YYSTDERR, "Now at end of input.\n"));
788 yychar1 = YYTRANSLATE (yychar);
791 /* We have to keep this `#if YYDEBUG', since we use variables
792 which are defined only if `YYDEBUG' is set. */
795 YYFPRINTF (YYSTDERR, "Next token is %d (%s",
796 yychar, yytname[yychar1]);
797 /* Give the individual parser a way to print the precise
798 meaning of a token, for further debugging info. */
800 YYPRINT (YYSTDERR, yychar, yylval);
802 YYFPRINTF (YYSTDERR, ")\n");
808 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
813 /* yyn is what to do for this token type in this state.
814 Negative => reduce, -yyn is rule number.
815 Positive => shift, yyn is new state.
816 New state is final state => don't bother to shift,
818 0, or most negative number => error. */
833 /* Shift the lookahead token. */
834 YYDPRINTF ((YYSTDERR, "Shifting token %d (%s), ",
835 yychar, yytname[yychar1]));
837 /* Discard the token being shifted unless it is eof. */
846 /* Count tokens shifted since error; after three, turn off error
855 /*-----------------------------------------------------------.
856 | yydefault -- do the default action for the current state. |
857 `-----------------------------------------------------------*/
859 yyn = yydefact[yystate];
865 /*-----------------------------.
866 | yyreduce -- Do a reduction. |
867 `-----------------------------*/
869 /* yyn is the number of a rule to reduce with. */
872 /* If YYLEN is nonzero, implement the default value of the action:
875 Otherwise, the following line sets YYVAL to the semantic value of
876 the lookahead token. This behavior is undocumented and Bison
877 users should not rely upon it. Assigning to YYVAL
878 unconditionally makes the parser a bit smaller, and it avoids a
879 GCC warning that YYVAL may be used uninitialized. */
880 yyval = yyvsp[1-yylen];
883 /* Similarly for the default location. Let the user run additional
884 commands if for instance locations are ranges. */
885 yyloc = yylsp[1-yylen];
886 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
890 /* We have to keep this `#if YYDEBUG', since we use variables which
891 are defined only if `YYDEBUG' is set. */
896 YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
897 yyn - 1, yyrline[yyn]);
899 /* Print the symbols being reduced, and their result. */
900 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
901 YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
902 YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
910 /* Line %%{skeleton-line} of %%{skeleton}. */
911 #line %%{line} "%%{parser-file-name}"
922 short *yyssp1 = yyss - 1;
923 YYFPRINTF (YYSTDERR, "state stack now");
924 while (yyssp1 != yyssp)
925 YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
926 YYFPRINTF (YYSTDERR, "\n");
935 /* Now `shift' the result of the reduction. Determine what state
936 that goes to, based on the state we popped back to and the rule
937 number reduced by. */
941 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
942 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
943 yystate = yytable[yystate];
945 yystate = yydefgoto[yyn - YYNTOKENS];
950 /*------------------------------------.
951 | yyerrlab -- here on detecting error |
952 `------------------------------------*/
954 /* If not already recovering from an error, report this error. */
960 yyn = yypact[yystate];
962 if (yyn > YYFLAG && yyn < YYLAST)
969 /* Start YYX at -YYN if negative to avoid negative indexes in
971 for (yyx = yyn < 0 ? -yyn : 0;
972 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
973 if (yycheck[yyx + yyn] == yyx)
974 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
975 yysize += yystrlen ("parse error, unexpected ") + 1;
976 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
977 yymsg = (char *) YYSTACK_ALLOC (yysize);
980 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
981 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
986 for (yyx = yyn < 0 ? -yyn : 0;
987 yyx < (int) (sizeof (yytname) / sizeof (char *));
989 if (yycheck[yyx + yyn] == yyx)
991 const char *yyq = ! yycount ? ", expecting " : " or ";
992 yyp = yystpcpy (yyp, yyq);
993 yyp = yystpcpy (yyp, yytname[yyx]);
998 YYSTACK_FREE (yymsg);
1001 yyerror ("parse error; also virtual memory exhausted");
1004 #endif /* YYERROR_VERBOSE */
1005 yyerror ("parse error");
1010 /*----------------------------------------------------.
1011 | yyerrlab1 -- error raised explicitly by an action. |
1012 `----------------------------------------------------*/
1014 if (yyerrstatus == 3)
1016 /* If just tried and failed to reuse lookahead token after an
1017 error, discard it. */
1019 /* Return failure if at end of input. */
1020 if (yychar == YYEOF)
1022 YYDPRINTF ((YYSTDERR, "Discarding token %d (%s).\n",
1023 yychar, yytname[yychar1]));
1027 /* Else will try to reuse lookahead token after shifting the error
1030 yyerrstatus = 3; /* Each real token shifted decrements this. */
1035 /*-------------------------------------------------------------------.
1036 | yyerrdefault -- current state does not do anything special for the |
1038 `-------------------------------------------------------------------*/
1041 /* This is wrong; only states that explicitly want error tokens
1042 should shift them. */
1044 /* If its default is to accept any token, ok. Otherwise pop it. */
1045 yyn = yydefact[yystate];
1051 /*---------------------------------------------------------------.
1052 | yyerrpop -- pop the current state because it cannot handle the |
1054 `---------------------------------------------------------------*/
1067 short *yyssp1 = yyss - 1;
1068 YYFPRINTF (YYSTDERR, "Error: state stack now");
1069 while (yyssp1 != yyssp)
1070 YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
1071 YYFPRINTF (YYSTDERR, "\n");
1079 yyn = yypact[yystate];
1084 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1101 YYDPRINTF ((YYSTDERR, "Shifting error token, "));
1112 /*-------------------------------------.
1113 | yyacceptlab -- YYACCEPT comes here. |
1114 `-------------------------------------*/
1119 /*-----------------------------------.
1120 | yyabortlab -- YYABORT comes here. |
1121 `-----------------------------------*/
1126 /*---------------------------------------------.
1127 | yyoverflowab -- parser overflow comes here. |
1128 `---------------------------------------------*/
1130 yyerror ("parser stack overflow");
1137 YYSTACK_FREE (yyss);