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
148 typedef struct yyltype
155 # define YYLTYPE b4_ltype
158 /* Copy the second part of user declarations. */
161 /* Line __line__ of __file__. */
162 #line __oline__ "__ofile__"
164 #if ! defined (yyoverflow) || YYERROR_VERBOSE
166 /* The parser invokes alloca or malloc; define the necessary symbols. */
168 # if YYSTACK_USE_ALLOCA
169 # define YYSTACK_ALLOC alloca
171 # ifndef YYSTACK_USE_ALLOCA
172 # if defined (alloca) || defined (_ALLOCA_H)
173 # define YYSTACK_ALLOC alloca
176 # define YYSTACK_ALLOC __builtin_alloca
182 # ifdef YYSTACK_ALLOC
183 /* Pacify GCC's `empty if-body' warning. */
184 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
186 # if defined (__STDC__) || defined (__cplusplus)
187 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
188 # define YYSIZE_T size_t
190 # define YYSTACK_ALLOC malloc
191 # define YYSTACK_FREE free
193 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
196 #if (! defined (yyoverflow) \
197 && (! defined (__cplusplus) \
198 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
200 /* A type that is properly aligned for any stack member. */
210 /* The size of the maximum gap between one aligned stack and the next. */
211 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
213 /* The size of an array large to enough to hold all stacks, each with
216 # define YYSTACK_BYTES(N) \
217 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
218 + 2 * YYSTACK_GAP_MAX)
220 # define YYSTACK_BYTES(N) \
221 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
225 /* Copy COUNT objects from FROM to TO. The source and destination do
229 # define YYCOPY(To, From, Count) \
230 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
232 # define YYCOPY(To, From, Count) \
235 register YYSIZE_T yyi; \
236 for (yyi = 0; yyi < (Count); yyi++) \
237 (To)[yyi] = (From)[yyi]; \
243 /* Relocate STACK from its old location to the new one. The
244 local variables YYSIZE and YYSTACKSIZE give the old and new number of
245 elements in the stack, and YYPTR gives the new location of the
246 stack. Advance YYPTR to a properly aligned location for the next
248 # define YYSTACK_RELOCATE(Stack) \
251 YYSIZE_T yynewbytes; \
252 YYCOPY (&yyptr->Stack, Stack, yysize); \
253 Stack = &yyptr->Stack; \
254 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
255 yyptr += yynewbytes / sizeof (*yyptr); \
262 b4_token_defines(b4_tokens)
264 /* YYFINAL -- State number of the termination state. */
265 #define YYFINAL b4_final
266 #define YYFLAG b4_flag
267 #define YYLAST b4_last
269 /* YYNTOKENS -- Number of terminals. */
270 #define YYNTOKENS b4_ntokens
271 /* YYNNTS -- Number of nonterminals. */
272 #define YYNNTS b4_nnts
273 /* YYNRULES -- Number of rules. */
274 #define YYNRULES b4_nrules
275 /* YYNRULES -- Number of states. */
276 #define YYNSTATES b4_nstates
278 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
279 #define YYUNDEFTOK b4_undef_token_number
280 #define YYMAXUTOK b4_user_token_number_max
282 typedef b4_uint_type(b4_token_number_max) yy_token_number_type;
283 #define YYTRANSLATE(X) \
284 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
286 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
287 static const yy_token_number_type yytranslate[[]] =
293 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
295 static const short yyprhs[[]] =
300 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
301 typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
302 static const yyrhs_t yyrhs[[]] =
307 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
308 static const short yyrline[[]] =
314 #if (YYDEBUG) || YYERROR_VERBOSE
315 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
316 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
317 static const char *const yytname[[]] =
323 /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */
324 static const short yytoknum[[]] =
329 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
330 static const yy_token_number_type yyr1[[]] =
335 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
336 static const short yyr2[[]] =
341 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
342 doesn't specify something else to do. Zero means the default is an
344 static const short yydefact[[]] =
349 /* YYPGOTO[[NTERM-NUM]]. */
350 static const short yydefgoto[[]] =
355 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
357 static const short yypact[[]] =
362 /* YYPGOTO[[NTERM-NUM]]. */
363 static const short yypgoto[[]] =
368 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
369 positive, shift that token. If negative, reduce the rule which
370 number is the opposite. If zero, do what YYDEFACT says. */
371 static const short yytable[[]] =
376 static const short yycheck[[]] =
382 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
383 # define YYSIZE_T __SIZE_TYPE__
385 #if ! defined (YYSIZE_T) && defined (size_t)
386 # define YYSIZE_T size_t
388 #if ! defined (YYSIZE_T)
389 # if defined (__STDC__) || defined (__cplusplus)
390 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
391 # define YYSIZE_T size_t
394 #if ! defined (YYSIZE_T)
395 # define YYSIZE_T unsigned int
398 #define yyerrok (yyerrstatus = 0)
399 #define yyclearin (yychar = YYEMPTY)
403 #define YYACCEPT goto yyacceptlab
404 #define YYABORT goto yyabortlab
405 #define YYERROR goto yyerrlab1
407 /* Like YYERROR except do call yyerror. This remains here temporarily
408 to ease the transition to the new meaning of YYERROR, for GCC.
409 Once GCC version 2 has supplanted version 1, this can go. */
411 #define YYFAIL goto yyerrlab
413 #define YYRECOVERING() (!!yyerrstatus)
415 #define YYBACKUP(Token, Value) \
417 if (yychar == YYEMPTY && yylen == 1) \
421 yychar1 = YYTRANSLATE (yychar); \
427 yyerror ("syntax error: cannot back up"); \
433 #define YYERRCODE 256
435 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
438 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
439 first token. By default, to implement support for ranges, extend
440 its range to the last symbol. */
442 #ifndef YYLLOC_DEFAULT
443 # define YYLLOC_DEFAULT(Current, Rhs, N) \
444 Current.last_line = Rhs[[N]].last_line; \
445 Current.last_column = Rhs[[N]].last_column;
448 /* YYLEX -- calling `yylex' with the right arguments. */
453 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
455 # define YYLEX yylex (&yylval, &yylloc)
457 # else /* !YYLSP_NEEDED */
459 # define YYLEX yylex (&yylval, YYLEX_PARAM)
461 # define YYLEX yylex (&yylval)
463 # endif /* !YYLSP_NEEDED */
465 # define YYLEX yylex ()
468 /* Enable debugging if requested. */
472 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
473 # define YYFPRINTF fprintf
476 # define YYDPRINTF(Args) \
481 /* Nonzero means print parse trace. It is left uninitialized so that
482 multiple parsers can coexist. */
485 # define YYDPRINTF(Args)
486 #endif /* !YYDEBUG */
488 /* YYINITDEPTH -- initial size of the parser's stacks. */
490 # define YYINITDEPTH b4_initdepth
493 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
494 if the built-in stack extension method is used).
496 Do not make this value too large; the results are undefined if
497 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
498 evaluated with infinite-precision integer arithmetic. */
505 # define YYMAXDEPTH b4_maxdepth
513 # if defined (__GLIBC__) && defined (_STRING_H)
514 # define yystrlen strlen
516 /* Return the length of YYSTR. */
518 # if defined (__STDC__) || defined (__cplusplus)
519 yystrlen (const char *yystr)
525 register const char *yys = yystr;
527 while (*yys++ != '\0')
530 return yys - yystr - 1;
536 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
537 # define yystpcpy stpcpy
539 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
542 # if defined (__STDC__) || defined (__cplusplus)
543 yystpcpy (char *yydest, const char *yysrc)
545 yystpcpy (yydest, yysrc)
550 register char *yyd = yydest;
551 register const char *yys = yysrc;
553 while ((*yyd++ = *yys++) != '\0')
561 #endif /* !YYERROR_VERBOSE */
565 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
566 into yyparse. The argument should have type void *.
567 It should actually point to an object.
568 Grammar actions can access the variable by casting it
569 to the proper pointer type. */
572 # if defined (__STDC__) || defined (__cplusplus)
573 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
574 # define YYPARSE_PARAM_DECL
576 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
577 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
579 #else /* !YYPARSE_PARAM */
580 # define YYPARSE_PARAM_ARG
581 # define YYPARSE_PARAM_DECL
582 #endif /* !YYPARSE_PARAM */
584 /* Prevent warning if -Wstrict-prototypes. */
586 # ifdef YYPARSE_PARAM
587 int yyparse (void *);
593 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
594 variables are global, or local to YYPARSE. */
596 #define YY_DECL_NON_LSP_VARIABLES \
597 /* The lookahead symbol. */ \
600 /* The semantic value of the lookahead symbol. */ \
603 /* Number of parse errors so far. */ \
607 # define YY_DECL_VARIABLES \
608 YY_DECL_NON_LSP_VARIABLES \
610 /* Location data for the lookahead symbol. */ \
613 # define YY_DECL_VARIABLES \
614 YY_DECL_NON_LSP_VARIABLES
617 /* If nonreentrant, generate the variables here. */
624 yyparse (YYPARSE_PARAM_ARG)
627 /* If reentrant, generate the variables here. */
632 register int yystate;
635 /* Number of tokens to shift before error messages enabled. */
637 /* Lookahead token as an internal (translated) token number. */
640 /* Three stacks and their tools:
641 `yyss': related to states,
642 `yyvs': related to semantic values,
643 `yyls': related to locations.
645 Refer to the stacks thru separate pointers, to allow yyoverflow
646 to reallocate them elsewhere. */
648 /* The state stack. */
649 short yyssa[YYINITDEPTH];
651 register short *yyssp;
653 /* The semantic value stack. */
654 YYSTYPE yyvsa[YYINITDEPTH];
655 YYSTYPE *yyvs = yyvsa;
656 register YYSTYPE *yyvsp;
659 /* The location stack. */
660 YYLTYPE yylsa[YYINITDEPTH];
661 YYLTYPE *yyls = yylsa;
666 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
668 # define YYPOPSTACK (yyvsp--, yyssp--)
671 YYSIZE_T yystacksize = YYINITDEPTH;
673 /* The variables used to return semantic value and location from the
680 /* When reducing, the number of symbols on the RHS of the reduced
684 YYDPRINTF ((stderr, "Starting parse\n"));
689 yychar = YYEMPTY; /* Cause a token to be read. */
691 /* Initialize stack pointers.
692 Waste one element of value and location stack
693 so that they stay on the same level as the state stack.
694 The wasted elements are never initialized. */
703 /*------------------------------------------------------------.
704 | yynewstate -- Push a new state, which is found in yystate. |
705 `------------------------------------------------------------*/
707 /* In all cases, when you get here, the value and location stacks
708 have just been pushed. so pushing a state here evens the stacks.
715 if (yyssp >= yyss + yystacksize - 1)
717 /* Get the current used size of the three stacks, in elements. */
718 YYSIZE_T yysize = yyssp - yyss + 1;
722 /* Give user a chance to reallocate the stack. Use copies of
723 these so that the &'s don't force the real ones into
725 YYSTYPE *yyvs1 = yyvs;
728 /* Each stack pointer address is followed by the size of the
729 data in use in that stack, in bytes. */
731 YYLTYPE *yyls1 = yyls;
732 /* This used to be a conditional around just the two extra args,
733 but that might be undefined if yyoverflow is a macro. */
734 yyoverflow ("parser stack overflow",
735 &yyss1, yysize * sizeof (*yyssp),
736 &yyvs1, yysize * sizeof (*yyvsp),
737 &yyls1, yysize * sizeof (*yylsp),
741 yyoverflow ("parser stack overflow",
742 &yyss1, yysize * sizeof (*yyssp),
743 &yyvs1, yysize * sizeof (*yyvsp),
749 #else /* no yyoverflow */
750 # ifndef YYSTACK_RELOCATE
753 /* Extend the stack our own way. */
754 if (yystacksize >= YYMAXDEPTH)
757 if (yystacksize > YYMAXDEPTH)
758 yystacksize = YYMAXDEPTH;
762 union yyalloc *yyptr =
763 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
766 YYSTACK_RELOCATE (yyss);
767 YYSTACK_RELOCATE (yyvs);
769 YYSTACK_RELOCATE (yyls);
771 # undef YYSTACK_RELOCATE
773 YYSTACK_FREE (yyss1);
776 #endif /* no yyoverflow */
778 yyssp = yyss + yysize - 1;
779 yyvsp = yyvs + yysize - 1;
781 yylsp = yyls + yysize - 1;
784 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
785 (unsigned long int) yystacksize));
787 if (yyssp >= yyss + yystacksize - 1)
791 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
800 /* Do appropriate processing given the current state. */
801 /* Read a lookahead token if we need one and don't already have one. */
804 /* First try to decide what to do without reference to lookahead token. */
806 yyn = yypact[yystate];
810 /* Not known => get a lookahead token if don't already have one. */
812 /* yychar is either YYEMPTY or YYEOF
813 or a valid token in external form. */
815 if (yychar == YYEMPTY)
817 YYDPRINTF ((stderr, "Reading a token: "));
821 /* Convert token to internal form (in yychar1) for indexing tables with. */
823 if (yychar <= 0) /* This means end of input. */
826 yychar = YYEOF; /* Don't call YYLEX any more. */
828 YYDPRINTF ((stderr, "Now at end of input.\n"));
832 yychar1 = YYTRANSLATE (yychar);
835 /* We have to keep this `#if YYDEBUG', since we use variables
836 which are defined only if `YYDEBUG' is set. */
839 YYFPRINTF (stderr, "Next token is %d (%s",
840 yychar, yytname[yychar1]);
841 /* Give the individual parser a way to print the precise
842 meaning of a token, for further debugging info. */
844 YYPRINT (stderr, yychar, yylval);
846 YYFPRINTF (stderr, ")\n");
852 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
857 /* yyn is what to do for this token type in this state.
858 Negative => reduce, -yyn is rule number.
859 Positive => shift, yyn is new state.
860 New state is final state => don't bother to shift,
862 0, or most negative number => error. */
877 /* Shift the lookahead token. */
878 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
879 yychar, yytname[yychar1]));
881 /* Discard the token being shifted unless it is eof. */
890 /* Count tokens shifted since error; after three, turn off error
899 /*-----------------------------------------------------------.
900 | yydefault -- do the default action for the current state. |
901 `-----------------------------------------------------------*/
903 yyn = yydefact[yystate];
909 /*-----------------------------.
910 | yyreduce -- Do a reduction. |
911 `-----------------------------*/
913 /* yyn is the number of a rule to reduce with. */
916 /* If YYLEN is nonzero, implement the default value of the action:
919 Otherwise, the following line sets YYVAL to the semantic value of
920 the lookahead token. This behavior is undocumented and Bison
921 users should not rely upon it. Assigning to YYVAL
922 unconditionally makes the parser a bit smaller, and it avoids a
923 GCC warning that YYVAL may be used uninitialized. */
924 yyval = yyvsp[1-yylen];
927 /* Similarly for the default location. Let the user run additional
928 commands if for instance locations are ranges. */
929 yyloc = yylsp[1-yylen];
930 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
934 /* We have to keep this `#if YYDEBUG', since we use variables which
935 are defined only if `YYDEBUG' is set. */
940 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
941 yyn - 1, yyrline[yyn]);
943 /* Print the symbols being reduced, and their result. */
944 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
945 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
946 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
954 /* Line __line__ of __file__. */
955 #line __oline__ "__ofile__"
966 short *yyssp1 = yyss - 1;
967 YYFPRINTF (stderr, "state stack now");
968 while (yyssp1 != yyssp)
969 YYFPRINTF (stderr, " %d", *++yyssp1);
970 YYFPRINTF (stderr, "\n");
979 /* Now `shift' the result of the reduction. Determine what state
980 that goes to, based on the state we popped back to and the rule
981 number reduced by. */
985 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
986 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
987 yystate = yytable[yystate];
989 yystate = yydefgoto[yyn - YYNTOKENS];
994 /*------------------------------------.
995 | yyerrlab -- here on detecting error |
996 `------------------------------------*/
998 /* If not already recovering from an error, report this error. */
1004 yyn = yypact[yystate];
1006 if (yyn > YYFLAG && yyn < YYLAST)
1008 YYSIZE_T yysize = 0;
1013 /* Start YYX at -YYN if negative to avoid negative indexes in
1015 for (yyx = yyn < 0 ? -yyn : 0;
1016 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1017 if (yycheck[yyx + yyn] == yyx)
1018 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1019 yysize += yystrlen ("parse error, unexpected ") + 1;
1020 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1021 yymsg = (char *) YYSTACK_ALLOC (yysize);
1024 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1025 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1030 for (yyx = yyn < 0 ? -yyn : 0;
1031 yyx < (int) (sizeof (yytname) / sizeof (char *));
1033 if (yycheck[yyx + yyn] == yyx)
1035 const char *yyq = ! yycount ? ", expecting " : " or ";
1036 yyp = yystpcpy (yyp, yyq);
1037 yyp = yystpcpy (yyp, yytname[yyx]);
1042 YYSTACK_FREE (yymsg);
1045 yyerror ("parse error; also virtual memory exhausted");
1048 #endif /* YYERROR_VERBOSE */
1049 yyerror ("parse error");
1054 /*----------------------------------------------------.
1055 | yyerrlab1 -- error raised explicitly by an action. |
1056 `----------------------------------------------------*/
1058 if (yyerrstatus == 3)
1060 /* If just tried and failed to reuse lookahead token after an
1061 error, discard it. */
1063 /* Return failure if at end of input. */
1064 if (yychar == YYEOF)
1066 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1067 yychar, yytname[yychar1]));
1071 /* Else will try to reuse lookahead token after shifting the error
1074 yyerrstatus = 3; /* Each real token shifted decrements this. */
1079 /*-------------------------------------------------------------------.
1080 | yyerrdefault -- current state does not do anything special for the |
1082 `-------------------------------------------------------------------*/
1085 /* This is wrong; only states that explicitly want error tokens
1086 should shift them. */
1088 /* If its default is to accept any token, ok. Otherwise pop it. */
1089 yyn = yydefact[yystate];
1095 /*---------------------------------------------------------------.
1096 | yyerrpop -- pop the current state because it cannot handle the |
1098 `---------------------------------------------------------------*/
1111 short *yyssp1 = yyss - 1;
1112 YYFPRINTF (stderr, "Error: state stack now");
1113 while (yyssp1 != yyssp)
1114 YYFPRINTF (stderr, " %d", *++yyssp1);
1115 YYFPRINTF (stderr, "\n");
1123 yyn = yypact[yystate];
1128 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1145 YYDPRINTF ((stderr, "Shifting error token, "));
1156 /*-------------------------------------.
1157 | yyacceptlab -- YYACCEPT comes here. |
1158 `-------------------------------------*/
1163 /*-----------------------------------.
1164 | yyabortlab -- YYABORT comes here. |
1165 `-----------------------------------*/
1170 /*---------------------------------------------.
1171 | yyoverflowab -- parser overflow comes here. |
1172 `---------------------------------------------*/
1174 yyerror ("parser stack overflow");
1181 YYSTACK_FREE (yyss);
1187 m4_if(b4_defines_flag, 0, [],
1188 [#output "b4_output_header_name"
1189 #ifndef b4_header_guard
1190 # define b4_header_guard
1192 b4_token_defines(b4_tokens)
1195 m4_ifdef([b4_stype_line],
1196 [#line b4_stype_line "b4_filename"
1200 # define YYSTYPE yystype
1204 [extern YYSTYPE b4_prefix[]lval;])
1206 m4_if(b4_locations_flag, [0], [],
1208 typedef struct yyltype
1215 # define YYLTYPE yyltype
1219 [extern YYLTYPE b4_prefix[]lloc;])
1221 #endif /* not b4_header_guard */