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 ## ------------------------- ##
72 ## Assigning token numbers. ##
73 ## ------------------------- ##
75 # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
76 # -----------------------------------------
77 # Output the definition of this token as #define.
78 m4_define([b4_token_define],
83 # b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
84 # ---------------------------------------
85 # Output the definition of this token as an enum.
86 m4_define([b4_token_enum],
90 # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
91 # -------------------------------------------------------
92 # Output the definition of the tokens (if there are) as enums and #define.
93 m4_define([b4_token_defines],
94 [m4_if([$@], [[]], [],
97 # if defined (__STDC__) || defined (__cplusplus)
98 /* Put the tokens into the symbol table, so that GDB and other debuggers
101 m4_map_sep([ b4_token_enum], [,
106 /* POSIX requires `int' for tokens in interfaces. */
107 # define YYTOKENTYPE int
108 #endif /* !YYTOKENTYPE */
109 m4_map([b4_token_define], [$@])
115 #output "b4_output_parser_name"
116 /* A Bison parser, made from b4_filename
117 by GNU bison b4_version. */
119 /* Skeleton output parser for Bison,
120 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
123 This program is free software; you can redistribute it and/or modify
124 it under the terms of the GNU General Public License as published by
125 the Free Software Foundation; either version 2, or (at your option)
128 This program is distributed in the hope that it will be useful,
129 but WITHOUT ANY WARRANTY; without even the implied warranty of
130 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
131 GNU General Public License for more details.
133 You should have received a copy of the GNU General Public License
134 along with this program; if not, write to the Free Software
135 Foundation, Inc., 59 Temple Place - Suite 330,
136 Boston, MA 02111-1307, USA. */
138 /* As a special exception, when this file is copied by Bison into a
139 Bison output file, you may use that output file without restriction.
140 This special exception was added by the Free Software Foundation
141 in version 1.24 of Bison. */
143 /* This is the parser code that is written into each bison parser when
144 the %semantic_parser declaration is not specified in the grammar.
145 It was written by Richard Stallman by simplifying the original so
146 called ``semantic'' parser. */
148 /* All symbols defined below should begin with yy or YY, to avoid
149 infringing on user name space. This should be done even for local
150 variables, as they might otherwise be expanded by user macros.
151 There are some unavoidable exceptions within include files to
152 define necessary library symbols; they are noted "INFRINGES ON
153 USER NAME SPACE" below. */
155 /* Identify Bison output. */
159 #define YYPURE b4_pure
161 /* Using locations. */
162 #define YYLSP_NEEDED b4_locations_flag
164 m4_if(b4_prefix[], [yy], [],
165 [/* If NAME_PREFIX is specified substitute the variables and functions
167 #define yyparse b4_prefix[]parse
168 #define yylex b4_prefix[]lex
169 #define yyerror b4_prefix[]error
170 #define yylval b4_prefix[]lval
171 #define yychar b4_prefix[]char
172 #define yydebug b4_prefix[]debug
173 #define yynerrs b4_prefix[]nerrs
175 # define yylloc b4_prefix[]lloc
179 /* Copy the first part of user declarations. */
182 b4_token_defines(b4_tokens)
184 /* Enabling traces. */
186 # define YYDEBUG b4_debug
189 /* Enabling verbose error messages. */
190 #ifdef YYERROR_VERBOSE
191 # undef YYERROR_VERBOSE
192 # define YYERROR_VERBOSE 1
194 # define YYERROR_VERBOSE b4_error_verbose
199 [#line b4_stype_line "b4_filename"
200 typedef union b4_stype yystype;
201 /* Line __line__ of __file__. */
202 #line __oline__ "__ofile__"],
203 [typedef int yystype;])
204 # define YYSTYPE yystype
205 # define YYSTYPE_IS_TRIVIAL 1
209 typedef struct yyltype
216 # define YYLTYPE b4_ltype
217 # define YYLTYPE_IS_TRIVIAL 1
220 /* Copy the second part of user declarations. */
223 /* Line __line__ of __file__. */
224 #line __oline__ "__ofile__"
226 #if ! defined (yyoverflow) || YYERROR_VERBOSE
228 /* The parser invokes alloca or malloc; define the necessary symbols. */
230 # if YYSTACK_USE_ALLOCA
231 # define YYSTACK_ALLOC alloca
233 # ifndef YYSTACK_USE_ALLOCA
234 # if defined (alloca) || defined (_ALLOCA_H)
235 # define YYSTACK_ALLOC alloca
238 # define YYSTACK_ALLOC __builtin_alloca
244 # ifdef YYSTACK_ALLOC
245 /* Pacify GCC's `empty if-body' warning. */
246 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
248 # if defined (__STDC__) || defined (__cplusplus)
249 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
250 # define YYSIZE_T size_t
252 # define YYSTACK_ALLOC malloc
253 # define YYSTACK_FREE free
255 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
258 #if (! defined (yyoverflow) \
259 && (! defined (__cplusplus) \
260 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
262 /* A type that is properly aligned for any stack member. */
272 /* The size of the maximum gap between one aligned stack and the next. */
273 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
275 /* The size of an array large to enough to hold all stacks, each with
278 # define YYSTACK_BYTES(N) \
279 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
280 + 2 * YYSTACK_GAP_MAX)
282 # define YYSTACK_BYTES(N) \
283 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
287 /* Copy COUNT objects from FROM to TO. The source and destination do
291 # define YYCOPY(To, From, Count) \
292 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
294 # define YYCOPY(To, From, Count) \
297 register YYSIZE_T yyi; \
298 for (yyi = 0; yyi < (Count); yyi++) \
299 (To)[[yyi]] = (From)[[yyi]]; \
305 /* Relocate STACK from its old location to the new one. The
306 local variables YYSIZE and YYSTACKSIZE give the old and new number of
307 elements in the stack, and YYPTR gives the new location of the
308 stack. Advance YYPTR to a properly aligned location for the next
310 # define YYSTACK_RELOCATE(Stack) \
313 YYSIZE_T yynewbytes; \
314 YYCOPY (&yyptr->Stack, Stack, yysize); \
315 Stack = &yyptr->Stack; \
316 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
317 yyptr += yynewbytes / sizeof (*yyptr); \
323 /* YYFINAL -- State number of the termination state. */
324 #define YYFINAL b4_final
325 #define YYFLAG b4_flag
326 #define YYLAST b4_last
328 /* YYNTOKENS -- Number of terminals. */
329 #define YYNTOKENS b4_ntokens
330 /* YYNNTS -- Number of nonterminals. */
331 #define YYNNTS b4_nnts
332 /* YYNRULES -- Number of rules. */
333 #define YYNRULES b4_nrules
334 /* YYNRULES -- Number of states. */
335 #define YYNSTATES b4_nstates
337 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
338 #define YYUNDEFTOK b4_undef_token_number
339 #define YYMAXUTOK b4_user_token_number_max
341 #define YYTRANSLATE(X) \
342 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK)
344 /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */
345 static const b4_uint_type(b4_translate_max) yytranslate[[]] =
351 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
353 static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
358 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
359 static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
364 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
365 static const b4_uint_type(b4_rline_max) yyrline[[]] =
371 #if YYDEBUG || YYERROR_VERBOSE
372 /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
373 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
374 static const char *const yytname[[]] =
380 /* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to
382 static const short yytoknum[[]] =
387 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
388 static const b4_uint_type(b4_r1_max) yyr1[[]] =
393 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
394 static const b4_uint_type(b4_r2_max) yyr2[[]] =
399 /* YYDEFACT[[STATE-NAME]] -- Default rule to reduce with in state
400 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
401 means the default is an error. */
402 static const short yydefact[[]] =
407 /* YYPGOTO[[NTERM-NUM]]. */
408 static const short yydefgoto[[]] =
413 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
415 static const short yypact[[]] =
420 /* YYPGOTO[[NTERM-NUM]]. */
421 static const short yypgoto[[]] =
426 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
427 positive, shift that token. If negative, reduce the rule which
428 number is the opposite. If zero, do what YYDEFACT says. */
429 static const short yytable[[]] =
434 static const short yycheck[[]] =
439 /* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing
440 symbol of state STATE-NUM. */
441 static const b4_uint_type(b4_stos_max) yystos[[]] =
446 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
447 # define YYSIZE_T __SIZE_TYPE__
449 #if ! defined (YYSIZE_T) && defined (size_t)
450 # define YYSIZE_T size_t
452 #if ! defined (YYSIZE_T)
453 # if defined (__STDC__) || defined (__cplusplus)
454 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
455 # define YYSIZE_T size_t
458 #if ! defined (YYSIZE_T)
459 # define YYSIZE_T unsigned int
462 #define yyerrok (yyerrstatus = 0)
463 #define yyclearin (yychar = YYEMPTY)
467 #define YYACCEPT goto yyacceptlab
468 #define YYABORT goto yyabortlab
469 #define YYERROR goto yyerrlab1
471 /* Like YYERROR except do call yyerror. This remains here temporarily
472 to ease the transition to the new meaning of YYERROR, for GCC.
473 Once GCC version 2 has supplanted version 1, this can go. */
475 #define YYFAIL goto yyerrlab
477 #define YYRECOVERING() (!!yyerrstatus)
479 #define YYBACKUP(Token, Value) \
481 if (yychar == YYEMPTY && yylen == 1) \
485 yychar1 = YYTRANSLATE (yychar); \
491 yyerror ("syntax error: cannot back up"); \
497 #define YYERRCODE 256
499 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
502 #ifndef YYLLOC_DEFAULT
503 # define YYLLOC_DEFAULT(Current, Rhs, N) \
504 Current.first_line = Rhs[[1]].first_line; \
505 Current.first_column = Rhs[[1]].first_column; \
506 Current.last_line = Rhs[[N]].last_line; \
507 Current.last_column = Rhs[[N]].last_column;
510 /* YYLEX -- calling `yylex' with the right arguments. */
515 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
517 # define YYLEX yylex (&yylval, &yylloc)
519 # else /* !YYLSP_NEEDED */
521 # define YYLEX yylex (&yylval, YYLEX_PARAM)
523 # define YYLEX yylex (&yylval)
525 # endif /* !YYLSP_NEEDED */
527 # define YYLEX yylex ()
530 /* Enable debugging if requested. */
534 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
535 # define YYFPRINTF fprintf
538 # define YYDPRINTF(Args) \
543 /* Nonzero means print parse trace. It is left uninitialized so that
544 multiple parsers can coexist. */
547 # define YYDPRINTF(Args)
548 #endif /* !YYDEBUG */
550 /* YYINITDEPTH -- initial size of the parser's stacks. */
552 # define YYINITDEPTH b4_initdepth
555 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
556 if the built-in stack extension method is used).
558 Do not make this value too large; the results are undefined if
559 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
560 evaluated with infinite-precision integer arithmetic. */
567 # define YYMAXDEPTH b4_maxdepth
575 # if defined (__GLIBC__) && defined (_STRING_H)
576 # define yystrlen strlen
578 /* Return the length of YYSTR. */
580 # if defined (__STDC__) || defined (__cplusplus)
581 yystrlen (const char *yystr)
587 register const char *yys = yystr;
589 while (*yys++ != '\0')
592 return yys - yystr - 1;
598 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
599 # define yystpcpy stpcpy
601 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
604 # if defined (__STDC__) || defined (__cplusplus)
605 yystpcpy (char *yydest, const char *yysrc)
607 yystpcpy (yydest, yysrc)
612 register char *yyd = yydest;
613 register const char *yys = yysrc;
615 while ((*yyd++ = *yys++) != '\0')
623 #endif /* !YYERROR_VERBOSE */
627 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
628 into yyparse. The argument should have type void *.
629 It should actually point to an object.
630 Grammar actions can access the variable by casting it
631 to the proper pointer type. */
634 # if defined (__STDC__) || defined (__cplusplus)
635 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
636 # define YYPARSE_PARAM_DECL
638 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
639 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
641 #else /* !YYPARSE_PARAM */
642 # define YYPARSE_PARAM_ARG
643 # define YYPARSE_PARAM_DECL
644 #endif /* !YYPARSE_PARAM */
646 /* Prevent warning if -Wstrict-prototypes. */
648 # ifdef YYPARSE_PARAM
649 int yyparse (void *);
654 static void yydestructor (int symbol_type, YYSTYPE symbol_value);
656 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
657 variables are global, or local to YYPARSE. */
659 #define YY_DECL_NON_LSP_VARIABLES \
660 /* The lookahead symbol. */ \
663 /* The semantic value of the lookahead symbol. */ \
666 /* Number of parse errors so far. */ \
670 # define YY_DECL_VARIABLES \
671 YY_DECL_NON_LSP_VARIABLES \
673 /* Location data for the lookahead symbol. */ \
676 # define YY_DECL_VARIABLES \
677 YY_DECL_NON_LSP_VARIABLES
680 /* If nonreentrant, generate the variables here. */
687 yyparse (YYPARSE_PARAM_ARG)
690 /* If reentrant, generate the variables here. */
695 register int yystate;
698 /* Number of tokens to shift before error messages enabled. */
700 /* Lookahead token as an internal (translated) token number. */
703 /* Three stacks and their tools:
704 `yyss': related to states,
705 `yyvs': related to semantic values,
706 `yyls': related to locations.
708 Refer to the stacks thru separate pointers, to allow yyoverflow
709 to reallocate them elsewhere. */
711 /* The state stack. */
712 short yyssa[YYINITDEPTH];
714 register short *yyssp;
716 /* The semantic value stack. */
717 YYSTYPE yyvsa[YYINITDEPTH];
718 YYSTYPE *yyvs = yyvsa;
719 register YYSTYPE *yyvsp;
722 /* The location stack. */
723 YYLTYPE yylsa[YYINITDEPTH];
724 YYLTYPE *yyls = yylsa;
729 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
731 # define YYPOPSTACK (yyvsp--, yyssp--)
734 YYSIZE_T yystacksize = YYINITDEPTH;
736 /* The variables used to return semantic value and location from the
743 /* When reducing, the number of symbols on the RHS of the reduced
747 YYDPRINTF ((stderr, "Starting parse\n"));
752 yychar = YYEMPTY; /* Cause a token to be read. */
754 /* Initialize stack pointers.
755 Waste one element of value and location stack
756 so that they stay on the same level as the state stack.
757 The wasted elements are never initialized. */
766 /*------------------------------------------------------------.
767 | yynewstate -- Push a new state, which is found in yystate. |
768 `------------------------------------------------------------*/
770 /* In all cases, when you get here, the value and location stacks
771 have just been pushed. so pushing a state here evens the stacks.
778 if (yyssp >= yyss + yystacksize - 1)
780 /* Get the current used size of the three stacks, in elements. */
781 YYSIZE_T yysize = yyssp - yyss + 1;
785 /* Give user a chance to reallocate the stack. Use copies of
786 these so that the &'s don't force the real ones into
788 YYSTYPE *yyvs1 = yyvs;
791 /* Each stack pointer address is followed by the size of the
792 data in use in that stack, in bytes. */
794 YYLTYPE *yyls1 = yyls;
795 /* This used to be a conditional around just the two extra args,
796 but that might be undefined if yyoverflow is a macro. */
797 yyoverflow ("parser stack overflow",
798 &yyss1, yysize * sizeof (*yyssp),
799 &yyvs1, yysize * sizeof (*yyvsp),
800 &yyls1, yysize * sizeof (*yylsp),
804 yyoverflow ("parser stack overflow",
805 &yyss1, yysize * sizeof (*yyssp),
806 &yyvs1, yysize * sizeof (*yyvsp),
812 #else /* no yyoverflow */
813 # ifndef YYSTACK_RELOCATE
816 /* Extend the stack our own way. */
817 if (yystacksize >= YYMAXDEPTH)
820 if (yystacksize > YYMAXDEPTH)
821 yystacksize = YYMAXDEPTH;
825 union yyalloc *yyptr =
826 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
829 YYSTACK_RELOCATE (yyss);
830 YYSTACK_RELOCATE (yyvs);
832 YYSTACK_RELOCATE (yyls);
834 # undef YYSTACK_RELOCATE
836 YYSTACK_FREE (yyss1);
839 #endif /* no yyoverflow */
841 yyssp = yyss + yysize - 1;
842 yyvsp = yyvs + yysize - 1;
844 yylsp = yyls + yysize - 1;
847 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
848 (unsigned long int) yystacksize));
850 if (yyssp >= yyss + yystacksize - 1)
854 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
863 /* Do appropriate processing given the current state. */
864 /* Read a lookahead token if we need one and don't already have one. */
867 /* First try to decide what to do without reference to lookahead token. */
869 yyn = yypact[yystate];
873 /* Not known => get a lookahead token if don't already have one. */
875 /* yychar is either YYEMPTY or YYEOF
876 or a valid token in external form. */
878 if (yychar == YYEMPTY)
880 YYDPRINTF ((stderr, "Reading a token: "));
884 /* Convert token to internal form (in yychar1) for indexing tables with. */
886 if (yychar <= 0) /* This means end of input. */
889 yychar = YYEOF; /* Don't call YYLEX any more. */
891 YYDPRINTF ((stderr, "Now at end of input.\n"));
895 yychar1 = YYTRANSLATE (yychar);
898 /* We have to keep this `#if YYDEBUG', since we use variables
899 which are defined only if `YYDEBUG' is set. */
902 YYFPRINTF (stderr, "Next token is %d (%s",
903 yychar, yytname[yychar1]);
904 /* Give the individual parser a way to print the precise
905 meaning of a token, for further debugging info. */
907 YYPRINT (stderr, yychar, yylval);
909 YYFPRINTF (stderr, ")\n");
915 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
920 /* yyn is what to do for this token type in this state.
921 Negative => reduce, -yyn is rule number.
922 Positive => shift, yyn is new state.
923 New state is final state => don't bother to shift,
925 0, or most negative number => error. */
940 /* Shift the lookahead token. */
941 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
942 yychar, yytname[yychar1]));
944 /* Discard the token being shifted unless it is eof. */
953 /* Count tokens shifted since error; after three, turn off error
962 /*-----------------------------------------------------------.
963 | yydefault -- do the default action for the current state. |
964 `-----------------------------------------------------------*/
966 yyn = yydefact[yystate];
972 /*-----------------------------.
973 | yyreduce -- Do a reduction. |
974 `-----------------------------*/
976 /* yyn is the number of a rule to reduce with. */
979 /* If YYLEN is nonzero, implement the default value of the action:
982 Otherwise, the following line sets YYVAL to the semantic value of
983 the lookahead token. This behavior is undocumented and Bison
984 users should not rely upon it. Assigning to YYVAL
985 unconditionally makes the parser a bit smaller, and it avoids a
986 GCC warning that YYVAL may be used uninitialized. */
987 yyval = yyvsp[1-yylen];
990 /* Default location. */
991 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
995 /* We have to keep this `#if YYDEBUG', since we use variables which
996 are defined only if `YYDEBUG' is set. */
1001 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1002 yyn - 1, yyrline[yyn]);
1004 /* Print the symbols being reduced, and their result. */
1005 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
1006 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1007 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1015 /* Line __line__ of __file__. */
1016 #line __oline__ "__ofile__"
1027 short *yyssp1 = yyss - 1;
1028 YYFPRINTF (stderr, "state stack now");
1029 while (yyssp1 != yyssp)
1030 YYFPRINTF (stderr, " %d", *++yyssp1);
1031 YYFPRINTF (stderr, "\n");
1040 /* Now `shift' the result of the reduction. Determine what state
1041 that goes to, based on the state we popped back to and the rule
1042 number reduced by. */
1046 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1047 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1048 yystate = yytable[yystate];
1050 yystate = yydefgoto[yyn - YYNTOKENS];
1055 /*------------------------------------.
1056 | yyerrlab -- here on detecting error |
1057 `------------------------------------*/
1059 /* If not already recovering from an error, report this error. */
1065 yyn = yypact[yystate];
1067 if (yyn > YYFLAG && yyn < YYLAST)
1069 YYSIZE_T yysize = 0;
1074 /* Start YYX at -YYN if negative to avoid negative indexes in
1076 for (yyx = yyn < 0 ? -yyn : 0;
1077 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1078 if (yycheck[yyx + yyn] == yyx)
1079 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1080 yysize += yystrlen ("parse error, unexpected ") + 1;
1081 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1082 yymsg = (char *) YYSTACK_ALLOC (yysize);
1085 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1086 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1091 for (yyx = yyn < 0 ? -yyn : 0;
1092 yyx < (int) (sizeof (yytname) / sizeof (char *));
1094 if (yycheck[yyx + yyn] == yyx)
1096 const char *yyq = ! yycount ? ", expecting " : " or ";
1097 yyp = yystpcpy (yyp, yyq);
1098 yyp = yystpcpy (yyp, yytname[yyx]);
1103 YYSTACK_FREE (yymsg);
1106 yyerror ("parse error; also virtual memory exhausted");
1109 #endif /* YYERROR_VERBOSE */
1110 yyerror ("parse error");
1115 /*----------------------------------------------------.
1116 | yyerrlab1 -- error raised explicitly by an action. |
1117 `----------------------------------------------------*/
1119 if (yyerrstatus == 3)
1121 /* If just tried and failed to reuse lookahead token after an
1122 error, discard it. */
1124 /* Return failure if at end of input. */
1125 if (yychar == YYEOF)
1127 /* Pop the error token. */
1129 /* Pop the rest of the stack. */
1130 while (yyssp > yyss)
1135 if (yystos[*yyssp] < YYNTOKENS)
1137 YYFPRINTF (stderr, "Error: popping token %d (%s",
1138 yytoknum[yystos[*yyssp]],
1139 yytname[yystos[*yyssp]]);
1141 YYPRINT (stderr, yytoknum[yystos[*yyssp]], *yyvsp);
1143 YYFPRINTF (stderr, ")\n");
1147 YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",
1148 yytname[yystos[*yyssp]]);
1152 yydestructor (yystos[*yyssp], *yyvsp);
1158 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1159 yychar, yytname[yychar1]));
1160 yydestructor (yychar1, yylval);
1164 /* Else will try to reuse lookahead token after shifting the error
1167 yyerrstatus = 3; /* Each real token shifted decrements this. */
1171 yyn = yypact[yystate];
1175 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1183 /* Pop the current state because it cannot handle the error token. */
1190 if (yystos[yystate] < YYNTOKENS)
1192 YYFPRINTF (stderr, "Error: popping token %d (%s",
1193 yytoknum[yystos[yystate]], yytname[yystos[yystate]]);
1195 YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp);
1197 YYFPRINTF (stderr, ")\n");
1201 YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",
1202 yytname[yystos[yystate]]);
1207 yydestructor (yystos[yystate], *yyvsp);
1217 short *yyssp1 = yyss - 1;
1218 YYFPRINTF (stderr, "Error: state stack now");
1219 while (yyssp1 != yyssp)
1220 YYFPRINTF (stderr, " %d", *++yyssp1);
1221 YYFPRINTF (stderr, "\n");
1229 YYDPRINTF ((stderr, "Shifting error token, "));
1240 /*-------------------------------------.
1241 | yyacceptlab -- YYACCEPT comes here. |
1242 `-------------------------------------*/
1247 /*-----------------------------------.
1248 | yyabortlab -- YYABORT comes here. |
1249 `-----------------------------------*/
1255 /*---------------------------------------------.
1256 | yyoverflowab -- parser overflow comes here. |
1257 `---------------------------------------------*/
1259 yyerror ("parser stack overflow");
1267 YYSTACK_FREE (yyss);
1273 /*-------------------------------------------------.
1274 | Release the memory associated to SYMBOL-NUMBER. |
1275 `-------------------------------------------------*/
1277 m4_divert_push([KILL])# M4 code.
1280 # FIXME: This is really wrong, we no longer guarantee we don't evaluate
1281 # the user's input. This demonstrates that decoding actions (BRACED_CODE)
1282 # ought to be done when output, not when read.
1283 m4_define([b4_eval],
1286 # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
1287 # ----------------------------------------------------------
1288 m4_define([b4_symbol_destructor],
1289 [m4_pushdef([b4_dollar_dollar], [symbol_value.$6])dnl
1293 #line __oline__ "__ofile__"
1295 m4_popdef([b4_dollar_dollar])])
1297 m4_divert_pop([KILL])dnl# End of M4 code.
1299 yydestructor (int symbol_type, YYSTYPE symbol_value)
1301 switch (symbol_type)
1303 m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl
1305 YYDPRINTF ((stderr, "yydestructor: unknown symbol type: %d (%s)\n",
1306 symbol_type, yytname[[symbol_type]]));
1312 m4_if(b4_defines_flag, 0, [],
1313 [#output "b4_output_header_name"
1314 #ifndef b4_header_guard
1315 # define b4_header_guard
1317 b4_token_defines(b4_tokens)
1320 m4_ifdef([b4_stype],
1321 [#line b4_stype_line "b4_filename"
1322 typedef union b4_stype yystype;
1323 /* Line __line__ of __file__. */
1324 #line __oline__ "__ofile__"],
1325 [typedef int yystype;])
1326 # define YYSTYPE yystype
1330 [extern YYSTYPE b4_prefix[]lval;])
1332 m4_if(b4_locations_flag, [0], [],
1334 typedef struct yyltype
1341 # define YYLTYPE yyltype
1345 [extern YYLTYPE b4_prefix[]lloc;])
1347 #endif /* not b4_header_guard */