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])])
41 # b4_location_if(IF-TRUE, IF-FALSE)
42 # ---------------------------------
43 # Expand IF-TRUE, if locations are used, IF-FALSE otherwise.
44 m4_define([b4_location_if],
45 [m4_if(b4_locations_flag, [1],
53 m4_define([b4_lhs_location],
57 # b4_rhs_location(RULE-LENGTH, NUM)
58 # ---------------------------------
59 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
61 m4_define([b4_rhs_location],
62 [yylsp@<:@m4_eval([$2 - $1])@:>@])
66 ## ------------------- ##
67 ## Output file names. ##
68 ## ------------------- ##
70 m4_define_default([b4_input_suffix], [.y])
72 m4_define_default([b4_output_parser_suffix],
73 [m4_translit(b4_input_suffix, [yY], [cC])])
75 m4_define_default([b4_output_parser_name],
76 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])
79 m4_define_default([b4_output_header_suffix],
80 [m4_translit(b4_input_suffix, [yY], [hH])])
82 m4_define_default([b4_output_header_name],
83 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])
85 m4_define_default([b4_header_guard],
86 [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
87 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
90 ## ------------------------- ##
91 ## Assigning token numbers. ##
92 ## ------------------------- ##
94 # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
95 # -----------------------------------------
96 # Output the definition of this token as #define.
97 m4_define([b4_token_define],
102 # b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
103 # ---------------------------------------
104 # Output the definition of this token as an enum.
105 m4_define([b4_token_enum],
109 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
110 # -------------------------------------------------------
111 # Output the definition of the tokens (if there are) as enums and #define.
112 m4_define([b4_token_defines],
113 [m4_if([$@], [[]], [],
116 # if defined (__STDC__) || defined (__cplusplus)
117 /* Put the tokens into the symbol table, so that GDB and other debuggers
120 m4_map_sep([ b4_token_enum], [,
125 /* POSIX requires `int' for tokens in interfaces. */
126 # define YYTOKENTYPE int
127 #endif /* !YYTOKENTYPE */
128 m4_map([b4_token_define], [$@])
134 #output "b4_output_parser_name"
135 /* A Bison parser, made from b4_filename
136 by GNU bison b4_version. */
138 /* Skeleton output parser for Bison,
139 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
142 This program is free software; you can redistribute it and/or modify
143 it under the terms of the GNU General Public License as published by
144 the Free Software Foundation; either version 2, or (at your option)
147 This program is distributed in the hope that it will be useful,
148 but WITHOUT ANY WARRANTY; without even the implied warranty of
149 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
150 GNU General Public License for more details.
152 You should have received a copy of the GNU General Public License
153 along with this program; if not, write to the Free Software
154 Foundation, Inc., 59 Temple Place - Suite 330,
155 Boston, MA 02111-1307, USA. */
157 /* As a special exception, when this file is copied by Bison into a
158 Bison output file, you may use that output file without restriction.
159 This special exception was added by the Free Software Foundation
160 in version 1.24 of Bison. */
162 /* This is the parser code that is written into each bison parser when
163 the %semantic_parser declaration is not specified in the grammar.
164 It was written by Richard Stallman by simplifying the original so
165 called ``semantic'' parser. */
167 /* All symbols defined below should begin with yy or YY, to avoid
168 infringing on user name space. This should be done even for local
169 variables, as they might otherwise be expanded by user macros.
170 There are some unavoidable exceptions within include files to
171 define necessary library symbols; they are noted "INFRINGES ON
172 USER NAME SPACE" below. */
174 /* Identify Bison output. */
178 #define YYPURE b4_pure
180 /* Using locations. */
181 #define YYLSP_NEEDED b4_locations_flag
183 m4_if(b4_prefix[], [yy], [],
184 [/* If NAME_PREFIX is specified substitute the variables and functions
186 #define yyparse b4_prefix[]parse
187 #define yylex b4_prefix[]lex
188 #define yyerror b4_prefix[]error
189 #define yylval b4_prefix[]lval
190 #define yychar b4_prefix[]char
191 #define yydebug b4_prefix[]debug
192 #define yynerrs b4_prefix[]nerrs
193 b4_location_if([#define yylloc b4_prefix[]lloc])])
195 /* Copy the first part of user declarations. */
198 b4_token_defines(b4_tokens)
200 /* Enabling traces. */
202 # define YYDEBUG b4_debug
205 /* Enabling verbose error messages. */
206 #ifdef YYERROR_VERBOSE
207 # undef YYERROR_VERBOSE
208 # define YYERROR_VERBOSE 1
210 # define YYERROR_VERBOSE b4_error_verbose
215 [#line b4_stype_line "b4_filename"
216 typedef union b4_stype yystype;
217 /* Line __line__ of __file__. */
218 #line __oline__ "__ofile__"],
219 [typedef int yystype;])
220 # define YYSTYPE yystype
221 # define YYSTYPE_IS_TRIVIAL 1
225 typedef struct yyltype
232 # define YYLTYPE b4_ltype
233 # define YYLTYPE_IS_TRIVIAL 1
236 /* Copy the second part of user declarations. */
239 /* Line __line__ of __file__. */
240 #line __oline__ "__ofile__"
242 #if ! defined (yyoverflow) || YYERROR_VERBOSE
244 /* The parser invokes alloca or malloc; define the necessary symbols. */
246 # if YYSTACK_USE_ALLOCA
247 # define YYSTACK_ALLOC alloca
249 # ifndef YYSTACK_USE_ALLOCA
250 # if defined (alloca) || defined (_ALLOCA_H)
251 # define YYSTACK_ALLOC alloca
254 # define YYSTACK_ALLOC __builtin_alloca
260 # ifdef YYSTACK_ALLOC
261 /* Pacify GCC's `empty if-body' warning. */
262 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
264 # if defined (__STDC__) || defined (__cplusplus)
265 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
266 # define YYSIZE_T size_t
268 # define YYSTACK_ALLOC malloc
269 # define YYSTACK_FREE free
271 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
274 #if (! defined (yyoverflow) \
275 && (! defined (__cplusplus) \
276 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
278 /* A type that is properly aligned for any stack member. */
283 b4_location_if([ YYLTYPE yyls;
287 /* The size of the maximum gap between one aligned stack and the next. */
288 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
290 /* The size of an array large to enough to hold all stacks, each with
293 [# define YYSTACK_BYTES(N) \
294 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
295 + 2 * YYSTACK_GAP_MAX)],
296 [# define YYSTACK_BYTES(N) \
297 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
300 /* Copy COUNT objects from FROM to TO. The source and destination do
304 # define YYCOPY(To, From, Count) \
305 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
307 # define YYCOPY(To, From, Count) \
310 register YYSIZE_T yyi; \
311 for (yyi = 0; yyi < (Count); yyi++) \
312 (To)[[yyi]] = (From)[[yyi]]; \
318 /* Relocate STACK from its old location to the new one. The
319 local variables YYSIZE and YYSTACKSIZE give the old and new number of
320 elements in the stack, and YYPTR gives the new location of the
321 stack. Advance YYPTR to a properly aligned location for the next
323 # define YYSTACK_RELOCATE(Stack) \
326 YYSIZE_T yynewbytes; \
327 YYCOPY (&yyptr->Stack, Stack, yysize); \
328 Stack = &yyptr->Stack; \
329 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
330 yyptr += yynewbytes / sizeof (*yyptr); \
336 /* YYFINAL -- State number of the termination state. */
337 #define YYFINAL b4_final
338 #define YYFLAG b4_flag
339 #define YYLAST b4_last
341 /* YYNTOKENS -- Number of terminals. */
342 #define YYNTOKENS b4_ntokens
343 /* YYNNTS -- Number of nonterminals. */
344 #define YYNNTS b4_nnts
345 /* YYNRULES -- Number of rules. */
346 #define YYNRULES b4_nrules
347 /* YYNRULES -- Number of states. */
348 #define YYNSTATES b4_nstates
350 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
351 #define YYUNDEFTOK b4_undef_token_number
352 #define YYMAXUTOK b4_user_token_number_max
354 #define YYTRANSLATE(X) \
355 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
357 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
358 static const b4_uint_type(b4_translate_max) yytranslate[[]] =
364 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
366 static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
371 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
372 static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
377 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
378 static const b4_uint_type(b4_rline_max) yyrline[[]] =
384 #if YYDEBUG || YYERROR_VERBOSE
385 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
386 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
387 static const char *const yytname[[]] =
393 /* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to
395 static const short yytoknum[[]] =
400 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
401 static const b4_uint_type(b4_r1_max) yyr1[[]] =
406 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
407 static const b4_uint_type(b4_r2_max) yyr2[[]] =
412 /* YYDEFACT[[STATE-NAME]] -- Default rule to reduce with in state
413 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
414 means the default is an error. */
415 static const short yydefact[[]] =
420 /* YYPGOTO[[NTERM-NUM]]. */
421 static const short yydefgoto[[]] =
426 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
428 static const short yypact[[]] =
433 /* YYPGOTO[[NTERM-NUM]]. */
434 static const short yypgoto[[]] =
439 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
440 positive, shift that token. If negative, reduce the rule which
441 number is the opposite. If zero, do what YYDEFACT says. */
442 static const short yytable[[]] =
447 static const short yycheck[[]] =
452 /* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing
453 symbol of state STATE-NUM. */
454 static const b4_uint_type(b4_stos_max) yystos[[]] =
459 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
460 # define YYSIZE_T __SIZE_TYPE__
462 #if ! defined (YYSIZE_T) && defined (size_t)
463 # define YYSIZE_T size_t
465 #if ! defined (YYSIZE_T)
466 # if defined (__STDC__) || defined (__cplusplus)
467 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
468 # define YYSIZE_T size_t
471 #if ! defined (YYSIZE_T)
472 # define YYSIZE_T unsigned int
475 #define yyerrok (yyerrstatus = 0)
476 #define yyclearin (yychar = YYEMPTY)
480 #define YYACCEPT goto yyacceptlab
481 #define YYABORT goto yyabortlab
482 #define YYERROR goto yyerrlab1
484 /* Like YYERROR except do call yyerror. This remains here temporarily
485 to ease the transition to the new meaning of YYERROR, for GCC.
486 Once GCC version 2 has supplanted version 1, this can go. */
488 #define YYFAIL goto yyerrlab
490 #define YYRECOVERING() (!!yyerrstatus)
492 #define YYBACKUP(Token, Value) \
494 if (yychar == YYEMPTY && yylen == 1) \
498 yychar1 = YYTRANSLATE (yychar); \
504 yyerror ("syntax error: cannot back up"); \
510 #define YYERRCODE 256
512 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
515 #ifndef YYLLOC_DEFAULT
516 # define YYLLOC_DEFAULT(Current, Rhs, N) \
517 Current.first_line = Rhs[[1]].first_line; \
518 Current.first_column = Rhs[[1]].first_column; \
519 Current.last_line = Rhs[[N]].last_line; \
520 Current.last_column = Rhs[[N]].last_column;
523 /* YYLEX -- calling `yylex' with the right arguments. */
527 # define YYLEX yylex (&yylval, b4_location_if([&yylloc, ])YYLEX_PARAM)
529 # define YYLEX yylex (&yylval, b4_location_if([&yylloc, ]))
532 # define YYLEX yylex ()
535 /* Enable debugging if requested. */
539 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
540 # define YYFPRINTF fprintf
543 # define YYDPRINTF(Args) \
548 /* Nonzero means print parse trace. It is left uninitialized so that
549 multiple parsers can coexist. */
552 # define YYDPRINTF(Args)
553 #endif /* !YYDEBUG */
555 /* YYINITDEPTH -- initial size of the parser's stacks. */
557 # define YYINITDEPTH b4_initdepth
560 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
561 if the built-in stack extension method is used).
563 Do not make this value too large; the results are undefined if
564 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
565 evaluated with infinite-precision integer arithmetic. */
572 # define YYMAXDEPTH b4_maxdepth
580 # if defined (__GLIBC__) && defined (_STRING_H)
581 # define yystrlen strlen
583 /* Return the length of YYSTR. */
585 # if defined (__STDC__) || defined (__cplusplus)
586 yystrlen (const char *yystr)
592 register const char *yys = yystr;
594 while (*yys++ != '\0')
597 return yys - yystr - 1;
603 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
604 # define yystpcpy stpcpy
606 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
609 # if defined (__STDC__) || defined (__cplusplus)
610 yystpcpy (char *yydest, const char *yysrc)
612 yystpcpy (yydest, yysrc)
617 register char *yyd = yydest;
618 register const char *yys = yysrc;
620 while ((*yyd++ = *yys++) != '\0')
628 #endif /* !YYERROR_VERBOSE */
632 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
633 into yyparse. The argument should have type void *.
634 It should actually point to an object.
635 Grammar actions can access the variable by casting it
636 to the proper pointer type. */
639 # if defined (__STDC__) || defined (__cplusplus)
640 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
641 # define YYPARSE_PARAM_DECL
643 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
644 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
646 #else /* !YYPARSE_PARAM */
647 # define YYPARSE_PARAM_ARG
648 # define YYPARSE_PARAM_DECL
649 #endif /* !YYPARSE_PARAM */
651 /* Prevent warning if -Wstrict-prototypes. */
653 # ifdef YYPARSE_PARAM
654 int yyparse (void *);
659 static void yydestructor (int symbol_type, YYSTYPE symbol_value);
661 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
662 variables are global, or local to YYPARSE. */
664 #define YY_DECL_VARIABLES \
665 /* The lookahead symbol. */ \
668 /* The semantic value of the lookahead symbol. */ \
671 /* Number of parse errors so far. */ \
672 int yynerrs;b4_location_if([ \
673 /* Location data for the lookahead symbol. */ \
677 /* If nonreentrant, generate the variables here. */
684 yyparse (YYPARSE_PARAM_ARG)
687 /* If reentrant, generate the variables here. */
692 register int yystate;
695 /* Number of tokens to shift before error messages enabled. */
697 /* Lookahead token as an internal (translated) token number. */
700 /* Three stacks and their tools:
701 `yyss': related to states,
702 `yyvs': related to semantic values,
703 `yyls': related to locations.
705 Refer to the stacks thru separate pointers, to allow yyoverflow
706 to reallocate them elsewhere. */
708 /* The state stack. */
709 short yyssa[YYINITDEPTH];
711 register short *yyssp;
713 /* The semantic value stack. */
714 YYSTYPE yyvsa[YYINITDEPTH];
715 YYSTYPE *yyvs = yyvsa;
716 register YYSTYPE *yyvsp;
719 [[ /* The location stack. */
720 YYLTYPE yylsa[YYINITDEPTH];
721 YYLTYPE *yyls = yylsa;
724 #define YYPOPSTACK (yyvsp--, yyssp--]b4_location_if([, yylsp--])[)
726 YYSIZE_T yystacksize = YYINITDEPTH;
728 /* The variables used to return semantic value and location from the
731 ]b4_location_if([ YYLTYPE yyloc;])[
733 /* When reducing, the number of symbols on the RHS of the reduced
737 YYDPRINTF ((stderr, "Starting parse\n"));
742 yychar = YYEMPTY; /* Cause a token to be read. */
744 /* Initialize stack pointers.
745 Waste one element of value and location stack
746 so that they stay on the same level as the state stack.
747 The wasted elements are never initialized. */
751 ]b4_location_if([ yylsp = yyls;])[
754 /*------------------------------------------------------------.
755 | yynewstate -- Push a new state, which is found in yystate. |
756 `------------------------------------------------------------*/
758 /* In all cases, when you get here, the value and location stacks
759 have just been pushed. so pushing a state here evens the stacks.
766 if (yyssp >= yyss + yystacksize - 1)
768 /* Get the current used size of the three stacks, in elements. */
769 YYSIZE_T yysize = yyssp - yyss + 1;
773 /* Give user a chance to reallocate the stack. Use copies of
774 these so that the &'s don't force the real ones into
776 YYSTYPE *yyvs1 = yyvs;
778 ]b4_location_if([ YYLTYPE *yyls1 = yyls;])[
780 /* Each stack pointer address is followed by the size of the
781 data in use in that stack, in bytes. This used to be a
782 conditional around just the two extra args, but that might
783 be undefined if yyoverflow is a macro. */
784 yyoverflow ("parser stack overflow",
785 &yyss1, yysize * sizeof (*yyssp),
786 &yyvs1, yysize * sizeof (*yyvsp),
787 ]b4_location_if([ &yyls1, yysize * sizeof (*yylsp),])[
789 ]b4_location_if([ yyls = yyls1;])[
793 #else /* no yyoverflow */
794 # ifndef YYSTACK_RELOCATE
797 /* Extend the stack our own way. */
798 if (yystacksize >= YYMAXDEPTH)
801 if (yystacksize > YYMAXDEPTH)
802 yystacksize = YYMAXDEPTH;
806 union yyalloc *yyptr =
807 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
810 YYSTACK_RELOCATE (yyss);
811 YYSTACK_RELOCATE (yyvs);
812 ]b4_location_if([ YYSTACK_RELOCATE (yyls);])[
813 # undef YYSTACK_RELOCATE
815 YYSTACK_FREE (yyss1);
818 #endif /* no yyoverflow */
820 yyssp = yyss + yysize - 1;
821 yyvsp = yyvs + yysize - 1;
822 ]b4_location_if([ yylsp = yyls + yysize - 1;])[
824 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
825 (unsigned long int) yystacksize));
827 if (yyssp >= yyss + yystacksize - 1)
831 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
840 /* Do appropriate processing given the current state. */
841 /* Read a lookahead token if we need one and don't already have one. */
844 /* First try to decide what to do without reference to lookahead token. */
846 yyn = yypact[yystate];
850 /* Not known => get a lookahead token if don't already have one. */
852 /* yychar is either YYEMPTY or YYEOF
853 or a valid token in external form. */
855 if (yychar == YYEMPTY)
857 YYDPRINTF ((stderr, "Reading a token: "));
861 /* Convert token to internal form (in yychar1) for indexing tables with. */
863 if (yychar <= 0) /* This means end of input. */
866 yychar = YYEOF; /* Don't call YYLEX any more. */
868 YYDPRINTF ((stderr, "Now at end of input.\n"));
872 yychar1 = YYTRANSLATE (yychar);
875 /* We have to keep this `#if YYDEBUG', since we use variables
876 which are defined only if `YYDEBUG' is set. */
879 YYFPRINTF (stderr, "Next token is %d (%s",
880 yychar, yytname[yychar1]);
881 /* Give the individual parser a way to print the precise
882 meaning of a token, for further debugging info. */
884 YYPRINT (stderr, yychar, yylval);
886 YYFPRINTF (stderr, ")\n");
892 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
897 /* yyn is what to do for this token type in this state.
898 Negative => reduce, -yyn is rule number.
899 Positive => shift, yyn is new state.
900 New state is final state => don't bother to shift,
902 0, or most negative number => error. */
917 /* Shift the lookahead token. */
918 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
919 yychar, yytname[yychar1]));
921 /* Discard the token being shifted unless it is eof. */
926 ]b4_location_if([ *++yylsp = yylloc;])[
928 /* Count tokens shifted since error; after three, turn off error
937 /*-----------------------------------------------------------.
938 | yydefault -- do the default action for the current state. |
939 `-----------------------------------------------------------*/
941 yyn = yydefact[yystate];
947 /*-----------------------------.
948 | yyreduce -- Do a reduction. |
949 `-----------------------------*/
951 /* yyn is the number of a rule to reduce with. */
954 /* If YYLEN is nonzero, implement the default value of the action:
957 Otherwise, the following line sets YYVAL to the semantic value of
958 the lookahead token. This behavior is undocumented and Bison
959 users should not rely upon it. Assigning to YYVAL
960 unconditionally makes the parser a bit smaller, and it avoids a
961 GCC warning that YYVAL may be used uninitialized. */
962 yyval = yyvsp[1-yylen];
965 [ /* Default location. */
966 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);])[
969 /* We have to keep this `#if YYDEBUG', since we use variables which
970 are defined only if `YYDEBUG' is set. */
975 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
976 yyn - 1, yyrline[yyn]);
978 /* Print the symbols being reduced, and their result. */
979 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
980 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
981 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
989 /* Line __line__ of __file__. */
990 #line __oline__ "__ofile__"
994 ]b4_location_if([ yylsp -= yylen;])[
999 short *yyssp1 = yyss - 1;
1000 YYFPRINTF (stderr, "state stack now");
1001 while (yyssp1 != yyssp)
1002 YYFPRINTF (stderr, " %d", *++yyssp1);
1003 YYFPRINTF (stderr, "\n");
1008 ]b4_location_if([ *++yylsp = yyloc;])[
1010 /* Now `shift' the result of the reduction. Determine what state
1011 that goes to, based on the state we popped back to and the rule
1012 number reduced by. */
1016 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1017 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1018 yystate = yytable[yystate];
1020 yystate = yydefgoto[yyn - YYNTOKENS];
1025 /*------------------------------------.
1026 | yyerrlab -- here on detecting error |
1027 `------------------------------------*/
1029 /* If not already recovering from an error, report this error. */
1035 yyn = yypact[yystate];
1037 if (yyn > YYFLAG && yyn < YYLAST)
1039 YYSIZE_T yysize = 0;
1044 /* Start YYX at -YYN if negative to avoid negative indexes in
1046 for (yyx = yyn < 0 ? -yyn : 0;
1047 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1048 if (yycheck[yyx + yyn] == yyx)
1049 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1050 yysize += yystrlen ("parse error, unexpected ") + 1;
1051 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1052 yymsg = (char *) YYSTACK_ALLOC (yysize);
1055 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1056 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1061 for (yyx = yyn < 0 ? -yyn : 0;
1062 yyx < (int) (sizeof (yytname) / sizeof (char *));
1064 if (yycheck[yyx + yyn] == yyx)
1066 const char *yyq = ! yycount ? ", expecting " : " or ";
1067 yyp = yystpcpy (yyp, yyq);
1068 yyp = yystpcpy (yyp, yytname[yyx]);
1073 YYSTACK_FREE (yymsg);
1076 yyerror ("parse error; also virtual memory exhausted");
1079 #endif /* YYERROR_VERBOSE */
1080 yyerror ("parse error");
1085 /*----------------------------------------------------.
1086 | yyerrlab1 -- error raised explicitly by an action. |
1087 `----------------------------------------------------*/
1089 if (yyerrstatus == 3)
1091 /* If just tried and failed to reuse lookahead token after an
1092 error, discard it. */
1094 /* Return failure if at end of input. */
1095 if (yychar == YYEOF)
1097 /* Pop the error token. */
1099 /* Pop the rest of the stack. */
1100 while (yyssp > yyss)
1105 if (yystos[*yyssp] < YYNTOKENS)
1107 YYFPRINTF (stderr, "Error: popping token %d (%s",
1108 yytoknum[yystos[*yyssp]],
1109 yytname[yystos[*yyssp]]);
1111 YYPRINT (stderr, yytoknum[yystos[*yyssp]], *yyvsp);
1113 YYFPRINTF (stderr, ")\n");
1117 YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",
1118 yytname[yystos[*yyssp]]);
1122 yydestructor (yystos[*yyssp], *yyvsp);
1128 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1129 yychar, yytname[yychar1]));
1130 yydestructor (yychar1, yylval);
1134 /* Else will try to reuse lookahead token after shifting the error
1137 yyerrstatus = 3; /* Each real token shifted decrements this. */
1141 yyn = yypact[yystate];
1145 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1153 /* Pop the current state because it cannot handle the error token. */
1160 if (yystos[yystate] < YYNTOKENS)
1162 YYFPRINTF (stderr, "Error: popping token %d (%s",
1163 yytoknum[yystos[yystate]], yytname[yystos[yystate]]);
1165 YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp);
1167 YYFPRINTF (stderr, ")\n");
1171 YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",
1172 yytname[yystos[yystate]]);
1177 yydestructor (yystos[yystate], *yyvsp);
1180 ]b4_location_if([ yylsp--;])[
1185 short *yyssp1 = yyss - 1;
1186 YYFPRINTF (stderr, "Error: state stack now");
1187 while (yyssp1 != yyssp)
1188 YYFPRINTF (stderr, " %d", *++yyssp1);
1189 YYFPRINTF (stderr, "\n");
1197 YYDPRINTF ((stderr, "Shifting error token, "));
1200 ]b4_location_if([ *++yylsp = yylloc;])[
1206 /*-------------------------------------.
1207 | yyacceptlab -- YYACCEPT comes here. |
1208 `-------------------------------------*/
1213 /*-----------------------------------.
1214 | yyabortlab -- YYABORT comes here. |
1215 `-----------------------------------*/
1221 /*----------------------------------------------.
1222 | yyoverflowlab -- parser overflow comes here. |
1223 `----------------------------------------------*/
1225 yyerror ("parser stack overflow");
1233 YYSTACK_FREE (yyss);
1239 /*-------------------------------------------------.
1240 | Release the memory associated to SYMBOL-NUMBER. |
1241 `-------------------------------------------------*/
1243 m4_divert_push([KILL])# M4 code.
1244 # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
1245 # ----------------------------------------------------------
1246 m4_define([b4_symbol_destructor],
1247 [m4_pushdef([b4_dollar_dollar], [symbol_value.$6])dnl
1251 #line __oline__ "__ofile__"
1253 m4_popdef([b4_dollar_dollar])])
1255 m4_divert_pop([KILL])dnl# End of M4 code.
1257 yydestructor (int symbol_type, YYSTYPE symbol_value)
1259 switch (symbol_type)
1261 m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl
1263 YYDPRINTF ((stderr, "yydestructor: unknown symbol type: %d (%s)\n",
1264 symbol_type, yytname[[symbol_type]]));
1270 m4_if(b4_defines_flag, 0, [],
1271 [#output "b4_output_header_name"
1272 #ifndef b4_header_guard
1273 # define b4_header_guard
1275 b4_token_defines(b4_tokens)
1278 m4_ifdef([b4_stype],
1279 [#line b4_stype_line "b4_filename"
1280 typedef union b4_stype yystype;
1281 /* Line __line__ of __file__. */
1282 #line __oline__ "__ofile__"],
1283 [typedef int yystype;])
1284 # define YYSTYPE yystype
1288 [extern YYSTYPE b4_prefix[]lval;])
1292 typedef struct yyltype
1299 # define YYLTYPE yyltype
1303 [extern YYLTYPE b4_prefix[]lloc;])
1305 #endif /* not b4_header_guard */