1 m4_divert(-1) -*- C -*-
5 # Return the smallest signed int type able to handle the number MAX.
6 m4_define([b4_sint_type],
7 [m4_if(m4_eval([$1 <= 127]), [1], [signed char],
8 m4_eval([$1 <= 32767]), [1], [signed short],
9 m4_eval([$1 <= 2147483647]), [1], [signed int],
10 [m4_fatal([no signed int type for $1])])])
15 # Return the smallest unsigned int type able to handle the number MAX.
16 m4_define([b4_uint_type],
17 [m4_if(m4_eval([$1 <= 255]), [1], [unsigned char],
18 m4_eval([$1 <= 65535]), [1], [unsigned short],
19 m4_eval([$1 <= 4294967295]), [1], [unsigned int],
20 [m4_fatal([no unsigned int type for $1])])])
23 m4_define_default([b4_input_suffix], [.y])
25 m4_define_default([b4_output_parser_suffix],
26 [m4_translit(b4_input_suffix, [yY], [cC])])
28 m4_define_default([b4_output_parser_name],
29 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])
32 m4_define_default([b4_output_header_suffix],
33 [m4_translit(b4_input_suffix, [yY], [hH])])
35 m4_define_default([b4_output_header_name],
36 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])
38 m4_define_default([b4_header_guard],
39 [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
40 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
43 # b4_token_defines(TOKEN-NAME, TOKEN-NUMBER)
44 # ------------------------------------------
45 # Output the definition of this token as #define.
46 m4_define([b4_token_define],
51 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
52 # -------------------------------------------------------
53 # Output the definition of the tokens as #define.
54 m4_define([b4_token_defines],
55 [m4_map([b4_token_define], [$@])])
59 #output "b4_output_parser_name"
60 /* A Bison parser, made from b4_filename
61 by GNU bison b4_version. */
63 /* Skeleton output parser for Bison,
64 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
67 This program is free software; you can redistribute it and/or modify
68 it under the terms of the GNU General Public License as published by
69 the Free Software Foundation; either version 2, or (at your option)
72 This program is distributed in the hope that it will be useful,
73 but WITHOUT ANY WARRANTY; without even the implied warranty of
74 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75 GNU General Public License for more details.
77 You should have received a copy of the GNU General Public License
78 along with this program; if not, write to the Free Software
79 Foundation, Inc., 59 Temple Place - Suite 330,
80 Boston, MA 02111-1307, USA. */
82 /* As a special exception, when this file is copied by Bison into a
83 Bison output file, you may use that output file without restriction.
84 This special exception was added by the Free Software Foundation
85 in version 1.24 of Bison. */
87 /* This is the parser code that is written into each bison parser when
88 the %semantic_parser declaration is not specified in the grammar.
89 It was written by Richard Stallman by simplifying the hairy parser
90 used when %semantic_parser is specified. */
92 /* All symbols defined below should begin with yy or YY, to avoid
93 infringing on user name space. This should be done even for local
94 variables, as they might otherwise be expanded by user macros.
95 There are some unavoidable exceptions within include files to
96 define necessary library symbols; they are noted "INFRINGES ON
97 USER NAME SPACE" below. */
99 /* Identify Bison output. */
103 #define YYPURE b4_pure
105 /* Using locations. */
106 #define YYLSP_NEEDED b4_locations_flag
108 m4_if(b4_prefix[], [yy], [],
109 [/* If NAME_PREFIX is specified substitute the variables and functions
111 #define yyparse b4_prefix[]parse
112 #define yylex b4_prefix[]lex
113 #define yyerror b4_prefix[]error
114 #define yylval b4_prefix[]lval
115 #define yychar b4_prefix[]char
116 #define yydebug b4_prefix[]debug
117 #define yynerrs b4_prefix[]nerrs
119 # define yylloc b4_prefix[]lloc
123 /* Copy the first part of user declarations. */
126 /* Enabling traces. */
128 # define YYDEBUG b4_debug
131 /* Enabling verbose error messages. */
132 #ifdef YYERROR_VERBOSE
133 # undef YYERROR_VERBOSE
134 # define YYERROR_VERBOSE 1
136 # define YYERROR_VERBOSE b4_error_verbose
140 m4_ifdef([b4_stype_line],
141 [#line b4_stype_line "b4_filename"
143 typedef b4_stype yystype;
144 # define YYSTYPE yystype
145 # define YYSTYPE_IS_TRIVIAL 1
149 typedef struct yyltype
156 # define YYLTYPE b4_ltype
157 # define YYLTYPE_IS_TRIVIAL 1
160 /* Copy the second part of user declarations. */
163 /* Line __line__ of __file__. */
164 #line __oline__ "__ofile__"
166 #if ! defined (yyoverflow) || YYERROR_VERBOSE
168 /* The parser invokes alloca or malloc; define the necessary symbols. */
170 # if YYSTACK_USE_ALLOCA
171 # define YYSTACK_ALLOC alloca
173 # ifndef YYSTACK_USE_ALLOCA
174 # if defined (alloca) || defined (_ALLOCA_H)
175 # define YYSTACK_ALLOC alloca
178 # define YYSTACK_ALLOC __builtin_alloca
184 # ifdef YYSTACK_ALLOC
185 /* Pacify GCC's `empty if-body' warning. */
186 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
188 # if defined (__STDC__) || defined (__cplusplus)
189 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
190 # define YYSIZE_T size_t
192 # define YYSTACK_ALLOC malloc
193 # define YYSTACK_FREE free
195 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
198 #if (! defined (yyoverflow) \
199 && (! defined (__cplusplus) \
200 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
202 /* A type that is properly aligned for any stack member. */
212 /* The size of the maximum gap between one aligned stack and the next. */
213 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
215 /* The size of an array large to enough to hold all stacks, each with
218 # define YYSTACK_BYTES(N) \
219 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
220 + 2 * YYSTACK_GAP_MAX)
222 # define YYSTACK_BYTES(N) \
223 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
227 /* Copy COUNT objects from FROM to TO. The source and destination do
231 # define YYCOPY(To, From, Count) \
232 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
234 # define YYCOPY(To, From, Count) \
237 register YYSIZE_T yyi; \
238 for (yyi = 0; yyi < (Count); yyi++) \
239 (To)[[yyi]] = (From)[[yyi]]; \
245 /* Relocate STACK from its old location to the new one. The
246 local variables YYSIZE and YYSTACKSIZE give the old and new number of
247 elements in the stack, and YYPTR gives the new location of the
248 stack. Advance YYPTR to a properly aligned location for the next
250 # define YYSTACK_RELOCATE(Stack) \
253 YYSIZE_T yynewbytes; \
254 YYCOPY (&yyptr->Stack, Stack, yysize); \
255 Stack = &yyptr->Stack; \
256 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
257 yyptr += yynewbytes / sizeof (*yyptr); \
264 b4_token_defines(b4_tokens)
266 /* YYFINAL -- State number of the termination state. */
267 #define YYFINAL b4_final
268 #define YYFLAG b4_flag
269 #define YYLAST b4_last
271 /* YYNTOKENS -- Number of terminals. */
272 #define YYNTOKENS b4_ntokens
273 /* YYNNTS -- Number of nonterminals. */
274 #define YYNNTS b4_nnts
275 /* YYNRULES -- Number of rules. */
276 #define YYNRULES b4_nrules
277 /* YYNRULES -- Number of states. */
278 #define YYNSTATES b4_nstates
280 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
281 #define YYUNDEFTOK b4_undef_token_number
282 #define YYMAXUTOK b4_user_token_number_max
284 typedef b4_uint_type(b4_token_number_max) yy_token_number_type;
285 #define YYTRANSLATE(X) \
286 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
288 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
289 static const yy_token_number_type yytranslate[[]] =
295 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
297 static const short yyprhs[[]] =
302 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
303 typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
304 static const yyrhs_t yyrhs[[]] =
309 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
310 static const short yyrline[[]] =
316 #if (YYDEBUG) || YYERROR_VERBOSE
317 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
318 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
319 static const char *const yytname[[]] =
325 /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */
326 static const short yytoknum[[]] =
331 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
332 static const yy_token_number_type yyr1[[]] =
337 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
338 static const short yyr2[[]] =
343 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
344 doesn't specify something else to do. Zero means the default is an
346 static const short yydefact[[]] =
351 /* YYPGOTO[[NTERM-NUM]]. */
352 static const short yydefgoto[[]] =
357 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
359 static const short yypact[[]] =
364 /* YYPGOTO[[NTERM-NUM]]. */
365 static const short yypgoto[[]] =
370 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
371 positive, shift that token. If negative, reduce the rule which
372 number is the opposite. If zero, do what YYDEFACT says. */
373 static const short yytable[[]] =
378 static const short yycheck[[]] =
384 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
385 # define YYSIZE_T __SIZE_TYPE__
387 #if ! defined (YYSIZE_T) && defined (size_t)
388 # define YYSIZE_T size_t
390 #if ! defined (YYSIZE_T)
391 # if defined (__STDC__) || defined (__cplusplus)
392 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
393 # define YYSIZE_T size_t
396 #if ! defined (YYSIZE_T)
397 # define YYSIZE_T unsigned int
400 #define yyerrok (yyerrstatus = 0)
401 #define yyclearin (yychar = YYEMPTY)
405 #define YYACCEPT goto yyacceptlab
406 #define YYABORT goto yyabortlab
407 #define YYERROR goto yyerrlab1
409 /* Like YYERROR except do call yyerror. This remains here temporarily
410 to ease the transition to the new meaning of YYERROR, for GCC.
411 Once GCC version 2 has supplanted version 1, this can go. */
413 #define YYFAIL goto yyerrlab
415 #define YYRECOVERING() (!!yyerrstatus)
417 #define YYBACKUP(Token, Value) \
419 if (yychar == YYEMPTY && yylen == 1) \
423 yychar1 = YYTRANSLATE (yychar); \
429 yyerror ("syntax error: cannot back up"); \
435 #define YYERRCODE 256
437 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
440 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
441 first token. By default, to implement support for ranges, extend
442 its range to the last symbol. */
444 #ifndef YYLLOC_DEFAULT
445 # define YYLLOC_DEFAULT(Current, Rhs, N) \
446 Current.last_line = Rhs[[N]].last_line; \
447 Current.last_column = Rhs[[N]].last_column;
450 /* YYLEX -- calling `yylex' with the right arguments. */
455 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
457 # define YYLEX yylex (&yylval, &yylloc)
459 # else /* !YYLSP_NEEDED */
461 # define YYLEX yylex (&yylval, YYLEX_PARAM)
463 # define YYLEX yylex (&yylval)
465 # endif /* !YYLSP_NEEDED */
467 # define YYLEX yylex ()
470 /* Enable debugging if requested. */
474 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
475 # define YYFPRINTF fprintf
478 # define YYDPRINTF(Args) \
483 /* Nonzero means print parse trace. It is left uninitialized so that
484 multiple parsers can coexist. */
487 # define YYDPRINTF(Args)
488 #endif /* !YYDEBUG */
490 /* YYINITDEPTH -- initial size of the parser's stacks. */
492 # define YYINITDEPTH b4_initdepth
495 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
496 if the built-in stack extension method is used).
498 Do not make this value too large; the results are undefined if
499 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
500 evaluated with infinite-precision integer arithmetic. */
507 # define YYMAXDEPTH b4_maxdepth
515 # if defined (__GLIBC__) && defined (_STRING_H)
516 # define yystrlen strlen
518 /* Return the length of YYSTR. */
520 # if defined (__STDC__) || defined (__cplusplus)
521 yystrlen (const char *yystr)
527 register const char *yys = yystr;
529 while (*yys++ != '\0')
532 return yys - yystr - 1;
538 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
539 # define yystpcpy stpcpy
541 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
544 # if defined (__STDC__) || defined (__cplusplus)
545 yystpcpy (char *yydest, const char *yysrc)
547 yystpcpy (yydest, yysrc)
552 register char *yyd = yydest;
553 register const char *yys = yysrc;
555 while ((*yyd++ = *yys++) != '\0')
563 #endif /* !YYERROR_VERBOSE */
567 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
568 into yyparse. The argument should have type void *.
569 It should actually point to an object.
570 Grammar actions can access the variable by casting it
571 to the proper pointer type. */
574 # if defined (__STDC__) || defined (__cplusplus)
575 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
576 # define YYPARSE_PARAM_DECL
578 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
579 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
581 #else /* !YYPARSE_PARAM */
582 # define YYPARSE_PARAM_ARG
583 # define YYPARSE_PARAM_DECL
584 #endif /* !YYPARSE_PARAM */
586 /* Prevent warning if -Wstrict-prototypes. */
588 # ifdef YYPARSE_PARAM
589 int yyparse (void *);
595 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
596 variables are global, or local to YYPARSE. */
598 #define YY_DECL_NON_LSP_VARIABLES \
599 /* The lookahead symbol. */ \
602 /* The semantic value of the lookahead symbol. */ \
605 /* Number of parse errors so far. */ \
609 # define YY_DECL_VARIABLES \
610 YY_DECL_NON_LSP_VARIABLES \
612 /* Location data for the lookahead symbol. */ \
615 # define YY_DECL_VARIABLES \
616 YY_DECL_NON_LSP_VARIABLES
619 /* If nonreentrant, generate the variables here. */
626 yyparse (YYPARSE_PARAM_ARG)
629 /* If reentrant, generate the variables here. */
634 register int yystate;
637 /* Number of tokens to shift before error messages enabled. */
639 /* Lookahead token as an internal (translated) token number. */
642 /* Three stacks and their tools:
643 `yyss': related to states,
644 `yyvs': related to semantic values,
645 `yyls': related to locations.
647 Refer to the stacks thru separate pointers, to allow yyoverflow
648 to reallocate them elsewhere. */
650 /* The state stack. */
651 short yyssa[YYINITDEPTH];
653 register short *yyssp;
655 /* The semantic value stack. */
656 YYSTYPE yyvsa[YYINITDEPTH];
657 YYSTYPE *yyvs = yyvsa;
658 register YYSTYPE *yyvsp;
661 /* The location stack. */
662 YYLTYPE yylsa[YYINITDEPTH];
663 YYLTYPE *yyls = yylsa;
668 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
670 # define YYPOPSTACK (yyvsp--, yyssp--)
673 YYSIZE_T yystacksize = YYINITDEPTH;
675 /* The variables used to return semantic value and location from the
682 /* When reducing, the number of symbols on the RHS of the reduced
686 YYDPRINTF ((stderr, "Starting parse\n"));
691 yychar = YYEMPTY; /* Cause a token to be read. */
693 /* Initialize stack pointers.
694 Waste one element of value and location stack
695 so that they stay on the same level as the state stack.
696 The wasted elements are never initialized. */
705 /*------------------------------------------------------------.
706 | yynewstate -- Push a new state, which is found in yystate. |
707 `------------------------------------------------------------*/
709 /* In all cases, when you get here, the value and location stacks
710 have just been pushed. so pushing a state here evens the stacks.
717 if (yyssp >= yyss + yystacksize - 1)
719 /* Get the current used size of the three stacks, in elements. */
720 YYSIZE_T yysize = yyssp - yyss + 1;
724 /* Give user a chance to reallocate the stack. Use copies of
725 these so that the &'s don't force the real ones into
727 YYSTYPE *yyvs1 = yyvs;
730 /* Each stack pointer address is followed by the size of the
731 data in use in that stack, in bytes. */
733 YYLTYPE *yyls1 = yyls;
734 /* This used to be a conditional around just the two extra args,
735 but that might be undefined if yyoverflow is a macro. */
736 yyoverflow ("parser stack overflow",
737 &yyss1, yysize * sizeof (*yyssp),
738 &yyvs1, yysize * sizeof (*yyvsp),
739 &yyls1, yysize * sizeof (*yylsp),
743 yyoverflow ("parser stack overflow",
744 &yyss1, yysize * sizeof (*yyssp),
745 &yyvs1, yysize * sizeof (*yyvsp),
751 #else /* no yyoverflow */
752 # ifndef YYSTACK_RELOCATE
755 /* Extend the stack our own way. */
756 if (yystacksize >= YYMAXDEPTH)
759 if (yystacksize > YYMAXDEPTH)
760 yystacksize = YYMAXDEPTH;
764 union yyalloc *yyptr =
765 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
768 YYSTACK_RELOCATE (yyss);
769 YYSTACK_RELOCATE (yyvs);
771 YYSTACK_RELOCATE (yyls);
773 # undef YYSTACK_RELOCATE
775 YYSTACK_FREE (yyss1);
778 #endif /* no yyoverflow */
780 yyssp = yyss + yysize - 1;
781 yyvsp = yyvs + yysize - 1;
783 yylsp = yyls + yysize - 1;
786 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
787 (unsigned long int) yystacksize));
789 if (yyssp >= yyss + yystacksize - 1)
793 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
802 /* Do appropriate processing given the current state. */
803 /* Read a lookahead token if we need one and don't already have one. */
806 /* First try to decide what to do without reference to lookahead token. */
808 yyn = yypact[yystate];
812 /* Not known => get a lookahead token if don't already have one. */
814 /* yychar is either YYEMPTY or YYEOF
815 or a valid token in external form. */
817 if (yychar == YYEMPTY)
819 YYDPRINTF ((stderr, "Reading a token: "));
823 /* Convert token to internal form (in yychar1) for indexing tables with. */
825 if (yychar <= 0) /* This means end of input. */
828 yychar = YYEOF; /* Don't call YYLEX any more. */
830 YYDPRINTF ((stderr, "Now at end of input.\n"));
834 yychar1 = YYTRANSLATE (yychar);
837 /* We have to keep this `#if YYDEBUG', since we use variables
838 which are defined only if `YYDEBUG' is set. */
841 YYFPRINTF (stderr, "Next token is %d (%s",
842 yychar, yytname[yychar1]);
843 /* Give the individual parser a way to print the precise
844 meaning of a token, for further debugging info. */
846 YYPRINT (stderr, yychar, yylval);
848 YYFPRINTF (stderr, ")\n");
854 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
859 /* yyn is what to do for this token type in this state.
860 Negative => reduce, -yyn is rule number.
861 Positive => shift, yyn is new state.
862 New state is final state => don't bother to shift,
864 0, or most negative number => error. */
879 /* Shift the lookahead token. */
880 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
881 yychar, yytname[yychar1]));
883 /* Discard the token being shifted unless it is eof. */
892 /* Count tokens shifted since error; after three, turn off error
901 /*-----------------------------------------------------------.
902 | yydefault -- do the default action for the current state. |
903 `-----------------------------------------------------------*/
905 yyn = yydefact[yystate];
911 /*-----------------------------.
912 | yyreduce -- Do a reduction. |
913 `-----------------------------*/
915 /* yyn is the number of a rule to reduce with. */
918 /* If YYLEN is nonzero, implement the default value of the action:
921 Otherwise, the following line sets YYVAL to the semantic value of
922 the lookahead token. This behavior is undocumented and Bison
923 users should not rely upon it. Assigning to YYVAL
924 unconditionally makes the parser a bit smaller, and it avoids a
925 GCC warning that YYVAL may be used uninitialized. */
926 yyval = yyvsp[1-yylen];
929 /* Similarly for the default location. Let the user run additional
930 commands if for instance locations are ranges. */
931 yyloc = yylsp[1-yylen];
932 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
936 /* We have to keep this `#if YYDEBUG', since we use variables which
937 are defined only if `YYDEBUG' is set. */
942 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
943 yyn - 1, yyrline[yyn]);
945 /* Print the symbols being reduced, and their result. */
946 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
947 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
948 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
956 /* Line __line__ of __file__. */
957 #line __oline__ "__ofile__"
968 short *yyssp1 = yyss - 1;
969 YYFPRINTF (stderr, "state stack now");
970 while (yyssp1 != yyssp)
971 YYFPRINTF (stderr, " %d", *++yyssp1);
972 YYFPRINTF (stderr, "\n");
981 /* Now `shift' the result of the reduction. Determine what state
982 that goes to, based on the state we popped back to and the rule
983 number reduced by. */
987 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
988 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
989 yystate = yytable[yystate];
991 yystate = yydefgoto[yyn - YYNTOKENS];
996 /*------------------------------------.
997 | yyerrlab -- here on detecting error |
998 `------------------------------------*/
1000 /* If not already recovering from an error, report this error. */
1006 yyn = yypact[yystate];
1008 if (yyn > YYFLAG && yyn < YYLAST)
1010 YYSIZE_T yysize = 0;
1015 /* Start YYX at -YYN if negative to avoid negative indexes in
1017 for (yyx = yyn < 0 ? -yyn : 0;
1018 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1019 if (yycheck[yyx + yyn] == yyx)
1020 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1021 yysize += yystrlen ("parse error, unexpected ") + 1;
1022 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1023 yymsg = (char *) YYSTACK_ALLOC (yysize);
1026 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1027 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1032 for (yyx = yyn < 0 ? -yyn : 0;
1033 yyx < (int) (sizeof (yytname) / sizeof (char *));
1035 if (yycheck[yyx + yyn] == yyx)
1037 const char *yyq = ! yycount ? ", expecting " : " or ";
1038 yyp = yystpcpy (yyp, yyq);
1039 yyp = yystpcpy (yyp, yytname[yyx]);
1044 YYSTACK_FREE (yymsg);
1047 yyerror ("parse error; also virtual memory exhausted");
1050 #endif /* YYERROR_VERBOSE */
1051 yyerror ("parse error");
1056 /*----------------------------------------------------.
1057 | yyerrlab1 -- error raised explicitly by an action. |
1058 `----------------------------------------------------*/
1060 if (yyerrstatus == 3)
1062 /* If just tried and failed to reuse lookahead token after an
1063 error, discard it. */
1065 /* Return failure if at end of input. */
1066 if (yychar == YYEOF)
1068 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1069 yychar, yytname[yychar1]));
1073 /* Else will try to reuse lookahead token after shifting the error
1076 yyerrstatus = 3; /* Each real token shifted decrements this. */
1081 /*-------------------------------------------------------------------.
1082 | yyerrdefault -- current state does not do anything special for the |
1084 `-------------------------------------------------------------------*/
1087 /* This is wrong; only states that explicitly want error tokens
1088 should shift them. */
1090 /* If its default is to accept any token, ok. Otherwise pop it. */
1091 yyn = yydefact[yystate];
1097 /*---------------------------------------------------------------.
1098 | yyerrpop -- pop the current state because it cannot handle the |
1100 `---------------------------------------------------------------*/
1113 short *yyssp1 = yyss - 1;
1114 YYFPRINTF (stderr, "Error: state stack now");
1115 while (yyssp1 != yyssp)
1116 YYFPRINTF (stderr, " %d", *++yyssp1);
1117 YYFPRINTF (stderr, "\n");
1125 yyn = yypact[yystate];
1130 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1147 YYDPRINTF ((stderr, "Shifting error token, "));
1158 /*-------------------------------------.
1159 | yyacceptlab -- YYACCEPT comes here. |
1160 `-------------------------------------*/
1165 /*-----------------------------------.
1166 | yyabortlab -- YYABORT comes here. |
1167 `-----------------------------------*/
1172 /*---------------------------------------------.
1173 | yyoverflowab -- parser overflow comes here. |
1174 `---------------------------------------------*/
1176 yyerror ("parser stack overflow");
1183 YYSTACK_FREE (yyss);
1189 m4_if(b4_defines_flag, 0, [],
1190 [#output "b4_output_header_name"
1191 #ifndef b4_header_guard
1192 # define b4_header_guard
1194 b4_token_defines(b4_tokens)
1197 m4_ifdef([b4_stype_line],
1198 [#line b4_stype_line "b4_filename"
1202 # define YYSTYPE yystype
1206 [extern YYSTYPE b4_prefix[]lval;])
1208 m4_if(b4_locations_flag, [0], [],
1210 typedef struct yyltype
1217 # define YYLTYPE yyltype
1221 [extern YYLTYPE b4_prefix[]lloc;])
1223 #endif /* not b4_header_guard */