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],
14 # Return the smallest unsigned int type able to handle the number MAX.
15 m4_define([b4_uint_type],
16 [m4_if(m4_eval([$1 <= 255]), [1], [unsigned char],
17 m4_eval([$1 <= 65535]), [1], [unsigned short],
21 # b4_lhs_value([TYPE])
22 # --------------------
23 # Expansion of $<TYPE>$.
24 m4_define([b4_lhs_value],
25 [yyval[]m4_ifval([$1], [.$1])])
28 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
29 # --------------------------------------
30 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
32 m4_define([b4_rhs_value],
33 [yyvsp@<:@m4_eval([$2 - $1])@:>@m4_ifval([$3], [.$3])])
39 m4_define([b4_lhs_location],
43 # b4_rhs_location(RULE-LENGTH, NUM)
44 # ---------------------------------
45 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
47 m4_define([b4_rhs_location],
48 [yylsp@<:@m4_eval([$2 - $1])@:>@])
51 m4_define_default([b4_input_suffix], [.y])
53 m4_define_default([b4_output_parser_suffix],
54 [m4_translit(b4_input_suffix, [yY], [cC])])
56 m4_define_default([b4_output_parser_name],
57 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])
60 m4_define_default([b4_output_header_suffix],
61 [m4_translit(b4_input_suffix, [yY], [hH])])
63 m4_define_default([b4_output_header_name],
64 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])
66 m4_define_default([b4_header_guard],
67 [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
68 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
71 # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
72 # -----------------------------------------
73 # Output the definition of this token as #define.
74 m4_define([b4_token_define],
79 # b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
80 # ---------------------------------------
81 # Output the definition of this token as an enum.
82 m4_define([b4_token_enum],
86 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
87 # -------------------------------------------------------
88 # Output the definition of the tokens (if there are) as enums and #define.
89 m4_define([b4_token_defines],
90 [m4_if([$@], [[]], [],
93 # if defined (__STDC__) || defined (__cplusplus)
94 /* Put the tokens into the symbol table, so that GDB and other debuggers
97 m4_map_sep([ b4_token_enum], [,
102 /* POSIX requires `int' for tokens in interfaces. */
103 # define YYTOKENTYPE int
104 #endif /* !YYTOKENTYPE */
105 m4_map([b4_token_define], [$@])
111 #output "b4_output_parser_name"
112 /* A Bison parser, made from b4_filename
113 by GNU bison b4_version. */
115 /* Skeleton output parser for Bison,
116 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
119 This program is free software; you can redistribute it and/or modify
120 it under the terms of the GNU General Public License as published by
121 the Free Software Foundation; either version 2, or (at your option)
124 This program is distributed in the hope that it will be useful,
125 but WITHOUT ANY WARRANTY; without even the implied warranty of
126 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
127 GNU General Public License for more details.
129 You should have received a copy of the GNU General Public License
130 along with this program; if not, write to the Free Software
131 Foundation, Inc., 59 Temple Place - Suite 330,
132 Boston, MA 02111-1307, USA. */
134 /* As a special exception, when this file is copied by Bison into a
135 Bison output file, you may use that output file without restriction.
136 This special exception was added by the Free Software Foundation
137 in version 1.24 of Bison. */
139 /* This is the parser code that is written into each bison parser when
140 the %semantic_parser declaration is not specified in the grammar.
141 It was written by Richard Stallman by simplifying the original so
142 called ``semantic'' parser. */
144 /* All symbols defined below should begin with yy or YY, to avoid
145 infringing on user name space. This should be done even for local
146 variables, as they might otherwise be expanded by user macros.
147 There are some unavoidable exceptions within include files to
148 define necessary library symbols; they are noted "INFRINGES ON
149 USER NAME SPACE" below. */
151 /* Identify Bison output. */
155 #define YYPURE b4_pure
157 /* Using locations. */
158 #define YYLSP_NEEDED b4_locations_flag
160 m4_if(b4_prefix[], [yy], [],
161 [/* If NAME_PREFIX is specified substitute the variables and functions
163 #define yyparse b4_prefix[]parse
164 #define yylex b4_prefix[]lex
165 #define yyerror b4_prefix[]error
166 #define yylval b4_prefix[]lval
167 #define yychar b4_prefix[]char
168 #define yydebug b4_prefix[]debug
169 #define yynerrs b4_prefix[]nerrs
171 # define yylloc b4_prefix[]lloc
175 /* Copy the first part of user declarations. */
178 /* Enabling traces. */
180 # define YYDEBUG b4_debug
183 /* Enabling verbose error messages. */
184 #ifdef YYERROR_VERBOSE
185 # undef YYERROR_VERBOSE
186 # define YYERROR_VERBOSE 1
188 # define YYERROR_VERBOSE b4_error_verbose
192 m4_ifdef([b4_stype_line],
193 [#line b4_stype_line "b4_filename"
195 typedef b4_stype yystype;
196 # define YYSTYPE yystype
197 # define YYSTYPE_IS_TRIVIAL 1
201 typedef struct yyltype
208 # define YYLTYPE b4_ltype
209 # define YYLTYPE_IS_TRIVIAL 1
212 /* Copy the second part of user declarations. */
215 /* Line __line__ of __file__. */
216 #line __oline__ "__ofile__"
218 #if ! defined (yyoverflow) || YYERROR_VERBOSE
220 /* The parser invokes alloca or malloc; define the necessary symbols. */
222 # if YYSTACK_USE_ALLOCA
223 # define YYSTACK_ALLOC alloca
225 # ifndef YYSTACK_USE_ALLOCA
226 # if defined (alloca) || defined (_ALLOCA_H)
227 # define YYSTACK_ALLOC alloca
230 # define YYSTACK_ALLOC __builtin_alloca
236 # ifdef YYSTACK_ALLOC
237 /* Pacify GCC's `empty if-body' warning. */
238 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
240 # if defined (__STDC__) || defined (__cplusplus)
241 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
242 # define YYSIZE_T size_t
244 # define YYSTACK_ALLOC malloc
245 # define YYSTACK_FREE free
247 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
250 #if (! defined (yyoverflow) \
251 && (! defined (__cplusplus) \
252 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
254 /* A type that is properly aligned for any stack member. */
264 /* The size of the maximum gap between one aligned stack and the next. */
265 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
267 /* The size of an array large to enough to hold all stacks, each with
270 # define YYSTACK_BYTES(N) \
271 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
272 + 2 * YYSTACK_GAP_MAX)
274 # define YYSTACK_BYTES(N) \
275 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
279 /* Copy COUNT objects from FROM to TO. The source and destination do
283 # define YYCOPY(To, From, Count) \
284 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
286 # define YYCOPY(To, From, Count) \
289 register YYSIZE_T yyi; \
290 for (yyi = 0; yyi < (Count); yyi++) \
291 (To)[[yyi]] = (From)[[yyi]]; \
297 /* Relocate STACK from its old location to the new one. The
298 local variables YYSIZE and YYSTACKSIZE give the old and new number of
299 elements in the stack, and YYPTR gives the new location of the
300 stack. Advance YYPTR to a properly aligned location for the next
302 # define YYSTACK_RELOCATE(Stack) \
305 YYSIZE_T yynewbytes; \
306 YYCOPY (&yyptr->Stack, Stack, yysize); \
307 Stack = &yyptr->Stack; \
308 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
309 yyptr += yynewbytes / sizeof (*yyptr); \
315 b4_token_defines(b4_tokens)
317 /* YYFINAL -- State number of the termination state. */
318 #define YYFINAL b4_final
319 #define YYFLAG b4_flag
320 #define YYLAST b4_last
322 /* YYNTOKENS -- Number of terminals. */
323 #define YYNTOKENS b4_ntokens
324 /* YYNNTS -- Number of nonterminals. */
325 #define YYNNTS b4_nnts
326 /* YYNRULES -- Number of rules. */
327 #define YYNRULES b4_nrules
328 /* YYNRULES -- Number of states. */
329 #define YYNSTATES b4_nstates
331 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
332 #define YYUNDEFTOK b4_undef_token_number
333 #define YYMAXUTOK b4_user_token_number_max
335 #define YYTRANSLATE(X) \
336 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
338 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
339 static const b4_uint_type(b4_translate_max) yytranslate[[]] =
345 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
347 static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
352 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
353 static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
358 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
359 static const b4_uint_type(b4_rline_max) yyrline[[]] =
365 #if YYDEBUG || YYERROR_VERBOSE
366 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
367 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
368 static const char *const yytname[[]] =
374 /* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to
376 static const short yytoknum[[]] =
381 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
382 static const b4_uint_type(b4_r1_max) yyr1[[]] =
387 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
388 static const b4_uint_type(b4_r2_max) yyr2[[]] =
393 /* YYDEFACT[[STATE-NAME]] -- Default rule to reduce with in state
394 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
395 means the default is an error. */
396 static const short yydefact[[]] =
401 /* YYPGOTO[[NTERM-NUM]]. */
402 static const short yydefgoto[[]] =
407 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
409 static const short yypact[[]] =
414 /* YYPGOTO[[NTERM-NUM]]. */
415 static const short yypgoto[[]] =
420 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
421 positive, shift that token. If negative, reduce the rule which
422 number is the opposite. If zero, do what YYDEFACT says. */
423 static const short yytable[[]] =
428 static const short yycheck[[]] =
434 /* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing
435 symbol of state STATE-NUM. */
436 static const b4_uint_type(b4_stos_max) yystos[[]] =
442 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
443 # define YYSIZE_T __SIZE_TYPE__
445 #if ! defined (YYSIZE_T) && defined (size_t)
446 # define YYSIZE_T size_t
448 #if ! defined (YYSIZE_T)
449 # if defined (__STDC__) || defined (__cplusplus)
450 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
451 # define YYSIZE_T size_t
454 #if ! defined (YYSIZE_T)
455 # define YYSIZE_T unsigned int
458 #define yyerrok (yyerrstatus = 0)
459 #define yyclearin (yychar = YYEMPTY)
463 #define YYACCEPT goto yyacceptlab
464 #define YYABORT goto yyabortlab
465 #define YYERROR goto yyerrlab1
467 /* Like YYERROR except do call yyerror. This remains here temporarily
468 to ease the transition to the new meaning of YYERROR, for GCC.
469 Once GCC version 2 has supplanted version 1, this can go. */
471 #define YYFAIL goto yyerrlab
473 #define YYRECOVERING() (!!yyerrstatus)
475 #define YYBACKUP(Token, Value) \
477 if (yychar == YYEMPTY && yylen == 1) \
481 yychar1 = YYTRANSLATE (yychar); \
487 yyerror ("syntax error: cannot back up"); \
493 #define YYERRCODE 256
495 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
498 #ifndef YYLLOC_DEFAULT
499 # define YYLLOC_DEFAULT(Current, Rhs, N) \
500 Current.first_line = Rhs[[1]].first_line; \
501 Current.first_column = Rhs[[1]].first_column; \
502 Current.last_line = Rhs[[N]].last_line; \
503 Current.last_column = Rhs[[N]].last_column;
506 /* YYLEX -- calling `yylex' with the right arguments. */
511 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
513 # define YYLEX yylex (&yylval, &yylloc)
515 # else /* !YYLSP_NEEDED */
517 # define YYLEX yylex (&yylval, YYLEX_PARAM)
519 # define YYLEX yylex (&yylval)
521 # endif /* !YYLSP_NEEDED */
523 # define YYLEX yylex ()
526 /* Enable debugging if requested. */
530 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
531 # define YYFPRINTF fprintf
534 # define YYDPRINTF(Args) \
539 /* Nonzero means print parse trace. It is left uninitialized so that
540 multiple parsers can coexist. */
543 # define YYDPRINTF(Args)
544 #endif /* !YYDEBUG */
546 /* YYINITDEPTH -- initial size of the parser's stacks. */
548 # define YYINITDEPTH b4_initdepth
551 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
552 if the built-in stack extension method is used).
554 Do not make this value too large; the results are undefined if
555 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
556 evaluated with infinite-precision integer arithmetic. */
563 # define YYMAXDEPTH b4_maxdepth
571 # if defined (__GLIBC__) && defined (_STRING_H)
572 # define yystrlen strlen
574 /* Return the length of YYSTR. */
576 # if defined (__STDC__) || defined (__cplusplus)
577 yystrlen (const char *yystr)
583 register const char *yys = yystr;
585 while (*yys++ != '\0')
588 return yys - yystr - 1;
594 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
595 # define yystpcpy stpcpy
597 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
600 # if defined (__STDC__) || defined (__cplusplus)
601 yystpcpy (char *yydest, const char *yysrc)
603 yystpcpy (yydest, yysrc)
608 register char *yyd = yydest;
609 register const char *yys = yysrc;
611 while ((*yyd++ = *yys++) != '\0')
619 #endif /* !YYERROR_VERBOSE */
623 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
624 into yyparse. The argument should have type void *.
625 It should actually point to an object.
626 Grammar actions can access the variable by casting it
627 to the proper pointer type. */
630 # if defined (__STDC__) || defined (__cplusplus)
631 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
632 # define YYPARSE_PARAM_DECL
634 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
635 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
637 #else /* !YYPARSE_PARAM */
638 # define YYPARSE_PARAM_ARG
639 # define YYPARSE_PARAM_DECL
640 #endif /* !YYPARSE_PARAM */
642 /* Prevent warning if -Wstrict-prototypes. */
644 # ifdef YYPARSE_PARAM
645 int yyparse (void *);
651 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
652 variables are global, or local to YYPARSE. */
654 #define YY_DECL_NON_LSP_VARIABLES \
655 /* The lookahead symbol. */ \
658 /* The semantic value of the lookahead symbol. */ \
661 /* Number of parse errors so far. */ \
665 # define YY_DECL_VARIABLES \
666 YY_DECL_NON_LSP_VARIABLES \
668 /* Location data for the lookahead symbol. */ \
671 # define YY_DECL_VARIABLES \
672 YY_DECL_NON_LSP_VARIABLES
675 /* If nonreentrant, generate the variables here. */
682 yyparse (YYPARSE_PARAM_ARG)
685 /* If reentrant, generate the variables here. */
690 register int yystate;
693 /* Number of tokens to shift before error messages enabled. */
695 /* Lookahead token as an internal (translated) token number. */
698 /* Three stacks and their tools:
699 `yyss': related to states,
700 `yyvs': related to semantic values,
701 `yyls': related to locations.
703 Refer to the stacks thru separate pointers, to allow yyoverflow
704 to reallocate them elsewhere. */
706 /* The state stack. */
707 short yyssa[YYINITDEPTH];
709 register short *yyssp;
711 /* The semantic value stack. */
712 YYSTYPE yyvsa[YYINITDEPTH];
713 YYSTYPE *yyvs = yyvsa;
714 register YYSTYPE *yyvsp;
717 /* The location stack. */
718 YYLTYPE yylsa[YYINITDEPTH];
719 YYLTYPE *yyls = yylsa;
724 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
726 # define YYPOPSTACK (yyvsp--, yyssp--)
729 YYSIZE_T yystacksize = YYINITDEPTH;
731 /* The variables used to return semantic value and location from the
738 /* When reducing, the number of symbols on the RHS of the reduced
742 YYDPRINTF ((stderr, "Starting parse\n"));
747 yychar = YYEMPTY; /* Cause a token to be read. */
749 /* Initialize stack pointers.
750 Waste one element of value and location stack
751 so that they stay on the same level as the state stack.
752 The wasted elements are never initialized. */
761 /*------------------------------------------------------------.
762 | yynewstate -- Push a new state, which is found in yystate. |
763 `------------------------------------------------------------*/
765 /* In all cases, when you get here, the value and location stacks
766 have just been pushed. so pushing a state here evens the stacks.
773 if (yyssp >= yyss + yystacksize - 1)
775 /* Get the current used size of the three stacks, in elements. */
776 YYSIZE_T yysize = yyssp - yyss + 1;
780 /* Give user a chance to reallocate the stack. Use copies of
781 these so that the &'s don't force the real ones into
783 YYSTYPE *yyvs1 = yyvs;
786 /* Each stack pointer address is followed by the size of the
787 data in use in that stack, in bytes. */
789 YYLTYPE *yyls1 = yyls;
790 /* This used to be a conditional around just the two extra args,
791 but that might be undefined if yyoverflow is a macro. */
792 yyoverflow ("parser stack overflow",
793 &yyss1, yysize * sizeof (*yyssp),
794 &yyvs1, yysize * sizeof (*yyvsp),
795 &yyls1, yysize * sizeof (*yylsp),
799 yyoverflow ("parser stack overflow",
800 &yyss1, yysize * sizeof (*yyssp),
801 &yyvs1, yysize * sizeof (*yyvsp),
807 #else /* no yyoverflow */
808 # ifndef YYSTACK_RELOCATE
811 /* Extend the stack our own way. */
812 if (yystacksize >= YYMAXDEPTH)
815 if (yystacksize > YYMAXDEPTH)
816 yystacksize = YYMAXDEPTH;
820 union yyalloc *yyptr =
821 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
824 YYSTACK_RELOCATE (yyss);
825 YYSTACK_RELOCATE (yyvs);
827 YYSTACK_RELOCATE (yyls);
829 # undef YYSTACK_RELOCATE
831 YYSTACK_FREE (yyss1);
834 #endif /* no yyoverflow */
836 yyssp = yyss + yysize - 1;
837 yyvsp = yyvs + yysize - 1;
839 yylsp = yyls + yysize - 1;
842 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
843 (unsigned long int) yystacksize));
845 if (yyssp >= yyss + yystacksize - 1)
849 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
858 /* Do appropriate processing given the current state. */
859 /* Read a lookahead token if we need one and don't already have one. */
862 /* First try to decide what to do without reference to lookahead token. */
864 yyn = yypact[yystate];
868 /* Not known => get a lookahead token if don't already have one. */
870 /* yychar is either YYEMPTY or YYEOF
871 or a valid token in external form. */
873 if (yychar == YYEMPTY)
875 YYDPRINTF ((stderr, "Reading a token: "));
879 /* Convert token to internal form (in yychar1) for indexing tables with. */
881 if (yychar <= 0) /* This means end of input. */
884 yychar = YYEOF; /* Don't call YYLEX any more. */
886 YYDPRINTF ((stderr, "Now at end of input.\n"));
890 yychar1 = YYTRANSLATE (yychar);
893 /* We have to keep this `#if YYDEBUG', since we use variables
894 which are defined only if `YYDEBUG' is set. */
897 YYFPRINTF (stderr, "Next token is %d (%s",
898 yychar, yytname[yychar1]);
899 /* Give the individual parser a way to print the precise
900 meaning of a token, for further debugging info. */
902 YYPRINT (stderr, yychar, yylval);
904 YYFPRINTF (stderr, ")\n");
910 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
915 /* yyn is what to do for this token type in this state.
916 Negative => reduce, -yyn is rule number.
917 Positive => shift, yyn is new state.
918 New state is final state => don't bother to shift,
920 0, or most negative number => error. */
935 /* Shift the lookahead token. */
936 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
937 yychar, yytname[yychar1]));
939 /* Discard the token being shifted unless it is eof. */
948 /* Count tokens shifted since error; after three, turn off error
957 /*-----------------------------------------------------------.
958 | yydefault -- do the default action for the current state. |
959 `-----------------------------------------------------------*/
961 yyn = yydefact[yystate];
967 /*-----------------------------.
968 | yyreduce -- Do a reduction. |
969 `-----------------------------*/
971 /* yyn is the number of a rule to reduce with. */
974 /* If YYLEN is nonzero, implement the default value of the action:
977 Otherwise, the following line sets YYVAL to the semantic value of
978 the lookahead token. This behavior is undocumented and Bison
979 users should not rely upon it. Assigning to YYVAL
980 unconditionally makes the parser a bit smaller, and it avoids a
981 GCC warning that YYVAL may be used uninitialized. */
982 yyval = yyvsp[1-yylen];
985 /* Default location. */
986 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
990 /* We have to keep this `#if YYDEBUG', since we use variables which
991 are defined only if `YYDEBUG' is set. */
996 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
997 yyn - 1, yyrline[yyn]);
999 /* Print the symbols being reduced, and their result. */
1000 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
1001 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1002 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1010 /* Line __line__ of __file__. */
1011 #line __oline__ "__ofile__"
1022 short *yyssp1 = yyss - 1;
1023 YYFPRINTF (stderr, "state stack now");
1024 while (yyssp1 != yyssp)
1025 YYFPRINTF (stderr, " %d", *++yyssp1);
1026 YYFPRINTF (stderr, "\n");
1035 /* Now `shift' the result of the reduction. Determine what state
1036 that goes to, based on the state we popped back to and the rule
1037 number reduced by. */
1041 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1042 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1043 yystate = yytable[yystate];
1045 yystate = yydefgoto[yyn - YYNTOKENS];
1050 /*------------------------------------.
1051 | yyerrlab -- here on detecting error |
1052 `------------------------------------*/
1054 /* If not already recovering from an error, report this error. */
1060 yyn = yypact[yystate];
1062 if (yyn > YYFLAG && yyn < YYLAST)
1064 YYSIZE_T yysize = 0;
1069 /* Start YYX at -YYN if negative to avoid negative indexes in
1071 for (yyx = yyn < 0 ? -yyn : 0;
1072 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1073 if (yycheck[yyx + yyn] == yyx)
1074 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1075 yysize += yystrlen ("parse error, unexpected ") + 1;
1076 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1077 yymsg = (char *) YYSTACK_ALLOC (yysize);
1080 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1081 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1086 for (yyx = yyn < 0 ? -yyn : 0;
1087 yyx < (int) (sizeof (yytname) / sizeof (char *));
1089 if (yycheck[yyx + yyn] == yyx)
1091 const char *yyq = ! yycount ? ", expecting " : " or ";
1092 yyp = yystpcpy (yyp, yyq);
1093 yyp = yystpcpy (yyp, yytname[yyx]);
1098 YYSTACK_FREE (yymsg);
1101 yyerror ("parse error; also virtual memory exhausted");
1104 #endif /* YYERROR_VERBOSE */
1105 yyerror ("parse error");
1110 /*----------------------------------------------------.
1111 | yyerrlab1 -- error raised explicitly by an action. |
1112 `----------------------------------------------------*/
1114 if (yyerrstatus == 3)
1116 /* If just tried and failed to reuse lookahead token after an
1117 error, discard it. */
1119 /* Return failure if at end of input. */
1120 if (yychar == YYEOF)
1122 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1123 yychar, yytname[yychar1]));
1127 /* Else will try to reuse lookahead token after shifting the error
1130 yyerrstatus = 3; /* Each real token shifted decrements this. */
1134 yyn = yypact[yystate];
1138 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1146 /* Pop the current state because it cannot handle the error token. */
1153 if (yystos[yystate] < YYNTOKENS)
1155 YYFPRINTF (stderr, "Error: popping token %d (%s",
1156 yytoknum[yystos[yystate]], yytname[yystos[yystate]]);
1158 YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp);
1160 YYFPRINTF (stderr, ")\n");
1164 YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",
1165 yytname[yystos[yystate]]);
1179 short *yyssp1 = yyss - 1;
1180 YYFPRINTF (stderr, "Error: state stack now");
1181 while (yyssp1 != yyssp)
1182 YYFPRINTF (stderr, " %d", *++yyssp1);
1183 YYFPRINTF (stderr, "\n");
1191 YYDPRINTF ((stderr, "Shifting error token, "));
1202 /*-------------------------------------.
1203 | yyacceptlab -- YYACCEPT comes here. |
1204 `-------------------------------------*/
1209 /*-----------------------------------.
1210 | yyabortlab -- YYABORT comes here. |
1211 `-----------------------------------*/
1216 /*---------------------------------------------.
1217 | yyoverflowab -- parser overflow comes here. |
1218 `---------------------------------------------*/
1220 yyerror ("parser stack overflow");
1227 YYSTACK_FREE (yyss);
1233 m4_if(b4_defines_flag, 0, [],
1234 [#output "b4_output_header_name"
1235 #ifndef b4_header_guard
1236 # define b4_header_guard
1238 b4_token_defines(b4_tokens)
1241 m4_ifdef([b4_stype_line],
1242 [#line b4_stype_line "b4_filename"
1246 # define YYSTYPE yystype
1250 [extern YYSTYPE b4_prefix[]lval;])
1252 m4_if(b4_locations_flag, [0], [],
1254 typedef struct yyltype
1261 # define YYLTYPE yyltype
1265 [extern YYLTYPE b4_prefix[]lloc;])
1267 #endif /* not b4_header_guard */