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_defines(TOKEN-NAME, TOKEN-NUMBER)
74 # ------------------------------------------
75 # Output the definition of this token as #define.
76 m4_define([b4_token_define],
81 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
82 # -------------------------------------------------------
83 # Output the definition of the tokens as #define.
84 m4_define([b4_token_defines],
85 [m4_map([b4_token_define], [$@])])
89 #output "b4_output_parser_name"
90 /* A Bison parser, made from b4_filename
91 by GNU bison b4_version. */
93 /* Skeleton output parser for Bison,
94 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
97 This program is free software; you can redistribute it and/or modify
98 it under the terms of the GNU General Public License as published by
99 the Free Software Foundation; either version 2, or (at your option)
102 This program is distributed in the hope that it will be useful,
103 but WITHOUT ANY WARRANTY; without even the implied warranty of
104 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105 GNU General Public License for more details.
107 You should have received a copy of the GNU General Public License
108 along with this program; if not, write to the Free Software
109 Foundation, Inc., 59 Temple Place - Suite 330,
110 Boston, MA 02111-1307, USA. */
112 /* As a special exception, when this file is copied by Bison into a
113 Bison output file, you may use that output file without restriction.
114 This special exception was added by the Free Software Foundation
115 in version 1.24 of Bison. */
117 /* This is the parser code that is written into each bison parser when
118 the %semantic_parser declaration is not specified in the grammar.
119 It was written by Richard Stallman by simplifying the hairy parser
120 used when %semantic_parser is specified. */
122 /* All symbols defined below should begin with yy or YY, to avoid
123 infringing on user name space. This should be done even for local
124 variables, as they might otherwise be expanded by user macros.
125 There are some unavoidable exceptions within include files to
126 define necessary library symbols; they are noted "INFRINGES ON
127 USER NAME SPACE" below. */
129 /* Identify Bison output. */
133 #define YYPURE b4_pure
135 /* Using locations. */
136 #define YYLSP_NEEDED b4_locations_flag
138 m4_if(b4_prefix[], [yy], [],
139 [/* If NAME_PREFIX is specified substitute the variables and functions
141 #define yyparse b4_prefix[]parse
142 #define yylex b4_prefix[]lex
143 #define yyerror b4_prefix[]error
144 #define yylval b4_prefix[]lval
145 #define yychar b4_prefix[]char
146 #define yydebug b4_prefix[]debug
147 #define yynerrs b4_prefix[]nerrs
149 # define yylloc b4_prefix[]lloc
153 /* Copy the first part of user declarations. */
156 /* Enabling traces. */
158 # define YYDEBUG b4_debug
161 /* Enabling verbose error messages. */
162 #ifdef YYERROR_VERBOSE
163 # undef YYERROR_VERBOSE
164 # define YYERROR_VERBOSE 1
166 # define YYERROR_VERBOSE b4_error_verbose
170 m4_ifdef([b4_stype_line],
171 [#line b4_stype_line "b4_filename"
173 typedef b4_stype yystype;
174 # define YYSTYPE yystype
175 # define YYSTYPE_IS_TRIVIAL 1
179 typedef struct yyltype
186 # define YYLTYPE b4_ltype
187 # define YYLTYPE_IS_TRIVIAL 1
190 /* Copy the second part of user declarations. */
193 /* Line __line__ of __file__. */
194 #line __oline__ "__ofile__"
196 #if ! defined (yyoverflow) || YYERROR_VERBOSE
198 /* The parser invokes alloca or malloc; define the necessary symbols. */
200 # if YYSTACK_USE_ALLOCA
201 # define YYSTACK_ALLOC alloca
203 # ifndef YYSTACK_USE_ALLOCA
204 # if defined (alloca) || defined (_ALLOCA_H)
205 # define YYSTACK_ALLOC alloca
208 # define YYSTACK_ALLOC __builtin_alloca
214 # ifdef YYSTACK_ALLOC
215 /* Pacify GCC's `empty if-body' warning. */
216 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
218 # if defined (__STDC__) || defined (__cplusplus)
219 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
220 # define YYSIZE_T size_t
222 # define YYSTACK_ALLOC malloc
223 # define YYSTACK_FREE free
225 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
228 #if (! defined (yyoverflow) \
229 && (! defined (__cplusplus) \
230 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
232 /* A type that is properly aligned for any stack member. */
242 /* The size of the maximum gap between one aligned stack and the next. */
243 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
245 /* The size of an array large to enough to hold all stacks, each with
248 # define YYSTACK_BYTES(N) \
249 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
250 + 2 * YYSTACK_GAP_MAX)
252 # define YYSTACK_BYTES(N) \
253 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
257 /* Copy COUNT objects from FROM to TO. The source and destination do
261 # define YYCOPY(To, From, Count) \
262 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
264 # define YYCOPY(To, From, Count) \
267 register YYSIZE_T yyi; \
268 for (yyi = 0; yyi < (Count); yyi++) \
269 (To)[[yyi]] = (From)[[yyi]]; \
275 /* Relocate STACK from its old location to the new one. The
276 local variables YYSIZE and YYSTACKSIZE give the old and new number of
277 elements in the stack, and YYPTR gives the new location of the
278 stack. Advance YYPTR to a properly aligned location for the next
280 # define YYSTACK_RELOCATE(Stack) \
283 YYSIZE_T yynewbytes; \
284 YYCOPY (&yyptr->Stack, Stack, yysize); \
285 Stack = &yyptr->Stack; \
286 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
287 yyptr += yynewbytes / sizeof (*yyptr); \
294 b4_token_defines(b4_tokens)
296 /* YYFINAL -- State number of the termination state. */
297 #define YYFINAL b4_final
298 #define YYFLAG b4_flag
299 #define YYLAST b4_last
301 /* YYNTOKENS -- Number of terminals. */
302 #define YYNTOKENS b4_ntokens
303 /* YYNNTS -- Number of nonterminals. */
304 #define YYNNTS b4_nnts
305 /* YYNRULES -- Number of rules. */
306 #define YYNRULES b4_nrules
307 /* YYNRULES -- Number of states. */
308 #define YYNSTATES b4_nstates
310 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
311 #define YYUNDEFTOK b4_undef_token_number
312 #define YYMAXUTOK b4_user_token_number_max
314 typedef b4_uint_type(b4_token_number_max) yy_token_number_type;
315 #define YYTRANSLATE(X) \
316 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
318 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
319 static const yy_token_number_type yytranslate[[]] =
325 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
327 static const short yyprhs[[]] =
332 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
333 typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
334 static const yyrhs_t yyrhs[[]] =
339 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
340 static const short yyrline[[]] =
346 #if (YYDEBUG) || YYERROR_VERBOSE
347 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
348 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
349 static const char *const yytname[[]] =
355 /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */
356 static const short yytoknum[[]] =
361 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
362 static const yy_token_number_type yyr1[[]] =
367 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
368 static const short yyr2[[]] =
373 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
374 doesn't specify something else to do. Zero means the default is an
376 static const short yydefact[[]] =
381 /* YYPGOTO[[NTERM-NUM]]. */
382 static const short yydefgoto[[]] =
387 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
389 static const short yypact[[]] =
394 /* YYPGOTO[[NTERM-NUM]]. */
395 static const short yypgoto[[]] =
400 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
401 positive, shift that token. If negative, reduce the rule which
402 number is the opposite. If zero, do what YYDEFACT says. */
403 static const short yytable[[]] =
408 static const short yycheck[[]] =
414 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
415 # define YYSIZE_T __SIZE_TYPE__
417 #if ! defined (YYSIZE_T) && defined (size_t)
418 # define YYSIZE_T size_t
420 #if ! defined (YYSIZE_T)
421 # if defined (__STDC__) || defined (__cplusplus)
422 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
423 # define YYSIZE_T size_t
426 #if ! defined (YYSIZE_T)
427 # define YYSIZE_T unsigned int
430 #define yyerrok (yyerrstatus = 0)
431 #define yyclearin (yychar = YYEMPTY)
435 #define YYACCEPT goto yyacceptlab
436 #define YYABORT goto yyabortlab
437 #define YYERROR goto yyerrlab1
439 /* Like YYERROR except do call yyerror. This remains here temporarily
440 to ease the transition to the new meaning of YYERROR, for GCC.
441 Once GCC version 2 has supplanted version 1, this can go. */
443 #define YYFAIL goto yyerrlab
445 #define YYRECOVERING() (!!yyerrstatus)
447 #define YYBACKUP(Token, Value) \
449 if (yychar == YYEMPTY && yylen == 1) \
453 yychar1 = YYTRANSLATE (yychar); \
459 yyerror ("syntax error: cannot back up"); \
465 #define YYERRCODE 256
467 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
470 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
471 first token. By default, to implement support for ranges, extend
472 its range to the last symbol. */
474 #ifndef YYLLOC_DEFAULT
475 # define YYLLOC_DEFAULT(Current, Rhs, N) \
476 Current.last_line = Rhs[[N]].last_line; \
477 Current.last_column = Rhs[[N]].last_column;
480 /* YYLEX -- calling `yylex' with the right arguments. */
485 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
487 # define YYLEX yylex (&yylval, &yylloc)
489 # else /* !YYLSP_NEEDED */
491 # define YYLEX yylex (&yylval, YYLEX_PARAM)
493 # define YYLEX yylex (&yylval)
495 # endif /* !YYLSP_NEEDED */
497 # define YYLEX yylex ()
500 /* Enable debugging if requested. */
504 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
505 # define YYFPRINTF fprintf
508 # define YYDPRINTF(Args) \
513 /* Nonzero means print parse trace. It is left uninitialized so that
514 multiple parsers can coexist. */
517 # define YYDPRINTF(Args)
518 #endif /* !YYDEBUG */
520 /* YYINITDEPTH -- initial size of the parser's stacks. */
522 # define YYINITDEPTH b4_initdepth
525 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
526 if the built-in stack extension method is used).
528 Do not make this value too large; the results are undefined if
529 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
530 evaluated with infinite-precision integer arithmetic. */
537 # define YYMAXDEPTH b4_maxdepth
545 # if defined (__GLIBC__) && defined (_STRING_H)
546 # define yystrlen strlen
548 /* Return the length of YYSTR. */
550 # if defined (__STDC__) || defined (__cplusplus)
551 yystrlen (const char *yystr)
557 register const char *yys = yystr;
559 while (*yys++ != '\0')
562 return yys - yystr - 1;
568 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
569 # define yystpcpy stpcpy
571 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
574 # if defined (__STDC__) || defined (__cplusplus)
575 yystpcpy (char *yydest, const char *yysrc)
577 yystpcpy (yydest, yysrc)
582 register char *yyd = yydest;
583 register const char *yys = yysrc;
585 while ((*yyd++ = *yys++) != '\0')
593 #endif /* !YYERROR_VERBOSE */
597 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
598 into yyparse. The argument should have type void *.
599 It should actually point to an object.
600 Grammar actions can access the variable by casting it
601 to the proper pointer type. */
604 # if defined (__STDC__) || defined (__cplusplus)
605 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
606 # define YYPARSE_PARAM_DECL
608 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
609 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
611 #else /* !YYPARSE_PARAM */
612 # define YYPARSE_PARAM_ARG
613 # define YYPARSE_PARAM_DECL
614 #endif /* !YYPARSE_PARAM */
616 /* Prevent warning if -Wstrict-prototypes. */
618 # ifdef YYPARSE_PARAM
619 int yyparse (void *);
625 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
626 variables are global, or local to YYPARSE. */
628 #define YY_DECL_NON_LSP_VARIABLES \
629 /* The lookahead symbol. */ \
632 /* The semantic value of the lookahead symbol. */ \
635 /* Number of parse errors so far. */ \
639 # define YY_DECL_VARIABLES \
640 YY_DECL_NON_LSP_VARIABLES \
642 /* Location data for the lookahead symbol. */ \
645 # define YY_DECL_VARIABLES \
646 YY_DECL_NON_LSP_VARIABLES
649 /* If nonreentrant, generate the variables here. */
656 yyparse (YYPARSE_PARAM_ARG)
659 /* If reentrant, generate the variables here. */
664 register int yystate;
667 /* Number of tokens to shift before error messages enabled. */
669 /* Lookahead token as an internal (translated) token number. */
672 /* Three stacks and their tools:
673 `yyss': related to states,
674 `yyvs': related to semantic values,
675 `yyls': related to locations.
677 Refer to the stacks thru separate pointers, to allow yyoverflow
678 to reallocate them elsewhere. */
680 /* The state stack. */
681 short yyssa[YYINITDEPTH];
683 register short *yyssp;
685 /* The semantic value stack. */
686 YYSTYPE yyvsa[YYINITDEPTH];
687 YYSTYPE *yyvs = yyvsa;
688 register YYSTYPE *yyvsp;
691 /* The location stack. */
692 YYLTYPE yylsa[YYINITDEPTH];
693 YYLTYPE *yyls = yylsa;
698 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
700 # define YYPOPSTACK (yyvsp--, yyssp--)
703 YYSIZE_T yystacksize = YYINITDEPTH;
705 /* The variables used to return semantic value and location from the
712 /* When reducing, the number of symbols on the RHS of the reduced
716 YYDPRINTF ((stderr, "Starting parse\n"));
721 yychar = YYEMPTY; /* Cause a token to be read. */
723 /* Initialize stack pointers.
724 Waste one element of value and location stack
725 so that they stay on the same level as the state stack.
726 The wasted elements are never initialized. */
735 /*------------------------------------------------------------.
736 | yynewstate -- Push a new state, which is found in yystate. |
737 `------------------------------------------------------------*/
739 /* In all cases, when you get here, the value and location stacks
740 have just been pushed. so pushing a state here evens the stacks.
747 if (yyssp >= yyss + yystacksize - 1)
749 /* Get the current used size of the three stacks, in elements. */
750 YYSIZE_T yysize = yyssp - yyss + 1;
754 /* Give user a chance to reallocate the stack. Use copies of
755 these so that the &'s don't force the real ones into
757 YYSTYPE *yyvs1 = yyvs;
760 /* Each stack pointer address is followed by the size of the
761 data in use in that stack, in bytes. */
763 YYLTYPE *yyls1 = yyls;
764 /* This used to be a conditional around just the two extra args,
765 but that might be undefined if yyoverflow is a macro. */
766 yyoverflow ("parser stack overflow",
767 &yyss1, yysize * sizeof (*yyssp),
768 &yyvs1, yysize * sizeof (*yyvsp),
769 &yyls1, yysize * sizeof (*yylsp),
773 yyoverflow ("parser stack overflow",
774 &yyss1, yysize * sizeof (*yyssp),
775 &yyvs1, yysize * sizeof (*yyvsp),
781 #else /* no yyoverflow */
782 # ifndef YYSTACK_RELOCATE
785 /* Extend the stack our own way. */
786 if (yystacksize >= YYMAXDEPTH)
789 if (yystacksize > YYMAXDEPTH)
790 yystacksize = YYMAXDEPTH;
794 union yyalloc *yyptr =
795 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
798 YYSTACK_RELOCATE (yyss);
799 YYSTACK_RELOCATE (yyvs);
801 YYSTACK_RELOCATE (yyls);
803 # undef YYSTACK_RELOCATE
805 YYSTACK_FREE (yyss1);
808 #endif /* no yyoverflow */
810 yyssp = yyss + yysize - 1;
811 yyvsp = yyvs + yysize - 1;
813 yylsp = yyls + yysize - 1;
816 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
817 (unsigned long int) yystacksize));
819 if (yyssp >= yyss + yystacksize - 1)
823 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
832 /* Do appropriate processing given the current state. */
833 /* Read a lookahead token if we need one and don't already have one. */
836 /* First try to decide what to do without reference to lookahead token. */
838 yyn = yypact[yystate];
842 /* Not known => get a lookahead token if don't already have one. */
844 /* yychar is either YYEMPTY or YYEOF
845 or a valid token in external form. */
847 if (yychar == YYEMPTY)
849 YYDPRINTF ((stderr, "Reading a token: "));
853 /* Convert token to internal form (in yychar1) for indexing tables with. */
855 if (yychar <= 0) /* This means end of input. */
858 yychar = YYEOF; /* Don't call YYLEX any more. */
860 YYDPRINTF ((stderr, "Now at end of input.\n"));
864 yychar1 = YYTRANSLATE (yychar);
867 /* We have to keep this `#if YYDEBUG', since we use variables
868 which are defined only if `YYDEBUG' is set. */
871 YYFPRINTF (stderr, "Next token is %d (%s",
872 yychar, yytname[yychar1]);
873 /* Give the individual parser a way to print the precise
874 meaning of a token, for further debugging info. */
876 YYPRINT (stderr, yychar, yylval);
878 YYFPRINTF (stderr, ")\n");
884 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
889 /* yyn is what to do for this token type in this state.
890 Negative => reduce, -yyn is rule number.
891 Positive => shift, yyn is new state.
892 New state is final state => don't bother to shift,
894 0, or most negative number => error. */
909 /* Shift the lookahead token. */
910 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
911 yychar, yytname[yychar1]));
913 /* Discard the token being shifted unless it is eof. */
922 /* Count tokens shifted since error; after three, turn off error
931 /*-----------------------------------------------------------.
932 | yydefault -- do the default action for the current state. |
933 `-----------------------------------------------------------*/
935 yyn = yydefact[yystate];
941 /*-----------------------------.
942 | yyreduce -- Do a reduction. |
943 `-----------------------------*/
945 /* yyn is the number of a rule to reduce with. */
948 /* If YYLEN is nonzero, implement the default value of the action:
951 Otherwise, the following line sets YYVAL to the semantic value of
952 the lookahead token. This behavior is undocumented and Bison
953 users should not rely upon it. Assigning to YYVAL
954 unconditionally makes the parser a bit smaller, and it avoids a
955 GCC warning that YYVAL may be used uninitialized. */
956 yyval = yyvsp[1-yylen];
959 /* Similarly for the default location. Let the user run additional
960 commands if for instance locations are ranges. */
961 yyloc = yylsp[1-yylen];
962 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
966 /* We have to keep this `#if YYDEBUG', since we use variables which
967 are defined only if `YYDEBUG' is set. */
972 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
973 yyn - 1, yyrline[yyn]);
975 /* Print the symbols being reduced, and their result. */
976 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
977 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
978 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
986 /* Line __line__ of __file__. */
987 #line __oline__ "__ofile__"
998 short *yyssp1 = yyss - 1;
999 YYFPRINTF (stderr, "state stack now");
1000 while (yyssp1 != yyssp)
1001 YYFPRINTF (stderr, " %d", *++yyssp1);
1002 YYFPRINTF (stderr, "\n");
1011 /* Now `shift' the result of the reduction. Determine what state
1012 that goes to, based on the state we popped back to and the rule
1013 number reduced by. */
1017 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1018 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1019 yystate = yytable[yystate];
1021 yystate = yydefgoto[yyn - YYNTOKENS];
1026 /*------------------------------------.
1027 | yyerrlab -- here on detecting error |
1028 `------------------------------------*/
1030 /* If not already recovering from an error, report this error. */
1036 yyn = yypact[yystate];
1038 if (yyn > YYFLAG && yyn < YYLAST)
1040 YYSIZE_T yysize = 0;
1045 /* Start YYX at -YYN if negative to avoid negative indexes in
1047 for (yyx = yyn < 0 ? -yyn : 0;
1048 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1049 if (yycheck[yyx + yyn] == yyx)
1050 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1051 yysize += yystrlen ("parse error, unexpected ") + 1;
1052 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1053 yymsg = (char *) YYSTACK_ALLOC (yysize);
1056 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1057 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1062 for (yyx = yyn < 0 ? -yyn : 0;
1063 yyx < (int) (sizeof (yytname) / sizeof (char *));
1065 if (yycheck[yyx + yyn] == yyx)
1067 const char *yyq = ! yycount ? ", expecting " : " or ";
1068 yyp = yystpcpy (yyp, yyq);
1069 yyp = yystpcpy (yyp, yytname[yyx]);
1074 YYSTACK_FREE (yymsg);
1077 yyerror ("parse error; also virtual memory exhausted");
1080 #endif /* YYERROR_VERBOSE */
1081 yyerror ("parse error");
1086 /*----------------------------------------------------.
1087 | yyerrlab1 -- error raised explicitly by an action. |
1088 `----------------------------------------------------*/
1090 if (yyerrstatus == 3)
1092 /* If just tried and failed to reuse lookahead token after an
1093 error, discard it. */
1095 /* Return failure if at end of input. */
1096 if (yychar == YYEOF)
1098 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1099 yychar, yytname[yychar1]));
1103 /* Else will try to reuse lookahead token after shifting the error
1106 yyerrstatus = 3; /* Each real token shifted decrements this. */
1111 /*-------------------------------------------------------------------.
1112 | yyerrdefault -- current state does not do anything special for the |
1114 `-------------------------------------------------------------------*/
1117 /* This is wrong; only states that explicitly want error tokens
1118 should shift them. */
1120 /* If its default is to accept any token, ok. Otherwise pop it. */
1121 yyn = yydefact[yystate];
1127 /*---------------------------------------------------------------.
1128 | yyerrpop -- pop the current state because it cannot handle the |
1130 `---------------------------------------------------------------*/
1143 short *yyssp1 = yyss - 1;
1144 YYFPRINTF (stderr, "Error: state stack now");
1145 while (yyssp1 != yyssp)
1146 YYFPRINTF (stderr, " %d", *++yyssp1);
1147 YYFPRINTF (stderr, "\n");
1155 yyn = yypact[yystate];
1160 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1177 YYDPRINTF ((stderr, "Shifting error token, "));
1188 /*-------------------------------------.
1189 | yyacceptlab -- YYACCEPT comes here. |
1190 `-------------------------------------*/
1195 /*-----------------------------------.
1196 | yyabortlab -- YYABORT comes here. |
1197 `-----------------------------------*/
1202 /*---------------------------------------------.
1203 | yyoverflowab -- parser overflow comes here. |
1204 `---------------------------------------------*/
1206 yyerror ("parser stack overflow");
1213 YYSTACK_FREE (yyss);
1219 m4_if(b4_defines_flag, 0, [],
1220 [#output "b4_output_header_name"
1221 #ifndef b4_header_guard
1222 # define b4_header_guard
1224 b4_token_defines(b4_tokens)
1227 m4_ifdef([b4_stype_line],
1228 [#line b4_stype_line "b4_filename"
1232 # define YYSTYPE yystype
1236 [extern YYSTYPE b4_prefix[]lval;])
1238 m4_if(b4_locations_flag, [0], [],
1240 typedef struct yyltype
1247 # define YYLTYPE yyltype
1251 [extern YYLTYPE b4_prefix[]lloc;])
1253 #endif /* not b4_header_guard */