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 # b4_lhs_value([TYPE])
24 # --------------------
25 # Expansion of $<TYPE>$.
26 m4_define([b4_lhs_value],
27 [yyval[]m4_ifval([$1], [.$1])])
30 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
31 # --------------------------------------
32 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
34 m4_define([b4_rhs_value],
35 [yyvsp@<:@m4_eval([$2 - $1])@:>@m4_ifval([$3], [.$3])])
41 m4_define([b4_lhs_location],
45 # b4_rhs_location(RULE-LENGTH, NUM)
46 # ---------------------------------
47 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
49 m4_define([b4_rhs_location],
50 [yylsp@<:@m4_eval([$2 - $1])@:>@])
53 m4_define_default([b4_input_suffix], [.y])
55 m4_define_default([b4_output_parser_suffix],
56 [m4_translit(b4_input_suffix, [yY], [cC])])
58 m4_define_default([b4_output_parser_name],
59 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])
62 m4_define_default([b4_output_header_suffix],
63 [m4_translit(b4_input_suffix, [yY], [hH])])
65 m4_define_default([b4_output_header_name],
66 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])
68 m4_define_default([b4_header_guard],
69 [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
70 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
73 # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
74 # -----------------------------------------
75 # Output the definition of this token as #define.
76 m4_define([b4_token_define],
81 # b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
82 # ---------------------------------------
83 # Output the definition of this token as an enum.
84 m4_define([b4_token_enum],
88 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
89 # -------------------------------------------------------
90 # Output the definition of the tokens (if there are) as enums and #define.
91 m4_define([b4_token_defines],
92 [m4_if([$@], [[]], [],
95 # if defined (__STDC__) || defined (__cplusplus)
96 /* Put the tokens into the symbol table, so that GDB and other debuggers
99 m4_map_sep([ b4_token_enum], [,
104 /* POSIX requires `int' for tokens in interfaces. */
105 # define YYTOKENTYPE int
106 #endif /* !YYTOKENTYPE */
107 m4_map([b4_token_define], [$@])
113 #output "b4_output_parser_name"
114 /* A Bison parser, made from b4_filename
115 by GNU bison b4_version. */
117 /* Skeleton output parser for Bison,
118 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
121 This program is free software; you can redistribute it and/or modify
122 it under the terms of the GNU General Public License as published by
123 the Free Software Foundation; either version 2, or (at your option)
126 This program is distributed in the hope that it will be useful,
127 but WITHOUT ANY WARRANTY; without even the implied warranty of
128 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
129 GNU General Public License for more details.
131 You should have received a copy of the GNU General Public License
132 along with this program; if not, write to the Free Software
133 Foundation, Inc., 59 Temple Place - Suite 330,
134 Boston, MA 02111-1307, USA. */
136 /* As a special exception, when this file is copied by Bison into a
137 Bison output file, you may use that output file without restriction.
138 This special exception was added by the Free Software Foundation
139 in version 1.24 of Bison. */
141 /* This is the parser code that is written into each bison parser when
142 the %semantic_parser declaration is not specified in the grammar.
143 It was written by Richard Stallman by simplifying the original so
144 called ``semantic'' parser. */
146 /* All symbols defined below should begin with yy or YY, to avoid
147 infringing on user name space. This should be done even for local
148 variables, as they might otherwise be expanded by user macros.
149 There are some unavoidable exceptions within include files to
150 define necessary library symbols; they are noted "INFRINGES ON
151 USER NAME SPACE" below. */
153 /* Identify Bison output. */
157 #define YYPURE b4_pure
159 /* Using locations. */
160 #define YYLSP_NEEDED b4_locations_flag
162 m4_if(b4_prefix[], [yy], [],
163 [/* If NAME_PREFIX is specified substitute the variables and functions
165 #define yyparse b4_prefix[]parse
166 #define yylex b4_prefix[]lex
167 #define yyerror b4_prefix[]error
168 #define yylval b4_prefix[]lval
169 #define yychar b4_prefix[]char
170 #define yydebug b4_prefix[]debug
171 #define yynerrs b4_prefix[]nerrs
173 # define yylloc b4_prefix[]lloc
177 /* Copy the first part of user declarations. */
180 /* Enabling traces. */
182 # define YYDEBUG b4_debug
185 /* Enabling verbose error messages. */
186 #ifdef YYERROR_VERBOSE
187 # undef YYERROR_VERBOSE
188 # define YYERROR_VERBOSE 1
190 # define YYERROR_VERBOSE b4_error_verbose
194 m4_ifdef([b4_stype_line],
195 [#line b4_stype_line "b4_filename"
197 typedef b4_stype yystype;
198 # define YYSTYPE yystype
199 # define YYSTYPE_IS_TRIVIAL 1
203 typedef struct yyltype
210 # define YYLTYPE b4_ltype
211 # define YYLTYPE_IS_TRIVIAL 1
214 /* Copy the second part of user declarations. */
217 /* Line __line__ of __file__. */
218 #line __oline__ "__ofile__"
220 #if ! defined (yyoverflow) || YYERROR_VERBOSE
222 /* The parser invokes alloca or malloc; define the necessary symbols. */
224 # if YYSTACK_USE_ALLOCA
225 # define YYSTACK_ALLOC alloca
227 # ifndef YYSTACK_USE_ALLOCA
228 # if defined (alloca) || defined (_ALLOCA_H)
229 # define YYSTACK_ALLOC alloca
232 # define YYSTACK_ALLOC __builtin_alloca
238 # ifdef YYSTACK_ALLOC
239 /* Pacify GCC's `empty if-body' warning. */
240 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
242 # if defined (__STDC__) || defined (__cplusplus)
243 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
244 # define YYSIZE_T size_t
246 # define YYSTACK_ALLOC malloc
247 # define YYSTACK_FREE free
249 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
252 #if (! defined (yyoverflow) \
253 && (! defined (__cplusplus) \
254 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
256 /* A type that is properly aligned for any stack member. */
266 /* The size of the maximum gap between one aligned stack and the next. */
267 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
269 /* The size of an array large to enough to hold all stacks, each with
272 # define YYSTACK_BYTES(N) \
273 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
274 + 2 * YYSTACK_GAP_MAX)
276 # define YYSTACK_BYTES(N) \
277 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
281 /* Copy COUNT objects from FROM to TO. The source and destination do
285 # define YYCOPY(To, From, Count) \
286 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
288 # define YYCOPY(To, From, Count) \
291 register YYSIZE_T yyi; \
292 for (yyi = 0; yyi < (Count); yyi++) \
293 (To)[[yyi]] = (From)[[yyi]]; \
299 /* Relocate STACK from its old location to the new one. The
300 local variables YYSIZE and YYSTACKSIZE give the old and new number of
301 elements in the stack, and YYPTR gives the new location of the
302 stack. Advance YYPTR to a properly aligned location for the next
304 # define YYSTACK_RELOCATE(Stack) \
307 YYSIZE_T yynewbytes; \
308 YYCOPY (&yyptr->Stack, Stack, yysize); \
309 Stack = &yyptr->Stack; \
310 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
311 yyptr += yynewbytes / sizeof (*yyptr); \
317 b4_token_defines(b4_tokens)
319 /* YYFINAL -- State number of the termination state. */
320 #define YYFINAL b4_final
321 #define YYFLAG b4_flag
322 #define YYLAST b4_last
324 /* YYNTOKENS -- Number of terminals. */
325 #define YYNTOKENS b4_ntokens
326 /* YYNNTS -- Number of nonterminals. */
327 #define YYNNTS b4_nnts
328 /* YYNRULES -- Number of rules. */
329 #define YYNRULES b4_nrules
330 /* YYNRULES -- Number of states. */
331 #define YYNSTATES b4_nstates
333 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
334 #define YYUNDEFTOK b4_undef_token_number
335 #define YYMAXUTOK b4_user_token_number_max
337 typedef b4_uint_type(b4_translate_max) yy_token_number_type;
338 #define YYTRANSLATE(X) \
339 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
341 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
342 static const yy_token_number_type yytranslate[[]] =
348 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
350 static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
355 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
356 static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
361 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
362 static const b4_uint_type(b4_rline_max) yyrline[[]] =
368 #if (YYDEBUG) || YYERROR_VERBOSE
369 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
370 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
371 static const char *const yytname[[]] =
377 /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */
378 static const short yytoknum[[]] =
383 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
384 static const yy_token_number_type yyr1[[]] =
389 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
390 static const b4_uint_type(b4_r2_max) yyr2[[]] =
395 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
396 doesn't specify something else to do. Zero means the default is an
398 static const short yydefact[[]] =
403 /* YYPGOTO[[NTERM-NUM]]. */
404 static const short yydefgoto[[]] =
409 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
411 static const short yypact[[]] =
416 /* YYPGOTO[[NTERM-NUM]]. */
417 static const short yypgoto[[]] =
422 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
423 positive, shift that token. If negative, reduce the rule which
424 number is the opposite. If zero, do what YYDEFACT says. */
425 static const short yytable[[]] =
430 static const short yycheck[[]] =
436 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
437 # define YYSIZE_T __SIZE_TYPE__
439 #if ! defined (YYSIZE_T) && defined (size_t)
440 # define YYSIZE_T size_t
442 #if ! defined (YYSIZE_T)
443 # if defined (__STDC__) || defined (__cplusplus)
444 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
445 # define YYSIZE_T size_t
448 #if ! defined (YYSIZE_T)
449 # define YYSIZE_T unsigned int
452 #define yyerrok (yyerrstatus = 0)
453 #define yyclearin (yychar = YYEMPTY)
457 #define YYACCEPT goto yyacceptlab
458 #define YYABORT goto yyabortlab
459 #define YYERROR goto yyerrlab1
461 /* Like YYERROR except do call yyerror. This remains here temporarily
462 to ease the transition to the new meaning of YYERROR, for GCC.
463 Once GCC version 2 has supplanted version 1, this can go. */
465 #define YYFAIL goto yyerrlab
467 #define YYRECOVERING() (!!yyerrstatus)
469 #define YYBACKUP(Token, Value) \
471 if (yychar == YYEMPTY && yylen == 1) \
475 yychar1 = YYTRANSLATE (yychar); \
481 yyerror ("syntax error: cannot back up"); \
487 #define YYERRCODE 256
489 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
492 #ifndef YYLLOC_DEFAULT
493 # define YYLLOC_DEFAULT(Current, Rhs, N) \
494 Current.first_line = Rhs[[1]].first_line; \
495 Current.first_column = Rhs[[1]].first_column; \
496 Current.last_line = Rhs[[N]].last_line; \
497 Current.last_column = Rhs[[N]].last_column;
500 /* YYLEX -- calling `yylex' with the right arguments. */
505 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
507 # define YYLEX yylex (&yylval, &yylloc)
509 # else /* !YYLSP_NEEDED */
511 # define YYLEX yylex (&yylval, YYLEX_PARAM)
513 # define YYLEX yylex (&yylval)
515 # endif /* !YYLSP_NEEDED */
517 # define YYLEX yylex ()
520 /* Enable debugging if requested. */
524 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
525 # define YYFPRINTF fprintf
528 # define YYDPRINTF(Args) \
533 /* Nonzero means print parse trace. It is left uninitialized so that
534 multiple parsers can coexist. */
537 # define YYDPRINTF(Args)
538 #endif /* !YYDEBUG */
540 /* YYINITDEPTH -- initial size of the parser's stacks. */
542 # define YYINITDEPTH b4_initdepth
545 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
546 if the built-in stack extension method is used).
548 Do not make this value too large; the results are undefined if
549 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
550 evaluated with infinite-precision integer arithmetic. */
557 # define YYMAXDEPTH b4_maxdepth
565 # if defined (__GLIBC__) && defined (_STRING_H)
566 # define yystrlen strlen
568 /* Return the length of YYSTR. */
570 # if defined (__STDC__) || defined (__cplusplus)
571 yystrlen (const char *yystr)
577 register const char *yys = yystr;
579 while (*yys++ != '\0')
582 return yys - yystr - 1;
588 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
589 # define yystpcpy stpcpy
591 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
594 # if defined (__STDC__) || defined (__cplusplus)
595 yystpcpy (char *yydest, const char *yysrc)
597 yystpcpy (yydest, yysrc)
602 register char *yyd = yydest;
603 register const char *yys = yysrc;
605 while ((*yyd++ = *yys++) != '\0')
613 #endif /* !YYERROR_VERBOSE */
617 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
618 into yyparse. The argument should have type void *.
619 It should actually point to an object.
620 Grammar actions can access the variable by casting it
621 to the proper pointer type. */
624 # if defined (__STDC__) || defined (__cplusplus)
625 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
626 # define YYPARSE_PARAM_DECL
628 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
629 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
631 #else /* !YYPARSE_PARAM */
632 # define YYPARSE_PARAM_ARG
633 # define YYPARSE_PARAM_DECL
634 #endif /* !YYPARSE_PARAM */
636 /* Prevent warning if -Wstrict-prototypes. */
638 # ifdef YYPARSE_PARAM
639 int yyparse (void *);
645 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
646 variables are global, or local to YYPARSE. */
648 #define YY_DECL_NON_LSP_VARIABLES \
649 /* The lookahead symbol. */ \
652 /* The semantic value of the lookahead symbol. */ \
655 /* Number of parse errors so far. */ \
659 # define YY_DECL_VARIABLES \
660 YY_DECL_NON_LSP_VARIABLES \
662 /* Location data for the lookahead symbol. */ \
665 # define YY_DECL_VARIABLES \
666 YY_DECL_NON_LSP_VARIABLES
669 /* If nonreentrant, generate the variables here. */
676 yyparse (YYPARSE_PARAM_ARG)
679 /* If reentrant, generate the variables here. */
684 register int yystate;
687 /* Number of tokens to shift before error messages enabled. */
689 /* Lookahead token as an internal (translated) token number. */
692 /* Three stacks and their tools:
693 `yyss': related to states,
694 `yyvs': related to semantic values,
695 `yyls': related to locations.
697 Refer to the stacks thru separate pointers, to allow yyoverflow
698 to reallocate them elsewhere. */
700 /* The state stack. */
701 short yyssa[YYINITDEPTH];
703 register short *yyssp;
705 /* The semantic value stack. */
706 YYSTYPE yyvsa[YYINITDEPTH];
707 YYSTYPE *yyvs = yyvsa;
708 register YYSTYPE *yyvsp;
711 /* The location stack. */
712 YYLTYPE yylsa[YYINITDEPTH];
713 YYLTYPE *yyls = yylsa;
718 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
720 # define YYPOPSTACK (yyvsp--, yyssp--)
723 YYSIZE_T yystacksize = YYINITDEPTH;
725 /* The variables used to return semantic value and location from the
732 /* When reducing, the number of symbols on the RHS of the reduced
736 YYDPRINTF ((stderr, "Starting parse\n"));
741 yychar = YYEMPTY; /* Cause a token to be read. */
743 /* Initialize stack pointers.
744 Waste one element of value and location stack
745 so that they stay on the same level as the state stack.
746 The wasted elements are never initialized. */
755 /*------------------------------------------------------------.
756 | yynewstate -- Push a new state, which is found in yystate. |
757 `------------------------------------------------------------*/
759 /* In all cases, when you get here, the value and location stacks
760 have just been pushed. so pushing a state here evens the stacks.
767 if (yyssp >= yyss + yystacksize - 1)
769 /* Get the current used size of the three stacks, in elements. */
770 YYSIZE_T yysize = yyssp - yyss + 1;
774 /* Give user a chance to reallocate the stack. Use copies of
775 these so that the &'s don't force the real ones into
777 YYSTYPE *yyvs1 = yyvs;
780 /* Each stack pointer address is followed by the size of the
781 data in use in that stack, in bytes. */
783 YYLTYPE *yyls1 = yyls;
784 /* This used to be a conditional around just the two extra args,
785 but that might be undefined if yyoverflow is a macro. */
786 yyoverflow ("parser stack overflow",
787 &yyss1, yysize * sizeof (*yyssp),
788 &yyvs1, yysize * sizeof (*yyvsp),
789 &yyls1, yysize * sizeof (*yylsp),
793 yyoverflow ("parser stack overflow",
794 &yyss1, yysize * sizeof (*yyssp),
795 &yyvs1, yysize * sizeof (*yyvsp),
801 #else /* no yyoverflow */
802 # ifndef YYSTACK_RELOCATE
805 /* Extend the stack our own way. */
806 if (yystacksize >= YYMAXDEPTH)
809 if (yystacksize > YYMAXDEPTH)
810 yystacksize = YYMAXDEPTH;
814 union yyalloc *yyptr =
815 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
818 YYSTACK_RELOCATE (yyss);
819 YYSTACK_RELOCATE (yyvs);
821 YYSTACK_RELOCATE (yyls);
823 # undef YYSTACK_RELOCATE
825 YYSTACK_FREE (yyss1);
828 #endif /* no yyoverflow */
830 yyssp = yyss + yysize - 1;
831 yyvsp = yyvs + yysize - 1;
833 yylsp = yyls + yysize - 1;
836 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
837 (unsigned long int) yystacksize));
839 if (yyssp >= yyss + yystacksize - 1)
843 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
852 /* Do appropriate processing given the current state. */
853 /* Read a lookahead token if we need one and don't already have one. */
856 /* First try to decide what to do without reference to lookahead token. */
858 yyn = yypact[yystate];
862 /* Not known => get a lookahead token if don't already have one. */
864 /* yychar is either YYEMPTY or YYEOF
865 or a valid token in external form. */
867 if (yychar == YYEMPTY)
869 YYDPRINTF ((stderr, "Reading a token: "));
873 /* Convert token to internal form (in yychar1) for indexing tables with. */
875 if (yychar <= 0) /* This means end of input. */
878 yychar = YYEOF; /* Don't call YYLEX any more. */
880 YYDPRINTF ((stderr, "Now at end of input.\n"));
884 yychar1 = YYTRANSLATE (yychar);
887 /* We have to keep this `#if YYDEBUG', since we use variables
888 which are defined only if `YYDEBUG' is set. */
891 YYFPRINTF (stderr, "Next token is %d (%s",
892 yychar, yytname[yychar1]);
893 /* Give the individual parser a way to print the precise
894 meaning of a token, for further debugging info. */
896 YYPRINT (stderr, yychar, yylval);
898 YYFPRINTF (stderr, ")\n");
904 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
909 /* yyn is what to do for this token type in this state.
910 Negative => reduce, -yyn is rule number.
911 Positive => shift, yyn is new state.
912 New state is final state => don't bother to shift,
914 0, or most negative number => error. */
929 /* Shift the lookahead token. */
930 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
931 yychar, yytname[yychar1]));
933 /* Discard the token being shifted unless it is eof. */
942 /* Count tokens shifted since error; after three, turn off error
951 /*-----------------------------------------------------------.
952 | yydefault -- do the default action for the current state. |
953 `-----------------------------------------------------------*/
955 yyn = yydefact[yystate];
961 /*-----------------------------.
962 | yyreduce -- Do a reduction. |
963 `-----------------------------*/
965 /* yyn is the number of a rule to reduce with. */
968 /* If YYLEN is nonzero, implement the default value of the action:
971 Otherwise, the following line sets YYVAL to the semantic value of
972 the lookahead token. This behavior is undocumented and Bison
973 users should not rely upon it. Assigning to YYVAL
974 unconditionally makes the parser a bit smaller, and it avoids a
975 GCC warning that YYVAL may be used uninitialized. */
976 yyval = yyvsp[1-yylen];
979 /* Default location. */
980 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
984 /* We have to keep this `#if YYDEBUG', since we use variables which
985 are defined only if `YYDEBUG' is set. */
990 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
991 yyn - 1, yyrline[yyn]);
993 /* Print the symbols being reduced, and their result. */
994 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
995 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
996 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1004 /* Line __line__ of __file__. */
1005 #line __oline__ "__ofile__"
1016 short *yyssp1 = yyss - 1;
1017 YYFPRINTF (stderr, "state stack now");
1018 while (yyssp1 != yyssp)
1019 YYFPRINTF (stderr, " %d", *++yyssp1);
1020 YYFPRINTF (stderr, "\n");
1029 /* Now `shift' the result of the reduction. Determine what state
1030 that goes to, based on the state we popped back to and the rule
1031 number reduced by. */
1035 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1036 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1037 yystate = yytable[yystate];
1039 yystate = yydefgoto[yyn - YYNTOKENS];
1044 /*------------------------------------.
1045 | yyerrlab -- here on detecting error |
1046 `------------------------------------*/
1048 /* If not already recovering from an error, report this error. */
1054 yyn = yypact[yystate];
1056 if (yyn > YYFLAG && yyn < YYLAST)
1058 YYSIZE_T yysize = 0;
1063 /* Start YYX at -YYN if negative to avoid negative indexes in
1065 for (yyx = yyn < 0 ? -yyn : 0;
1066 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1067 if (yycheck[yyx + yyn] == yyx)
1068 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1069 yysize += yystrlen ("parse error, unexpected ") + 1;
1070 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1071 yymsg = (char *) YYSTACK_ALLOC (yysize);
1074 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1075 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1080 for (yyx = yyn < 0 ? -yyn : 0;
1081 yyx < (int) (sizeof (yytname) / sizeof (char *));
1083 if (yycheck[yyx + yyn] == yyx)
1085 const char *yyq = ! yycount ? ", expecting " : " or ";
1086 yyp = yystpcpy (yyp, yyq);
1087 yyp = yystpcpy (yyp, yytname[yyx]);
1092 YYSTACK_FREE (yymsg);
1095 yyerror ("parse error; also virtual memory exhausted");
1098 #endif /* YYERROR_VERBOSE */
1099 yyerror ("parse error");
1104 /*----------------------------------------------------.
1105 | yyerrlab1 -- error raised explicitly by an action. |
1106 `----------------------------------------------------*/
1108 if (yyerrstatus == 3)
1110 /* If just tried and failed to reuse lookahead token after an
1111 error, discard it. */
1113 /* Return failure if at end of input. */
1114 if (yychar == YYEOF)
1116 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1117 yychar, yytname[yychar1]));
1121 /* Else will try to reuse lookahead token after shifting the error
1124 yyerrstatus = 3; /* Each real token shifted decrements this. */
1129 /*-------------------------------------------------------------------.
1130 | yyerrdefault -- current state does not do anything special for the |
1132 `-------------------------------------------------------------------*/
1135 /* This is wrong; only states that explicitly want error tokens
1136 should shift them. */
1138 /* If its default is to accept any token, ok. Otherwise pop it. */
1139 yyn = yydefact[yystate];
1145 /*---------------------------------------------------------------.
1146 | yyerrpop -- pop the current state because it cannot handle the |
1148 `---------------------------------------------------------------*/
1161 short *yyssp1 = yyss - 1;
1162 YYFPRINTF (stderr, "Error: state stack now");
1163 while (yyssp1 != yyssp)
1164 YYFPRINTF (stderr, " %d", *++yyssp1);
1165 YYFPRINTF (stderr, "\n");
1173 yyn = yypact[yystate];
1178 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1195 YYDPRINTF ((stderr, "Shifting error token, "));
1206 /*-------------------------------------.
1207 | yyacceptlab -- YYACCEPT comes here. |
1208 `-------------------------------------*/
1213 /*-----------------------------------.
1214 | yyabortlab -- YYABORT comes here. |
1215 `-----------------------------------*/
1220 /*---------------------------------------------.
1221 | yyoverflowab -- parser overflow comes here. |
1222 `---------------------------------------------*/
1224 yyerror ("parser stack overflow");
1231 YYSTACK_FREE (yyss);
1237 m4_if(b4_defines_flag, 0, [],
1238 [#output "b4_output_header_name"
1239 #ifndef b4_header_guard
1240 # define b4_header_guard
1242 b4_token_defines(b4_tokens)
1245 m4_ifdef([b4_stype_line],
1246 [#line b4_stype_line "b4_filename"
1250 # define YYSTYPE yystype
1254 [extern YYSTYPE b4_prefix[]lval;])
1256 m4_if(b4_locations_flag, [0], [],
1258 typedef struct yyltype
1265 # define YYLTYPE yyltype
1269 [extern YYLTYPE b4_prefix[]lloc;])
1271 #endif /* not b4_header_guard */