X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/be2a1a68efe93f7046f77b81346e4c740c14fb40..f25bfb75aa45ded96d5e8060a637d366c3a47924:/data/bison.simple diff --git a/data/bison.simple b/data/bison.simple index 80cf81ae..6059e160 100644 --- a/data/bison.simple +++ b/data/bison.simple @@ -1,10 +1,52 @@ -m4_divert(-1) +m4_divert(-1) -*- C -*- + +# b4_sint_type(MAX) +# ----------------- +# Return the smallest signed int type able to handle the number MAX. +m4_define([b4_sint_type], +[m4_if(m4_eval([$1 <= 127]), [1], [signed char], + m4_eval([$1 <= 32767]), [1], [signed short], + [signed int])]) + + +# b4_uint_type(MAX) +# ----------------- +# Return the smallest unsigned int type able to handle the number MAX. +m4_define([b4_uint_type], +[m4_if(m4_eval([$1 <= 255]), [1], [unsigned char], + m4_eval([$1 <= 65535]), [1], [unsigned short], + [unsigned int])]) + + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $$. +m4_define([b4_lhs_value], +[yyval[]m4_ifval([$1], [.$1])]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], +[yyvsp@<:@m4_eval([$2 - $1])@:>@m4_ifval([$3], [.$3])]) + + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], +[yyloc]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], +[yylsp@<:@m4_eval([$2 - $1])@:>@]) -# m4_define_default(MACRO, VALUE) -# ------------------------------- -# Define MACRO to VALUE, unless already defined. -m4_define([m4_define_default], -[m4_ifdef([$1], [], [m4_define($@)])]) m4_define_default([b4_input_suffix], [.y]) @@ -25,6 +67,50 @@ m4_define_default([b4_header_guard], [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name), [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])]) + +## ------------------------- ## +## Assigning token numbers. ## +## ------------------------- ## + +# b4_token_define(TOKEN-NAME, TOKEN-NUMBER) +# ----------------------------------------- +# Output the definition of this token as #define. +m4_define([b4_token_define], +[#define $1 $2 +]) + + +# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER) +# --------------------------------------- +# Output the definition of this token as an enum. +m4_define([b4_token_enum], +[$1 = $2]) + + +# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) +# ------------------------------------------------------- +# Output the definition of the tokens (if there are) as enums and #define. +m4_define([b4_token_defines], +[m4_if([$@], [[]], [], +[/* Tokens. */ +#ifndef YYTOKENTYPE +# if defined (__STDC__) || defined (__cplusplus) + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { +m4_map_sep([ b4_token_enum], [, +], + [$@]) + }; +# endif + /* POSIX requires `int' for tokens in interfaces. */ +# define YYTOKENTYPE int +#endif /* !YYTOKENTYPE */ +m4_map([b4_token_define], [$@]) +]) +]) + + m4_divert(0)dnl #output "b4_output_parser_name" /* A Bison parser, made from b4_filename @@ -56,8 +142,15 @@ m4_divert(0)dnl /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ + It was written by Richard Stallman by simplifying the original so + called ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 @@ -83,8 +176,10 @@ m4_if(b4_prefix[], [yy], [], #endif ]) -/* Copy the user declarations. */ -b4_prologue +/* Copy the first part of user declarations. */ +b4_pre_prologue + +b4_token_defines(b4_tokens) /* Enabling traces. */ #ifndef YYDEBUG @@ -100,8 +195,14 @@ b4_prologue #endif #ifndef YYSTYPE -typedef b4_stype yystype; +m4_ifdef([b4_stype], +[#line b4_stype_line "b4_filename" +typedef union b4_stype yystype; +/* Line __line__ of __file__. */ +#line __oline__ "__ofile__"], +[typedef int yystype;]) # define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 #endif #ifndef YYLTYPE @@ -113,25 +214,16 @@ typedef struct yyltype int last_column; } yyltype; # define YYLTYPE b4_ltype +# define YYLTYPE_IS_TRIVIAL 1 #endif -/* Line __line__ of __file__. */ -#line __oline__ "b4_output_parser_name" - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ +/* Copy the second part of user declarations. */ +b4_post_prologue -#ifdef __cplusplus -# define YYSTD(x) std::x -#else -# define YYSTD(x) x -#endif +/* Line __line__ of __file__. */ +#line __oline__ "__ofile__" -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) +#if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -153,18 +245,19 @@ typedef struct yyltype /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else -# ifdef __cplusplus -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T std::size_t -# else -# ifdef __STDC__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # endif -# define YYSTACK_ALLOC YYSTD (malloc) -# define YYSTACK_FREE YYSTD (free) +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free # endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -183,35 +276,49 @@ union yyalloc N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) # endif -/* Relocate the TYPE STACK from its old location to the new one. The +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[[yyi]] = (From)[[yyi]]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Type, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - yymemcpy ((char *) yyptr, (char *) (Stack), \ - yysize * (YYSIZE_T) sizeof (Type)); \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - -/* Tokens. */ -b4_tokendef +#endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL b4_final @@ -226,13 +333,16 @@ b4_tokendef #define YYNRULES b4_nrules /* YYNRULES -- Number of states. */ #define YYNSTATES b4_nstates -#define YYMAXUTOK b4_maxtok /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= b4_maxtok ? yytranslate[[x]] : b4_nsym) +#define YYUNDEFTOK b4_undef_token_number +#define YYMAXUTOK b4_user_token_number_max + +#define YYTRANSLATE(X) \ + ((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK) /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */ -static const char yytranslate[[]] = +static const b4_uint_type(b4_translate_max) yytranslate[[]] = { b4_translate }; @@ -240,25 +350,25 @@ static const char yytranslate[[]] = #if YYDEBUG /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const short yyprhs[[]] = +static const b4_uint_type(b4_prhs_max) yyprhs[[]] = { b4_prhs }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[[]] = +static const b4_sint_type(b4_rhs_max) yyrhs[[]] = { b4_rhs }; /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */ -static const short yyrline[[]] = +static const b4_uint_type(b4_rline_max) yyrline[[]] = { b4_rline }; #endif -#if (YYDEBUG) || YYERROR_VERBOSE +#if YYDEBUG || YYERROR_VERBOSE /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[[]] = @@ -267,27 +377,28 @@ static const char *const yytname[[]] = }; #endif -/* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */ +/* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to + token YYLEX-NUM. */ static const short yytoknum[[]] = { b4_toknum }; /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[[]] = +static const b4_uint_type(b4_r1_max) yyr1[[]] = { b4_r1 }; /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[[]] = +static const b4_uint_type(b4_r2_max) yyr2[[]] = { b4_r2 }; -/* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ +/* YYDEFACT[[STATE-NAME]] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ static const short yydefact[[]] = { b4_defact @@ -325,6 +436,12 @@ static const short yycheck[[]] = b4_check }; +/* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const b4_uint_type(b4_stos_max) yystos[[]] = +{ + b4_stos +}; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -333,14 +450,9 @@ static const short yycheck[[]] = # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) -# ifdef __cplusplus -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T std::size_t -# else -# ifdef __STDC__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) @@ -385,16 +497,14 @@ while (0) #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ + are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[[N]].last_line; \ - Current.last_column = Rhs[[N]].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.first_line = Rhs[[1]].first_line; \ + Current.first_column = Rhs[[1]].first_column; \ + Current.last_line = Rhs[[N]].last_line; \ + Current.last_column = Rhs[[N]].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ @@ -421,12 +531,8 @@ while (0) #if YYDEBUG # ifndef YYFPRINTF -# ifdef __cplusplus -# include /* INFRINGES ON USER NAME SPACE */ -# else -# include /* INFRINGES ON USER NAME SPACE */ -# endif -# define YYFPRINTF YYSTD (fprintf) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ @@ -434,8 +540,8 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) -/* Nonzero means print parse trace. Since this is uninitialized, it - does not stop multiple parsers from coexisting. */ +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) @@ -463,33 +569,6 @@ int yydebug; -#if ! defined (yyoverflow) && ! defined (yymemcpy) -# if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -# define yymemcpy __builtin_memcpy -# else /* not GNU C or C++ */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -# if defined (__STDC__) || defined (__cplusplus) -yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount) -# else -yymemcpy (yyto, yyfrom, yycount) - char *yyto; - const char *yyfrom; - YYSIZE_T yycount; -# endif -{ - register const char *yyf = yyfrom; - register char *yyt = yyto; - register YYSIZE_T yyi = yycount; - - while (yyi-- != 0) - *yyt++ = *yyf++; -} -# endif -#endif - #if YYERROR_VERBOSE # ifndef yystrlen @@ -552,13 +631,13 @@ yystpcpy (yydest, yysrc) to the proper pointer type. */ #ifdef YYPARSE_PARAM -# ifdef __cplusplus +# if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL -# else /* !__cplusplus */ +# else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -# endif /* !__cplusplus */ +# endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL @@ -572,6 +651,7 @@ int yyparse (void *); int yyparse (void); # endif #endif +static void yydestructor (int symbol_type, YYSTYPE symbol_value); /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ @@ -730,6 +810,9 @@ yyparse (YYPARSE_PARAM_ARG) yyvs = yyvs1; } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; @@ -743,15 +826,16 @@ yyparse (YYPARSE_PARAM_ARG) (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; - YYSTACK_RELOCATE (short, yyss); - YYSTACK_RELOCATE (YYSTYPE, yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (YYLTYPE, yyls); -# endif -# undef YYSTACK_RELOCATE + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); +# if YYLSP_NEEDED + YYSTACK_RELOCATE (yyls); +# endif +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } +# endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; @@ -903,9 +987,7 @@ yyreduce: yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; + /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif @@ -931,7 +1013,7 @@ yyreduce: } /* Line __line__ of __file__. */ -#line __oline__ "b4_output_parser_name" +#line __oline__ "__ofile__" [ yyvsp -= yylen; yyssp -= yylen; @@ -1041,82 +1123,105 @@ yyerrlab1: /* Return failure if at end of input. */ if (yychar == YYEOF) - YYABORT; + { + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyssp > yyss) + { +#if YYDEBUG + if (yydebug) + { + if (yystos[*yyssp] < YYNTOKENS) + { + YYFPRINTF (stderr, "Error: popping token %d (%s", + yytoknum[yystos[*yyssp]], + yytname[yystos[*yyssp]]); +# ifdef YYPRINT + YYPRINT (stderr, yytoknum[yystos[*yyssp]], *yyvsp); +# endif + YYFPRINTF (stderr, ")\n"); + } + else + { + YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n", + yytname[yystos[*yyssp]]); + } + } +#endif + yydestructor (yystos[*yyssp], *yyvsp); + YYPOPSTACK; + } + YYABORT; + } + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); + yydestructor (yychar1, yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - goto yyerrhandle; + yyerrstatus = 3; /* Each real token shifted decrements this. */ + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYFLAG) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; +#if YYDEBUG + if (yydebug) + { + if (yystos[yystate] < YYNTOKENS) + { + YYFPRINTF (stderr, "Error: popping token %d (%s", + yytoknum[yystos[yystate]], yytname[yystos[yystate]]); +# ifdef YYPRINT + YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp); +# endif + YYFPRINTF (stderr, ")\n"); + } + else + { + YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n", + yytname[yystos[yystate]]); + } + } #endif - -/*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token. | -`---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; + yydestructor (yystos[yystate], *yyvsp); + yyvsp--; + yystate = *--yyssp; #if YYLSP_NEEDED - yylsp--; + yylsp--; #endif #if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } #endif - -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; @@ -1146,13 +1251,15 @@ yyabortlab: yyresult = 1; goto yyreturn; -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ +#endif yyreturn: #ifndef yyoverflow @@ -1162,17 +1269,52 @@ yyreturn: return yyresult; ]} + +/*-------------------------------------------------. +| Release the memory associated to SYMBOL-NUMBER. | +`-------------------------------------------------*/ + +m4_divert_push([KILL])# M4 code. +# b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME) +# ---------------------------------------------------------- +m4_define([b4_symbol_destructor], +[m4_pushdef([b4_dollar_dollar], [symbol_value.$6])dnl + case $4: /* $3 */ +#line $2 "$1" + $5; +#line __oline__ "__ofile__" + break; +m4_popdef([b4_dollar_dollar])]) + +m4_divert_pop([KILL])dnl# End of M4 code. +static void +yydestructor (int symbol_type, YYSTYPE symbol_value) +{ + switch (symbol_type) + { +m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl + default: + YYDPRINTF ((stderr, "yydestructor: unknown symbol type: %d (%s)\n", + symbol_type, yytname[[symbol_type]])); + break; + } +} + b4_epilogue m4_if(b4_defines_flag, 0, [], [#output "b4_output_header_name" #ifndef b4_header_guard # define b4_header_guard -b4_tokendef +b4_token_defines(b4_tokens) #ifndef YYSTYPE -typedef b4_stype -yystype; +m4_ifdef([b4_stype], +[#line b4_stype_line "b4_filename" +typedef union b4_stype yystype; +/* Line __line__ of __file__. */ +#line __oline__ "__ofile__"], +[typedef int yystype;]) # define YYSTYPE yystype #endif