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 /* Identify Bison output. */
96 #define YYPURE b4_pure
98 /* Using locations. */
99 #define YYLSP_NEEDED b4_locations_flag
101 m4_if(b4_prefix[], [yy], [],
102 [/* If NAME_PREFIX is specified substitute the variables and functions
104 #define yyparse b4_prefix[]parse
105 #define yylex b4_prefix[]lex
106 #define yyerror b4_prefix[]error
107 #define yylval b4_prefix[]lval
108 #define yychar b4_prefix[]char
109 #define yydebug b4_prefix[]debug
110 #define yynerrs b4_prefix[]nerrs
112 # define yylloc b4_prefix[]lloc
116 /* Copy the user declarations. */
119 /* Enabling traces. */
121 # define YYDEBUG b4_debug
124 /* Enabling verbose error messages. */
125 #ifdef YYERROR_VERBOSE
126 # undef YYERROR_VERBOSE
127 # define YYERROR_VERBOSE 1
129 # define YYERROR_VERBOSE b4_error_verbose
133 m4_ifdef([b4_stype_line],
134 [#line b4_stype_line "b4_filename"
136 typedef b4_stype yystype;
137 # define YYSTYPE yystype
141 typedef struct yyltype
148 # define YYLTYPE b4_ltype
151 /* Line __line__ of __file__. */
152 #line __oline__ "__ofile__"
154 /* All symbols defined below should begin with yy or YY, to avoid
155 infringing on user name space. This should be done even for local
156 variables, as they might otherwise be expanded by user macros.
157 There are some unavoidable exceptions within include files to
158 define necessary library symbols; they are noted "INFRINGES ON
159 USER NAME SPACE" below. */
161 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
163 /* The parser invokes alloca or malloc; define the necessary symbols. */
165 # if YYSTACK_USE_ALLOCA
166 # define YYSTACK_ALLOC alloca
168 # ifndef YYSTACK_USE_ALLOCA
169 # if defined (alloca) || defined (_ALLOCA_H)
170 # define YYSTACK_ALLOC alloca
173 # define YYSTACK_ALLOC __builtin_alloca
179 # ifdef YYSTACK_ALLOC
180 /* Pacify GCC's `empty if-body' warning. */
181 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
183 # if defined (__STDC__) || defined (__cplusplus)
184 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
185 # define YYSIZE_T size_t
187 # define YYSTACK_ALLOC malloc
188 # define YYSTACK_FREE free
191 /* A type that is properly aligned for any stack member. */
201 /* The size of the maximum gap between one aligned stack and the next. */
202 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
204 /* The size of an array large to enough to hold all stacks, each with
207 # define YYSTACK_BYTES(N) \
208 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
209 + 2 * YYSTACK_GAP_MAX)
211 # define YYSTACK_BYTES(N) \
212 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
216 /* Copy COUNT objects from FROM to TO. The source and destination do
220 # define YYCOPY(To, From, Count) \
221 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
223 # define YYCOPY(To, From, Count) \
226 register YYSIZE_T yyi; \
227 for (yyi = 0; yyi < (Count); yyi++) \
228 (To)[yyi] = (From)[yyi]; \
234 /* Relocate STACK from its old location to the new one. The
235 local variables YYSIZE and YYSTACKSIZE give the old and new number of
236 elements in the stack, and YYPTR gives the new location of the
237 stack. Advance YYPTR to a properly aligned location for the next
239 # define YYSTACK_RELOCATE(Stack) \
242 YYSIZE_T yynewbytes; \
243 YYCOPY (&yyptr->Stack, Stack, yysize); \
244 Stack = &yyptr->Stack; \
245 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
246 yyptr += yynewbytes / sizeof (*yyptr); \
250 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
253 b4_token_defines(b4_tokens)
255 /* YYFINAL -- State number of the termination state. */
256 #define YYFINAL b4_final
257 #define YYFLAG b4_flag
258 #define YYLAST b4_last
260 /* YYNTOKENS -- Number of terminals. */
261 #define YYNTOKENS b4_ntokens
262 /* YYNNTS -- Number of nonterminals. */
263 #define YYNNTS b4_nnts
264 /* YYNRULES -- Number of rules. */
265 #define YYNRULES b4_nrules
266 /* YYNRULES -- Number of states. */
267 #define YYNSTATES b4_nstates
269 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
270 #define YYUNDEFTOK b4_undef_token_number
271 #define YYMAXUTOK b4_user_token_number_max
273 typedef b4_uint_type(b4_token_number_max) yy_token_number_type;
274 #define YYTRANSLATE(X) \
275 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
277 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
278 static const yy_token_number_type yytranslate[[]] =
284 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
286 static const short yyprhs[[]] =
291 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
292 typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
293 static const yyrhs_t yyrhs[[]] =
298 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
299 static const short yyrline[[]] =
305 #if (YYDEBUG) || YYERROR_VERBOSE
306 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
307 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
308 static const char *const yytname[[]] =
314 /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */
315 static const short yytoknum[[]] =
320 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
321 static const short yyr1[[]] =
326 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
327 static const short yyr2[[]] =
332 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
333 doesn't specify something else to do. Zero means the default is an
335 static const short yydefact[[]] =
340 /* YYPGOTO[[NTERM-NUM]]. */
341 static const short yydefgoto[[]] =
346 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
348 static const short yypact[[]] =
353 /* YYPGOTO[[NTERM-NUM]]. */
354 static const short yypgoto[[]] =
359 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
360 positive, shift that token. If negative, reduce the rule which
361 number is the opposite. If zero, do what YYDEFACT says. */
362 static const short yytable[[]] =
367 static const short yycheck[[]] =
373 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
374 # define YYSIZE_T __SIZE_TYPE__
376 #if ! defined (YYSIZE_T) && defined (size_t)
377 # define YYSIZE_T size_t
379 #if ! defined (YYSIZE_T)
380 # if defined (__STDC__) || defined (__cplusplus)
381 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
382 # define YYSIZE_T size_t
385 #if ! defined (YYSIZE_T)
386 # define YYSIZE_T unsigned int
389 #define yyerrok (yyerrstatus = 0)
390 #define yyclearin (yychar = YYEMPTY)
394 #define YYACCEPT goto yyacceptlab
395 #define YYABORT goto yyabortlab
396 #define YYERROR goto yyerrlab1
398 /* Like YYERROR except do call yyerror. This remains here temporarily
399 to ease the transition to the new meaning of YYERROR, for GCC.
400 Once GCC version 2 has supplanted version 1, this can go. */
402 #define YYFAIL goto yyerrlab
404 #define YYRECOVERING() (!!yyerrstatus)
406 #define YYBACKUP(Token, Value) \
408 if (yychar == YYEMPTY && yylen == 1) \
412 yychar1 = YYTRANSLATE (yychar); \
418 yyerror ("syntax error: cannot back up"); \
424 #define YYERRCODE 256
426 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
429 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
430 first token. By default, to implement support for ranges, extend
431 its range to the last symbol. */
433 #ifndef YYLLOC_DEFAULT
434 # define YYLLOC_DEFAULT(Current, Rhs, N) \
435 Current.last_line = Rhs[[N]].last_line; \
436 Current.last_column = Rhs[[N]].last_column;
439 /* YYLEX -- calling `yylex' with the right arguments. */
444 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
446 # define YYLEX yylex (&yylval, &yylloc)
448 # else /* !YYLSP_NEEDED */
450 # define YYLEX yylex (&yylval, YYLEX_PARAM)
452 # define YYLEX yylex (&yylval)
454 # endif /* !YYLSP_NEEDED */
456 # define YYLEX yylex ()
459 /* Enable debugging if requested. */
463 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
464 # define YYFPRINTF fprintf
467 # define YYDPRINTF(Args) \
472 /* Nonzero means print parse trace. Since this is uninitialized, it
473 does not stop multiple parsers from coexisting. */
476 # define YYDPRINTF(Args)
477 #endif /* !YYDEBUG */
479 /* YYINITDEPTH -- initial size of the parser's stacks. */
481 # define YYINITDEPTH b4_initdepth
484 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
485 if the built-in stack extension method is used).
487 Do not make this value too large; the results are undefined if
488 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
489 evaluated with infinite-precision integer arithmetic. */
496 # define YYMAXDEPTH b4_maxdepth
504 # if defined (__GLIBC__) && defined (_STRING_H)
505 # define yystrlen strlen
507 /* Return the length of YYSTR. */
509 # if defined (__STDC__) || defined (__cplusplus)
510 yystrlen (const char *yystr)
516 register const char *yys = yystr;
518 while (*yys++ != '\0')
521 return yys - yystr - 1;
527 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
528 # define yystpcpy stpcpy
530 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
533 # if defined (__STDC__) || defined (__cplusplus)
534 yystpcpy (char *yydest, const char *yysrc)
536 yystpcpy (yydest, yysrc)
541 register char *yyd = yydest;
542 register const char *yys = yysrc;
544 while ((*yyd++ = *yys++) != '\0')
552 #endif /* !YYERROR_VERBOSE */
556 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
557 into yyparse. The argument should have type void *.
558 It should actually point to an object.
559 Grammar actions can access the variable by casting it
560 to the proper pointer type. */
563 # if defined (__STDC__) || defined (__cplusplus)
564 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
565 # define YYPARSE_PARAM_DECL
567 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
568 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
570 #else /* !YYPARSE_PARAM */
571 # define YYPARSE_PARAM_ARG
572 # define YYPARSE_PARAM_DECL
573 #endif /* !YYPARSE_PARAM */
575 /* Prevent warning if -Wstrict-prototypes. */
577 # ifdef YYPARSE_PARAM
578 int yyparse (void *);
584 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
585 variables are global, or local to YYPARSE. */
587 #define YY_DECL_NON_LSP_VARIABLES \
588 /* The lookahead symbol. */ \
591 /* The semantic value of the lookahead symbol. */ \
594 /* Number of parse errors so far. */ \
598 # define YY_DECL_VARIABLES \
599 YY_DECL_NON_LSP_VARIABLES \
601 /* Location data for the lookahead symbol. */ \
604 # define YY_DECL_VARIABLES \
605 YY_DECL_NON_LSP_VARIABLES
608 /* If nonreentrant, generate the variables here. */
615 yyparse (YYPARSE_PARAM_ARG)
618 /* If reentrant, generate the variables here. */
623 register int yystate;
626 /* Number of tokens to shift before error messages enabled. */
628 /* Lookahead token as an internal (translated) token number. */
631 /* Three stacks and their tools:
632 `yyss': related to states,
633 `yyvs': related to semantic values,
634 `yyls': related to locations.
636 Refer to the stacks thru separate pointers, to allow yyoverflow
637 to reallocate them elsewhere. */
639 /* The state stack. */
640 short yyssa[YYINITDEPTH];
642 register short *yyssp;
644 /* The semantic value stack. */
645 YYSTYPE yyvsa[YYINITDEPTH];
646 YYSTYPE *yyvs = yyvsa;
647 register YYSTYPE *yyvsp;
650 /* The location stack. */
651 YYLTYPE yylsa[YYINITDEPTH];
652 YYLTYPE *yyls = yylsa;
657 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
659 # define YYPOPSTACK (yyvsp--, yyssp--)
662 YYSIZE_T yystacksize = YYINITDEPTH;
664 /* The variables used to return semantic value and location from the
671 /* When reducing, the number of symbols on the RHS of the reduced
675 YYDPRINTF ((stderr, "Starting parse\n"));
680 yychar = YYEMPTY; /* Cause a token to be read. */
682 /* Initialize stack pointers.
683 Waste one element of value and location stack
684 so that they stay on the same level as the state stack.
685 The wasted elements are never initialized. */
694 /*------------------------------------------------------------.
695 | yynewstate -- Push a new state, which is found in yystate. |
696 `------------------------------------------------------------*/
698 /* In all cases, when you get here, the value and location stacks
699 have just been pushed. so pushing a state here evens the stacks.
706 if (yyssp >= yyss + yystacksize - 1)
708 /* Get the current used size of the three stacks, in elements. */
709 YYSIZE_T yysize = yyssp - yyss + 1;
713 /* Give user a chance to reallocate the stack. Use copies of
714 these so that the &'s don't force the real ones into
716 YYSTYPE *yyvs1 = yyvs;
719 /* Each stack pointer address is followed by the size of the
720 data in use in that stack, in bytes. */
722 YYLTYPE *yyls1 = yyls;
723 /* This used to be a conditional around just the two extra args,
724 but that might be undefined if yyoverflow is a macro. */
725 yyoverflow ("parser stack overflow",
726 &yyss1, yysize * sizeof (*yyssp),
727 &yyvs1, yysize * sizeof (*yyvsp),
728 &yyls1, yysize * sizeof (*yylsp),
732 yyoverflow ("parser stack overflow",
733 &yyss1, yysize * sizeof (*yyssp),
734 &yyvs1, yysize * sizeof (*yyvsp),
740 #else /* no yyoverflow */
741 /* Extend the stack our own way. */
742 if (yystacksize >= YYMAXDEPTH)
745 if (yystacksize > YYMAXDEPTH)
746 yystacksize = YYMAXDEPTH;
750 union yyalloc *yyptr =
751 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
754 YYSTACK_RELOCATE (yyss);
755 YYSTACK_RELOCATE (yyvs);
757 YYSTACK_RELOCATE (yyls);
759 # undef YYSTACK_RELOCATE
761 YYSTACK_FREE (yyss1);
763 #endif /* no yyoverflow */
765 yyssp = yyss + yysize - 1;
766 yyvsp = yyvs + yysize - 1;
768 yylsp = yyls + yysize - 1;
771 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
772 (unsigned long int) yystacksize));
774 if (yyssp >= yyss + yystacksize - 1)
778 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
787 /* Do appropriate processing given the current state. */
788 /* Read a lookahead token if we need one and don't already have one. */
791 /* First try to decide what to do without reference to lookahead token. */
793 yyn = yypact[yystate];
797 /* Not known => get a lookahead token if don't already have one. */
799 /* yychar is either YYEMPTY or YYEOF
800 or a valid token in external form. */
802 if (yychar == YYEMPTY)
804 YYDPRINTF ((stderr, "Reading a token: "));
808 /* Convert token to internal form (in yychar1) for indexing tables with. */
810 if (yychar <= 0) /* This means end of input. */
813 yychar = YYEOF; /* Don't call YYLEX any more. */
815 YYDPRINTF ((stderr, "Now at end of input.\n"));
819 yychar1 = YYTRANSLATE (yychar);
822 /* We have to keep this `#if YYDEBUG', since we use variables
823 which are defined only if `YYDEBUG' is set. */
826 YYFPRINTF (stderr, "Next token is %d (%s",
827 yychar, yytname[yychar1]);
828 /* Give the individual parser a way to print the precise
829 meaning of a token, for further debugging info. */
831 YYPRINT (stderr, yychar, yylval);
833 YYFPRINTF (stderr, ")\n");
839 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
844 /* yyn is what to do for this token type in this state.
845 Negative => reduce, -yyn is rule number.
846 Positive => shift, yyn is new state.
847 New state is final state => don't bother to shift,
849 0, or most negative number => error. */
864 /* Shift the lookahead token. */
865 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
866 yychar, yytname[yychar1]));
868 /* Discard the token being shifted unless it is eof. */
877 /* Count tokens shifted since error; after three, turn off error
886 /*-----------------------------------------------------------.
887 | yydefault -- do the default action for the current state. |
888 `-----------------------------------------------------------*/
890 yyn = yydefact[yystate];
896 /*-----------------------------.
897 | yyreduce -- Do a reduction. |
898 `-----------------------------*/
900 /* yyn is the number of a rule to reduce with. */
903 /* If YYLEN is nonzero, implement the default value of the action:
906 Otherwise, the following line sets YYVAL to the semantic value of
907 the lookahead token. This behavior is undocumented and Bison
908 users should not rely upon it. Assigning to YYVAL
909 unconditionally makes the parser a bit smaller, and it avoids a
910 GCC warning that YYVAL may be used uninitialized. */
911 yyval = yyvsp[1-yylen];
914 /* Similarly for the default location. Let the user run additional
915 commands if for instance locations are ranges. */
916 yyloc = yylsp[1-yylen];
917 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
921 /* We have to keep this `#if YYDEBUG', since we use variables which
922 are defined only if `YYDEBUG' is set. */
927 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
928 yyn - 1, yyrline[yyn]);
930 /* Print the symbols being reduced, and their result. */
931 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
932 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
933 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
941 /* Line __line__ of __file__. */
942 #line __oline__ "__ofile__"
953 short *yyssp1 = yyss - 1;
954 YYFPRINTF (stderr, "state stack now");
955 while (yyssp1 != yyssp)
956 YYFPRINTF (stderr, " %d", *++yyssp1);
957 YYFPRINTF (stderr, "\n");
966 /* Now `shift' the result of the reduction. Determine what state
967 that goes to, based on the state we popped back to and the rule
968 number reduced by. */
972 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
973 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
974 yystate = yytable[yystate];
976 yystate = yydefgoto[yyn - YYNTOKENS];
981 /*------------------------------------.
982 | yyerrlab -- here on detecting error |
983 `------------------------------------*/
985 /* If not already recovering from an error, report this error. */
991 yyn = yypact[yystate];
993 if (yyn > YYFLAG && yyn < YYLAST)
1000 /* Start YYX at -YYN if negative to avoid negative indexes in
1002 for (yyx = yyn < 0 ? -yyn : 0;
1003 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1004 if (yycheck[yyx + yyn] == yyx)
1005 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1006 yysize += yystrlen ("parse error, unexpected ") + 1;
1007 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1008 yymsg = (char *) YYSTACK_ALLOC (yysize);
1011 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1012 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1017 for (yyx = yyn < 0 ? -yyn : 0;
1018 yyx < (int) (sizeof (yytname) / sizeof (char *));
1020 if (yycheck[yyx + yyn] == yyx)
1022 const char *yyq = ! yycount ? ", expecting " : " or ";
1023 yyp = yystpcpy (yyp, yyq);
1024 yyp = yystpcpy (yyp, yytname[yyx]);
1029 YYSTACK_FREE (yymsg);
1032 yyerror ("parse error; also virtual memory exhausted");
1035 #endif /* YYERROR_VERBOSE */
1036 yyerror ("parse error");
1041 /*----------------------------------------------------.
1042 | yyerrlab1 -- error raised explicitly by an action. |
1043 `----------------------------------------------------*/
1045 if (yyerrstatus == 3)
1047 /* If just tried and failed to reuse lookahead token after an
1048 error, discard it. */
1050 /* Return failure if at end of input. */
1051 if (yychar == YYEOF)
1053 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1054 yychar, yytname[yychar1]));
1058 /* Else will try to reuse lookahead token after shifting the error
1061 yyerrstatus = 3; /* Each real token shifted decrements this. */
1066 /*-------------------------------------------------------------------.
1067 | yyerrdefault -- current state does not do anything special for the |
1069 `-------------------------------------------------------------------*/
1072 /* This is wrong; only states that explicitly want error tokens
1073 should shift them. */
1075 /* If its default is to accept any token, ok. Otherwise pop it. */
1076 yyn = yydefact[yystate];
1082 /*---------------------------------------------------------------.
1083 | yyerrpop -- pop the current state because it cannot handle the |
1085 `---------------------------------------------------------------*/
1098 short *yyssp1 = yyss - 1;
1099 YYFPRINTF (stderr, "Error: state stack now");
1100 while (yyssp1 != yyssp)
1101 YYFPRINTF (stderr, " %d", *++yyssp1);
1102 YYFPRINTF (stderr, "\n");
1110 yyn = yypact[yystate];
1115 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1132 YYDPRINTF ((stderr, "Shifting error token, "));
1143 /*-------------------------------------.
1144 | yyacceptlab -- YYACCEPT comes here. |
1145 `-------------------------------------*/
1150 /*-----------------------------------.
1151 | yyabortlab -- YYABORT comes here. |
1152 `-----------------------------------*/
1157 /*---------------------------------------------.
1158 | yyoverflowab -- parser overflow comes here. |
1159 `---------------------------------------------*/
1161 yyerror ("parser stack overflow");
1168 YYSTACK_FREE (yyss);
1174 m4_if(b4_defines_flag, 0, [],
1175 [#output "b4_output_header_name"
1176 #ifndef b4_header_guard
1177 # define b4_header_guard
1179 b4_token_defines(b4_tokens)
1182 m4_ifdef([b4_stype_line],
1183 [#line b4_stype_line "b4_filename"
1187 # define YYSTYPE yystype
1191 [extern YYSTYPE b4_prefix[]lval;])
1193 m4_if(b4_locations_flag, [0], [],
1195 typedef struct yyltype
1202 # define YYLTYPE yyltype
1206 [extern YYLTYPE b4_prefix[]lloc;])
1208 #endif /* not b4_header_guard */