-*- C -*-
-
# Yacc compatible skeleton for Bison
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
# 2007, 2008 Free Software Foundation, Inc.
+m4_pushdef([b4_copyright_years],
+[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008])
+
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# --------------------
# Expansion of $<TYPE>$.
m4_define([b4_lhs_value],
-[(yyval[]m4_ifval([$1], [.$1]))])
+[b4_symbol_value(yyval, [$1])])
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
# symbols on RHS.
m4_define([b4_rhs_value],
-[(yyvsp@{($2) - ($1)@}m4_ifval([$3], [.$3]))])
+[b4_symbol_value([yyvsp@{($2) - ($1)@}], [$3])])
# We do want M4 expansion after # for CPP macros.
m4_changecom()
m4_divert_push(0)dnl
-@output(b4_parser_file_name@)
-b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
- [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])[
+@output(b4_parser_file_name@)@
+b4_copyright([Implementation for Bison's Yacc-like parsers in C])dnl'
+[
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
#define YYNNTS ]b4_nterms_number[
/* YYNRULES -- Number of rules. */
#define YYNRULES ]b4_rules_number[
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES ]b4_states_number[
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK ]b4_undef_token_number[
#define YYMAXUTOK ]b4_user_token_number_max[
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
{
]b4_translate[
#endif
# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
{
]b4_toknum[
int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
- YYSTYPE yyval;
-]b4_locations_if([[ YYLTYPE yyloc;
-]])[
+ YYSTYPE yyval;]b4_locations_if([[
+ YYLTYPE yyloc;]])[
+
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
- int yylen = 0;
-]b4_push_if([[
+ int yylen = 0;]b4_push_if([[
+
if (!yyps->yynew)
{
yyn = yypact[yystate];
goto yyread_pushed_token;
- }
-]])[
+ }]])[
+
yytoken = 0;
yyss = yyssa;
- yyvs = yyvsa;
-]b4_locations_if([[ yyls = yylsa;
-]])[
+ yyvs = yyvsa;]b4_locations_if([[
+ yyls = yylsa;]])[
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
- {
-]b4_push_if([[ if (!yyps->yynew)
- {
-]b4_use_push_for_pull_if([],
-[[ YYDPRINTF ((stderr, "Return for a new token:\n"));
-]])[ yyresult = YYPUSH_MORE;
+ {]b4_push_if([[
+ if (!yyps->yynew)
+ {]b4_use_push_for_pull_if([], [[
+ YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
+ yyresult = YYPUSH_MORE;
goto yypushreturn;
}
- yyps->yynew = 0;
-]b4_pure_if([], [[
+ yyps->yynew = 0;]b4_pure_if([], [[
/* Restoring the pushed token is only necessary for the first
yypush_parse invocation since subsequent invocations don't overwrite
it before jumping to yyread_pushed_token. */
yychar = yypushed_char;
- yylval = yypushed_val;
- ]b4_locations_if([[yylloc = yypushed_loc;
-]])])[
-yyread_pushed_token:
-]])[ YYDPRINTF ((stderr, "Reading a token: "));
-]b4_push_if([b4_pure_if([[ yychar = yypushed_char;
+ yylval = yypushed_val;]b4_locations_if([[
+ yylloc = yypushed_loc;]])])[
+yyread_pushed_token:]])[
+ YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
+ yychar = yypushed_char;
if (yypushed_val)
- yylval = *yypushed_val;
-]b4_locations_if([[ if (yypushed_loc)
- yylloc = *yypushed_loc;
-]])])],
-[[ yychar = YYLEX;
-]])[ }
+ yylval = *yypushed_val;]b4_locations_if([[
+ if (yypushed_loc)
+ yylloc = *yypushed_loc;]])])], [[
+ yychar = YYLEX;]])[
+ }
if (yychar <= YYEOF)
{
]b4_epilogue
b4_defines_if(
-[@output(b4_spec_defines_file@)
-b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C],dnl '
- [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])
+[@output(b4_spec_defines_file@)@
+b4_copyright([Interface for Bison's Yacc-like parsers in C])dnl'
b4_percent_code_get([[requires]])[]dnl
b4_percent_code_get([[provides]])[]dnl
])dnl b4_defines_if
m4_divert_pop(0)
+m4_popdef([b4_copyright_years])