-F/--force-define and relative %define/-D/--define priorities.

* NEWS (2.5): Add documentation to -D/--define entry.
* build-aux/cross-options.pl: Hard-code association of
--force-define with %define.
* doc/bison.texinfo (Decl Summary): In %define entry,
cross-reference command-line options.
(Bison Options): Add documentation to -D/--define entry.
(Option Cross Key): Widen column for --force-define row.
* src/getargs.c (usage): Document -F/--force-define.  Realign
options in output.
(short_options, long_options, getargs): Parse -F/--force-define,
and update muscle_percent_define_insert invocations.
* src/muscle-tab.h (muscle_percent_define_how): New enum type.
(muscle_percent_define_insert): Add argument with that type.
* src/muscle-tab.c (muscle_percent_define_insert): Implement
-F/--force-define behavior and priorities.
(muscle_percent_define_ensure): Update
muscle_percent_define_insert invocation.
* src/parse-gram.y (prologue_declaration): Update
muscle_percent_define_insert invocations.
* tests/input.at (`%define, --define'): Rename to...
(`%define, --define, --force-define'): ... this and extend.
(cherry picked from commit 34d4193815)

Conflicts:

	src/getargs.c
	src/parse-gram.c
	src/parse-gram.h
	src/parse-gram.y
This commit is contained in:
Joel E. Denny
2009-05-22 17:14:08 -04:00
parent f8e7258f7f
commit de5ab9400a
11 changed files with 356 additions and 241 deletions

View File

@@ -1,3 +1,28 @@
2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
-F/--force-define and relative %define/-D/--define priorities.
* NEWS (2.5): Add documentation to -D/--define entry.
* build-aux/cross-options.pl: Hard-code association of
--force-define with %define.
* doc/bison.texinfo (Decl Summary): In %define entry,
cross-reference command-line options.
(Bison Options): Add documentation to -D/--define entry.
(Option Cross Key): Widen column for --force-define row.
* src/getargs.c (usage): Document -F/--force-define. Realign
options in output.
(short_options, long_options, getargs): Parse -F/--force-define,
and update muscle_percent_define_insert invocations.
* src/muscle-tab.h (muscle_percent_define_how): New enum type.
(muscle_percent_define_insert): Add argument with that type.
* src/muscle-tab.c (muscle_percent_define_insert): Implement
-F/--force-define behavior and priorities.
(muscle_percent_define_ensure): Update
muscle_percent_define_insert invocation.
* src/parse-gram.y (prologue_declaration): Update
muscle_percent_define_insert invocations.
* tests/input.at (`%define, --define'): Rename to...
(`%define, --define, --force-define'): ... this and extend.
2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu> 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
Update some comments to make sense for -D. Update some comments to make sense for -D.

17
NEWS
View File

@@ -59,17 +59,22 @@ Bison News
** %define can now be invoked via the command line. ** %define can now be invoked via the command line.
Each of these bison command-line options Each of these command-line options
-D NAME=VALUE -D NAME[=VALUE]
--define=NAME=VALUE --define=NAME[=VALUE]
-F NAME[=VALUE]
--force-define=NAME[=VALUE]
is equivalent to this grammar file declaration is equivalent to this grammar file declaration
%define NAME "VALUE" %define NAME ["VALUE"]
for any NAME and VALUE. Omitting `=VALUE' on the command line is except that the manner in which Bison processes multiple definitions
equivalent to omitting `"VALUE"' in the declaration. for the same NAME differs. Most importantly, -F and --force-define
quietly override %define, but -D and --define do not. For further
details, see the section "Bison Options" in the Bison manual.
** %define variables renamed. ** %define variables renamed.

View File

@@ -22,7 +22,11 @@ while (<STDIN>)
$short = '' if ! defined $short; $short = '' if ! defined $short;
$short = '-d' if $long eq '--defines' && ! $short; $short = '-d' if $long eq '--defines' && ! $short;
my $dir = '%' . substr($long, 2); my $dir = '%' . substr($long, 2);
$dir = '' if index ($scanner, "\"$dir\"") < 0; if (index ($scanner, "\"$dir\"") < 0)
{
if ($long eq '--force-define') { $dir = '%define'; }
else { $dir = ''; }
}
if ($arg) if ($arg)
{ {
# if $opt, $arg contains the closing ]. # if $opt, $arg contains the closing ].

View File

@@ -4845,7 +4845,8 @@ The possible choices for @var{variable}, as well as their meanings, depend on
the selected target language and/or the parser skeleton (@pxref{Decl the selected target language and/or the parser skeleton (@pxref{Decl
Summary,,%language}, @pxref{Decl Summary,,%skeleton}). Summary,,%language}, @pxref{Decl Summary,,%skeleton}).
Bison will warn if a @var{variable} is defined multiple times. Bison will warn if a @var{variable} is defined by @code{%define}
multiple times, but @ref{Bison Options,,-D @var{name}[=@var{value}]}.
Omitting @code{"@var{value}"} is always equivalent to specifying it as Omitting @code{"@var{value}"} is always equivalent to specifying it as
@code{""}. @code{""}.
@@ -8140,8 +8141,29 @@ already defined, so that the debugging facilities are compiled.
@item -D @var{name}[=@var{value}] @item -D @var{name}[=@var{value}]
@itemx --define=@var{name}[=@var{value}] @itemx --define=@var{name}[=@var{value}]
Same as running @samp{%define @var{name} "@var{value}"} (@pxref{Decl @item -F @var{name}[=@var{value}]
Summary, ,%define}). @itemx --force-define=@var{name}[=@var{value}]
Each of these is equivalent to @samp{%define @var{name} "@var{value}"}
(@pxref{Decl Summary, ,%define}) except that Bison processes multiple
definitions for the same @var{name} as follows:
@itemize
@item
Bison processes all command-line definitions in order and then processes
all @code{%define} definitions in order.
@item
Later definitions override earlier definitions except that Bison quietly
ignores all @code{%define} definitions if the last command-line
definition is specified by @code{-F} or @code{--force-define}.
@item
Bison never warns when a command-line definition overrides another
definition, but Bison always warns when a @code{%define} definition
overrides a command-line or @code{%define} definition.
@end itemize
You should avoid using @code{-F} and @code{--force-define} in your
makefiles unless you are confident that it is safe to quietly ignore any
conflicting @code{%define} that may be added to the grammar file.
@item -L @var{language} @item -L @var{language}
@itemx --language=@var{language} @itemx --language=@var{language}
@@ -8267,9 +8289,9 @@ More user feedback will help to stabilize it.)
@section Option Cross Key @section Option Cross Key
Here is a list of options, alphabetized by long option, to help you find Here is a list of options, alphabetized by long option, to help you find
the corresponding short option. the corresponding short option and directive.
@multitable {@option{--defines=@var{defines-file}}} {@option{-D @var{name}[=@var{value}]}} {@code{%nondeterministic-parser}} @multitable {@option{--force-define=@var{name}[=@var{value}]}} {@option{-F @var{name}[=@var{value}]}} {@code{%nondeterministic-parser}}
@headitem Long Option @tab Short Option @tab Bison Directive @headitem Long Option @tab Short Option @tab Bison Directive
@include cross-options.texi @include cross-options.texi
@end multitable @end multitable

View File

@@ -277,27 +277,28 @@ The same is true for optional arguments.\n\
fputs (_("\ fputs (_("\
\n\ \n\
Operation modes:\n\ Operation modes:\n\
-h, --help display this help and exit\n\ -h, --help display this help and exit\n\
-V, --version output version information and exit\n\ -V, --version output version information and exit\n\
--print-localedir output directory containing locale-dependent data\n\ --print-localedir output directory of locale-dependent data\n\
--print-datadir output directory containing skeletons and XSLT\n\ --print-datadir output directory of skeletons and XSLT\n\
-y, --yacc emulate POSIX Yacc\n\ -y, --yacc emulate POSIX Yacc\n\
-W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\ -W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\
\n\ \n\
"), stdout); "), stdout);
fputs (_("\ fputs (_("\
Parser:\n\ Parser:\n\
-L, --language=LANGUAGE specify the output programming language\n\ -L, --language=LANGUAGE specify the output programming language\n\
(this is an experimental feature)\n\ (this is an experimental feature)\n\
-S, --skeleton=FILE specify the skeleton to use\n\ -S, --skeleton=FILE specify the skeleton to use\n\
-t, --debug instrument the parser for tracing\n\ -t, --debug instrument the parser for tracing\n\
same as `-Dparse.trace'\n\ same as `-Dparse.trace'\n\
--locations enable location support\n\ --locations enable location support\n\
-D, --define=NAME[=VALUE] same as `%define NAME \"VALUE\"'\n\ -D, --define=NAME[=VALUE] similar to `%define NAME \"VALUE\"'\n\
-p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\ -F, --force-define=NAME[=VALUE] override `%define NAME \"VALUE\"'\n\
-l, --no-lines don't generate `#line' directives\n\ -p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\
-k, --token-table include a table of token names\n\ -l, --no-lines don't generate `#line' directives\n\
-k, --token-table include a table of token names\n\
\n\ \n\
"), stdout); "), stdout);
@@ -305,16 +306,16 @@ Parser:\n\
* won't assume that -d also takes an argument. */ * won't assume that -d also takes an argument. */
fputs (_("\ fputs (_("\
Output:\n\ Output:\n\
--defines[=FILE] also produce a header file\n\ --defines[=FILE] also produce a header file\n\
-d likewise but cannot specify FILE (for POSIX Yacc)\n\ -d likewise but cannot specify FILE (for POSIX)\n\
-r, --report=THINGS also produce details on the automaton\n\ -r, --report=THINGS also produce details on the automaton\n\
--report-file=FILE write report to FILE\n\ --report-file=FILE write report to FILE\n\
-v, --verbose same as `--report=state'\n\ -v, --verbose same as `--report=state'\n\
-b, --file-prefix=PREFIX specify a PREFIX for output files\n\ -b, --file-prefix=PREFIX specify a PREFIX for output files\n\
-o, --output=FILE leave output to FILE\n\ -o, --output=FILE leave output to FILE\n\
-g, --graph[=FILE] also output a graph of the automaton\n\ -g, --graph[=FILE] also output a graph of the automaton\n\
-x, --xml[=FILE] also output an XML report of the automaton\n\ -x, --xml[=FILE] also output an XML report of the automaton\n\
(the XML schema is experimental)\n\ (the XML schema is experimental)\n\
\n\ \n\
"), stdout); "), stdout);
@@ -421,6 +422,7 @@ language_argmatch (char const *arg, int prio, location loc)
Should be computed from long_options. */ Should be computed from long_options. */
static char const short_options[] = static char const short_options[] =
"D:" "D:"
"F:"
"L:" "L:"
"S:" "S:"
"T::" "T::"
@@ -488,6 +490,7 @@ static struct option const long_options[] =
/* Parser. */ /* Parser. */
{ "debug", no_argument, 0, 't' }, { "debug", no_argument, 0, 't' },
{ "define", required_argument, 0, 'D' }, { "define", required_argument, 0, 'D' },
{ "force-define", required_argument, 0, 'F' },
{ "locations", no_argument, 0, LOCATIONS_OPTION }, { "locations", no_argument, 0, LOCATIONS_OPTION },
{ "no-lines", no_argument, 0, 'l' }, { "no-lines", no_argument, 0, 'l' },
{ "raw", no_argument, 0, 0 }, { "raw", no_argument, 0, 0 },
@@ -536,13 +539,16 @@ getargs (int argc, char *argv[])
break; break;
case 'D': /* -DNAME[=VALUE]. */ case 'D': /* -DNAME[=VALUE]. */
case 'F': /* -FNAME[=VALUE]. */
{ {
char* name = optarg; char* name = optarg;
char* value = strchr (optarg, '='); char* value = strchr (optarg, '=');
if (value) if (value)
*value++ = 0; *value++ = 0;
muscle_percent_define_insert (name, command_line_location (), muscle_percent_define_insert (name, command_line_location (),
value ? value : ""); value ? value : "",
c == 'D' ? MUSCLE_PERCENT_DEFINE_D
: MUSCLE_PERCENT_DEFINE_F);
} }
break; break;
@@ -617,7 +623,8 @@ getargs (int argc, char *argv[])
case 't': case 't':
muscle_percent_define_insert ("parse.trace", muscle_percent_define_insert ("parse.trace",
command_line_location (), ""); command_line_location (), "",
MUSCLE_PERCENT_DEFINE_D);
break; break;
case 'v': case 'v':

View File

@@ -401,12 +401,14 @@ do { \
void void
muscle_percent_define_insert (char const *variable, location variable_loc, muscle_percent_define_insert (char const *variable, location variable_loc,
char const *value) char const *value,
muscle_percent_define_how how)
{ {
char *variable_tr = NULL; char *variable_tr = NULL;
char const *name; char const *name;
char const *loc_name; char const *loc_name;
char const *syncline_name; char const *syncline_name;
char const *how_name;
/* Permit certain names with underscores for backward compatibility. */ /* Permit certain names with underscores for backward compatibility. */
if (0 == strcmp (variable, "api.push_pull") if (0 == strcmp (variable, "api.push_pull")
@@ -421,22 +423,33 @@ muscle_percent_define_insert (char const *variable, location variable_loc,
MUSCLE_USER_NAME_CONVERT (loc_name, "percent_define_loc(", variable, ")"); MUSCLE_USER_NAME_CONVERT (loc_name, "percent_define_loc(", variable, ")");
MUSCLE_USER_NAME_CONVERT (syncline_name, MUSCLE_USER_NAME_CONVERT (syncline_name,
"percent_define_syncline(", variable, ")"); "percent_define_syncline(", variable, ")");
MUSCLE_USER_NAME_CONVERT (how_name, "percent_define_how(", variable, ")");
if (muscle_find_const (name)) /* Command-line options are processed before the grammar file. */
if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
&& muscle_find_const (name))
{ {
muscle_percent_define_how how_old =
atoi (muscle_find_const (how_name));
if (how_old == MUSCLE_PERCENT_DEFINE_F)
{
free (variable_tr);
return;
}
warn_at (variable_loc, _("%s `%s' redefined"), warn_at (variable_loc, _("%s `%s' redefined"),
"%define variable", variable); "%define variable", variable);
warn_at (muscle_percent_define_get_loc (variable), warn_at (muscle_percent_define_get_loc (variable),
_("previous definition")); _("previous definition"));
} }
MUSCLE_INSERT_STRING (name, value);
MUSCLE_INSERT_STRING (name, value);
muscle_insert (loc_name, ""); muscle_insert (loc_name, "");
muscle_location_grow (loc_name, variable_loc); muscle_location_grow (loc_name, variable_loc);
muscle_insert (syncline_name, ""); muscle_insert (syncline_name, "");
muscle_syncline_grow (syncline_name, variable_loc); muscle_syncline_grow (syncline_name, variable_loc);
muscle_user_name_list_grow ("percent_define_user_variables", variable, muscle_user_name_list_grow ("percent_define_user_variables", variable,
variable_loc); variable_loc);
MUSCLE_INSERT_INT (how_name, how);
free (variable_tr); free (variable_tr);
} }
@@ -455,12 +468,14 @@ muscle_percent_define_ensure (char const *variable, location loc,
`%define api.pure' in a backward-compatible manner here. First, `%define api.pure' in a backward-compatible manner here. First,
don't complain if %pure-parser is specified multiple times. */ don't complain if %pure-parser is specified multiple times. */
if (!muscle_find_const (name)) if (!muscle_find_const (name))
muscle_percent_define_insert (variable, loc, val); muscle_percent_define_insert (variable, loc, val,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
/* In all cases, use api.pure now so that the backend doesn't complain if /* In all cases, use api.pure now so that the backend doesn't complain if
the skeleton ignores api.pure, but do warn now if there's a previous the skeleton ignores api.pure, but do warn now if there's a previous
conflicting definition from an actual %define. */ conflicting definition from an actual %define. */
if (muscle_percent_define_flag_if (variable) != value) if (muscle_percent_define_flag_if (variable) != value)
muscle_percent_define_insert (variable, loc, val); muscle_percent_define_insert (variable, loc, val,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
} }
char * char *

View File

@@ -126,12 +126,25 @@ void muscle_boundary_grow (char const *key, boundary bound);
void muscle_user_name_list_grow (char const *key, char const *user_name, void muscle_user_name_list_grow (char const *key, char const *user_name,
location loc); location loc);
/* Define the muscle for the %define variable VARIABLE appearing at /* Indicates whether a variable's value was specified with -D/--define, with
VARIABLE_LOC with value VALUE. Warn if VARIABLE is already defined. -F/--force-define, or in the grammar file. */
Record this as a user occurrence of VARIABLE by invoking typedef enum {
MUSCLE_PERCENT_DEFINE_D = 0, MUSCLE_PERCENT_DEFINE_F,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
} muscle_percent_define_how;
/* Define the muscles for %define variable VARIABLE with VALUE specified
at VARIABLE_LOC in the manner HOW unless it was specified in the
grammar file while the previous definition for VARIABLE was specified
with -F/--force-define. Warn if a previous definition is being
overridden and the new definition is specified in the grammar file.
(These rules support the documented behavior as long as command-line
definitions are processed before grammar file definitions.) Record
this as a user occurrence of VARIABLE by invoking
muscle_user_name_list_grow. */ muscle_user_name_list_grow. */
void muscle_percent_define_insert (char const *variable, location variable_loc, void muscle_percent_define_insert (char const *variable, location variable_loc,
char const *value); char const *value,
muscle_percent_define_how how);
/* Make sure that VARIABLE is set to the boolean VALUE. Warn on mismatches /* Make sure that VARIABLE is set to the boolean VALUE. Warn on mismatches
only, but accept repeated declaration. Used for backward compatibility only, but accept repeated declaration. Used for backward compatibility

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 2.4.311-ba5c-dirty. */ /* A Bison parser, made by GNU Bison 2.4.323-f8e7-dirty. */
/* Implementation for Bison's Yacc-like parsers in C /* Implementation for Bison's Yacc-like parsers in C
@@ -45,7 +45,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.4.311-ba5c-dirty" #define YYBISON_VERSION "2.4.323-f8e7-dirty"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@@ -606,17 +606,17 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINEYYN -- Source line where rule number YYN was defined. */ /* YYRLINEYYN -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 201, 201, 209, 211, 215, 216, 226, 230, 234, 0, 201, 201, 209, 211, 215, 216, 226, 230, 235,
235, 240, 241, 242, 243, 244, 249, 258, 259, 260, 236, 241, 242, 243, 244, 245, 250, 259, 260, 261,
261, 262, 263, 264, 265, 266, 267, 268, 292, 293, 262, 263, 264, 265, 266, 267, 268, 269, 293, 294,
294, 295, 299, 300, 301, 305, 312, 319, 323, 327, 295, 296, 300, 301, 302, 306, 313, 320, 324, 328,
334, 349, 350, 354, 366, 366, 371, 371, 376, 387, 335, 350, 351, 355, 367, 367, 372, 372, 377, 388,
402, 403, 404, 405, 409, 410, 415, 417, 422, 423, 403, 404, 405, 406, 410, 411, 416, 418, 423, 424,
428, 430, 435, 436, 440, 441, 442, 443, 448, 453, 429, 431, 436, 437, 441, 442, 443, 444, 449, 454,
458, 464, 470, 481, 482, 491, 492, 498, 499, 500, 459, 465, 471, 482, 483, 492, 493, 499, 500, 501,
507, 507, 511, 512, 513, 518, 519, 521, 523, 525, 508, 508, 512, 513, 514, 519, 520, 522, 524, 526,
527, 539, 540, 545, 546, 555, 575, 577, 586, 591, 528, 540, 541, 546, 547, 556, 576, 578, 587, 592,
592, 597, 604, 606 593, 598, 605, 607
}; };
#endif #endif
@@ -1864,77 +1864,78 @@ yyreduce:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 231 "parse-gram.y" #line 231 "parse-gram.y"
{ {
muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars)); muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars),
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1871 "src/parse-gram.c" #line 1872 "src/parse-gram.c"
break; break;
case 9: case 9:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 234 "parse-gram.y" #line 235 "parse-gram.y"
{ defines_flag = true; } { defines_flag = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1879 "src/parse-gram.c" #line 1880 "src/parse-gram.c"
break; break;
case 10: case 10:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 236 "parse-gram.y" #line 237 "parse-gram.y"
{ {
defines_flag = true; defines_flag = true;
spec_defines_file = xstrdup ((yyvsp[0].chars)); spec_defines_file = xstrdup ((yyvsp[0].chars));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1890 "src/parse-gram.c" #line 1891 "src/parse-gram.c"
break; break;
case 11: case 11:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 240 "parse-gram.y" #line 241 "parse-gram.y"
{ expected_sr_conflicts = (yyvsp[0].integer); } { expected_sr_conflicts = (yyvsp[0].integer); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1898 "src/parse-gram.c" #line 1899 "src/parse-gram.c"
break; break;
case 12: case 12:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 241 "parse-gram.y" #line 242 "parse-gram.y"
{ expected_rr_conflicts = (yyvsp[0].integer); } { expected_rr_conflicts = (yyvsp[0].integer); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1906 "src/parse-gram.c" #line 1907 "src/parse-gram.c"
break; break;
case 13: case 13:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 242 "parse-gram.y" #line 243 "parse-gram.y"
{ spec_file_prefix = (yyvsp[0].chars); } { spec_file_prefix = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1914 "src/parse-gram.c" #line 1915 "src/parse-gram.c"
break; break;
case 14: case 14:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 243 "parse-gram.y" #line 244 "parse-gram.y"
{ spec_file_prefix = (yyvsp[0].chars); } { spec_file_prefix = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1922 "src/parse-gram.c" #line 1923 "src/parse-gram.c"
break; break;
case 15: case 15:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 245 "parse-gram.y" #line 246 "parse-gram.y"
{ {
nondeterministic_parser = true; nondeterministic_parser = true;
glr_parser = true; glr_parser = true;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1933 "src/parse-gram.c" #line 1934 "src/parse-gram.c"
break; break;
case 16: case 16:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 250 "parse-gram.y" #line 251 "parse-gram.y"
{ {
code_props action; code_props action;
code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0])); code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0]));
@@ -1944,92 +1945,92 @@ yyreduce:
code_scanner_last_string_free (); code_scanner_last_string_free ();
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1948 "src/parse-gram.c" #line 1949 "src/parse-gram.c"
break; break;
case 17: case 17:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 258 "parse-gram.y" #line 259 "parse-gram.y"
{ language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); } { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1956 "src/parse-gram.c" #line 1957 "src/parse-gram.c"
break; break;
case 18: case 18:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 259 "parse-gram.y" #line 260 "parse-gram.y"
{ add_param ("lex_param", (yyvsp[0].code), (yylsp[0])); } { add_param ("lex_param", (yyvsp[0].code), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1964 "src/parse-gram.c" #line 1965 "src/parse-gram.c"
break; break;
case 19: case 19:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 260 "parse-gram.y" #line 261 "parse-gram.y"
{ spec_name_prefix = (yyvsp[0].chars); } { spec_name_prefix = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1972 "src/parse-gram.c" #line 1973 "src/parse-gram.c"
break; break;
case 20: case 20:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 261 "parse-gram.y" #line 262 "parse-gram.y"
{ spec_name_prefix = (yyvsp[0].chars); } { spec_name_prefix = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1980 "src/parse-gram.c" #line 1981 "src/parse-gram.c"
break; break;
case 21: case 21:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 262 "parse-gram.y" #line 263 "parse-gram.y"
{ no_lines_flag = true; } { no_lines_flag = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1988 "src/parse-gram.c" #line 1989 "src/parse-gram.c"
break; break;
case 22: case 22:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 263 "parse-gram.y" #line 264 "parse-gram.y"
{ nondeterministic_parser = true; } { nondeterministic_parser = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 1996 "src/parse-gram.c" #line 1997 "src/parse-gram.c"
break; break;
case 23: case 23:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 264 "parse-gram.y" #line 265 "parse-gram.y"
{ spec_outfile = (yyvsp[0].chars); } { spec_outfile = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2004 "src/parse-gram.c" #line 2005 "src/parse-gram.c"
break; break;
case 24: case 24:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 265 "parse-gram.y" #line 266 "parse-gram.y"
{ spec_outfile = (yyvsp[0].chars); } { spec_outfile = (yyvsp[0].chars); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2012 "src/parse-gram.c" #line 2013 "src/parse-gram.c"
break; break;
case 25: case 25:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 266 "parse-gram.y" #line 267 "parse-gram.y"
{ add_param ("parse_param", (yyvsp[0].code), (yylsp[0])); } { add_param ("parse_param", (yyvsp[0].code), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2020 "src/parse-gram.c" #line 2021 "src/parse-gram.c"
break; break;
case 26: case 26:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 267 "parse-gram.y" #line 268 "parse-gram.y"
{ version_check (&(yylsp[0]), (yyvsp[0].chars)); } { version_check (&(yylsp[0]), (yyvsp[0].chars)); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2028 "src/parse-gram.c" #line 2029 "src/parse-gram.c"
break; break;
case 27: case 27:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 269 "parse-gram.y" #line 270 "parse-gram.y"
{ {
char const *skeleton_user = (yyvsp[0].chars); char const *skeleton_user = (yyvsp[0].chars);
if (strchr (skeleton_user, '/')) if (strchr (skeleton_user, '/'))
@@ -2054,46 +2055,46 @@ yyreduce:
skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1])); skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2058 "src/parse-gram.c" #line 2059 "src/parse-gram.c"
break; break;
case 28: case 28:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 292 "parse-gram.y" #line 293 "parse-gram.y"
{ token_table_flag = true; } { token_table_flag = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2066 "src/parse-gram.c" #line 2067 "src/parse-gram.c"
break; break;
case 29: case 29:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 293 "parse-gram.y" #line 294 "parse-gram.y"
{ report_flag |= report_states; } { report_flag |= report_states; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2074 "src/parse-gram.c" #line 2075 "src/parse-gram.c"
break; break;
case 30: case 30:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 294 "parse-gram.y" #line 295 "parse-gram.y"
{ yacc_flag = true; } { yacc_flag = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2082 "src/parse-gram.c" #line 2083 "src/parse-gram.c"
break; break;
case 34: case 34:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 302 "parse-gram.y" #line 303 "parse-gram.y"
{ {
grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0])); grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2092 "src/parse-gram.c" #line 2093 "src/parse-gram.c"
break; break;
case 35: case 35:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 306 "parse-gram.y" #line 307 "parse-gram.y"
{ {
symbol_list *list; symbol_list *list;
for (list = (yyvsp[0].list); list; list = list->next) for (list = (yyvsp[0].list); list; list = list->next)
@@ -2101,12 +2102,12 @@ yyreduce:
symbol_list_free ((yyvsp[0].list)); symbol_list_free ((yyvsp[0].list));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2105 "src/parse-gram.c" #line 2106 "src/parse-gram.c"
break; break;
case 36: case 36:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 313 "parse-gram.y" #line 314 "parse-gram.y"
{ {
symbol_list *list; symbol_list *list;
for (list = (yyvsp[0].list); list; list = list->next) for (list = (yyvsp[0].list); list; list = list->next)
@@ -2114,32 +2115,32 @@ yyreduce:
symbol_list_free ((yyvsp[0].list)); symbol_list_free ((yyvsp[0].list));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2118 "src/parse-gram.c" #line 2119 "src/parse-gram.c"
break; break;
case 37: case 37:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 320 "parse-gram.y" #line 321 "parse-gram.y"
{ {
default_prec = true; default_prec = true;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2128 "src/parse-gram.c" #line 2129 "src/parse-gram.c"
break; break;
case 38: case 38:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 324 "parse-gram.y" #line 325 "parse-gram.y"
{ {
default_prec = false; default_prec = false;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2138 "src/parse-gram.c" #line 2139 "src/parse-gram.c"
break; break;
case 39: case 39:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 328 "parse-gram.y" #line 329 "parse-gram.y"
{ {
/* Do not invoke muscle_percent_code_grow here since it invokes /* Do not invoke muscle_percent_code_grow here since it invokes
muscle_user_name_list_grow. */ muscle_user_name_list_grow. */
@@ -2147,89 +2148,89 @@ yyreduce:
code_scanner_last_string_free (); code_scanner_last_string_free ();
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2151 "src/parse-gram.c" #line 2152 "src/parse-gram.c"
break; break;
case 40: case 40:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 335 "parse-gram.y" #line 336 "parse-gram.y"
{ {
muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0])); muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0]));
code_scanner_last_string_free (); code_scanner_last_string_free ();
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2162 "src/parse-gram.c" #line 2163 "src/parse-gram.c"
break; break;
case 41: case 41:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 349 "parse-gram.y" #line 350 "parse-gram.y"
{} {}
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2170 "src/parse-gram.c" #line 2171 "src/parse-gram.c"
break; break;
case 42: case 42:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 350 "parse-gram.y" #line 351 "parse-gram.y"
{ muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); } { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2178 "src/parse-gram.c" #line 2179 "src/parse-gram.c"
break; break;
case 43: case 43:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 355 "parse-gram.y" #line 356 "parse-gram.y"
{ {
union_seen = true; union_seen = true;
muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0])); muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0]));
code_scanner_last_string_free (); code_scanner_last_string_free ();
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2190 "src/parse-gram.c" #line 2191 "src/parse-gram.c"
break; break;
case 44: case 44:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 366 "parse-gram.y" #line 367 "parse-gram.y"
{ current_class = nterm_sym; } { current_class = nterm_sym; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2198 "src/parse-gram.c" #line 2199 "src/parse-gram.c"
break; break;
case 45: case 45:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 367 "parse-gram.y" #line 368 "parse-gram.y"
{ {
current_class = unknown_sym; current_class = unknown_sym;
current_type = NULL; current_type = NULL;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2209 "src/parse-gram.c" #line 2210 "src/parse-gram.c"
break; break;
case 46: case 46:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 371 "parse-gram.y" #line 372 "parse-gram.y"
{ current_class = token_sym; } { current_class = token_sym; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2217 "src/parse-gram.c" #line 2218 "src/parse-gram.c"
break; break;
case 47: case 47:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 372 "parse-gram.y" #line 373 "parse-gram.y"
{ {
current_class = unknown_sym; current_class = unknown_sym;
current_type = NULL; current_type = NULL;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2228 "src/parse-gram.c" #line 2229 "src/parse-gram.c"
break; break;
case 48: case 48:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 377 "parse-gram.y" #line 378 "parse-gram.y"
{ {
symbol_list *list; symbol_list *list;
tag_seen = true; tag_seen = true;
@@ -2238,12 +2239,12 @@ yyreduce:
symbol_list_free ((yyvsp[0].list)); symbol_list_free ((yyvsp[0].list));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2242 "src/parse-gram.c" #line 2243 "src/parse-gram.c"
break; break;
case 49: case 49:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 388 "parse-gram.y" #line 389 "parse-gram.y"
{ {
symbol_list *list; symbol_list *list;
++current_prec; ++current_prec;
@@ -2256,202 +2257,202 @@ yyreduce:
current_type = NULL; current_type = NULL;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2260 "src/parse-gram.c" #line 2261 "src/parse-gram.c"
break; break;
case 50: case 50:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 402 "parse-gram.y" #line 403 "parse-gram.y"
{ (yyval.assoc) = left_assoc; } { (yyval.assoc) = left_assoc; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2268 "src/parse-gram.c" #line 2269 "src/parse-gram.c"
break; break;
case 51: case 51:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 403 "parse-gram.y" #line 404 "parse-gram.y"
{ (yyval.assoc) = right_assoc; } { (yyval.assoc) = right_assoc; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2276 "src/parse-gram.c" #line 2277 "src/parse-gram.c"
break; break;
case 52: case 52:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 404 "parse-gram.y" #line 405 "parse-gram.y"
{ (yyval.assoc) = non_assoc; } { (yyval.assoc) = non_assoc; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2284 "src/parse-gram.c" #line 2285 "src/parse-gram.c"
break; break;
case 53: case 53:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 405 "parse-gram.y" #line 406 "parse-gram.y"
{ (yyval.assoc) = precedence_assoc; } { (yyval.assoc) = precedence_assoc; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2292 "src/parse-gram.c" #line 2293 "src/parse-gram.c"
break; break;
case 54: case 54:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 409 "parse-gram.y" #line 410 "parse-gram.y"
{ current_type = NULL; } { current_type = NULL; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2300 "src/parse-gram.c" #line 2301 "src/parse-gram.c"
break; break;
case 55: case 55:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 410 "parse-gram.y" #line 411 "parse-gram.y"
{ current_type = (yyvsp[0].uniqstr); tag_seen = true; } { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2308 "src/parse-gram.c" #line 2309 "src/parse-gram.c"
break; break;
case 56: case 56:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 416 "parse-gram.y" #line 417 "parse-gram.y"
{ (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2316 "src/parse-gram.c" #line 2317 "src/parse-gram.c"
break; break;
case 57: case 57:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 418 "parse-gram.y" #line 419 "parse-gram.y"
{ (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2324 "src/parse-gram.c" #line 2325 "src/parse-gram.c"
break; break;
case 58: case 58:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 422 "parse-gram.y" #line 423 "parse-gram.y"
{ (yyval.symbol) = (yyvsp[0].symbol); } { (yyval.symbol) = (yyvsp[0].symbol); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2332 "src/parse-gram.c" #line 2333 "src/parse-gram.c"
break; break;
case 59: case 59:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 423 "parse-gram.y" #line 424 "parse-gram.y"
{ (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); } { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2340 "src/parse-gram.c" #line 2341 "src/parse-gram.c"
break; break;
case 60: case 60:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 429 "parse-gram.y" #line 430 "parse-gram.y"
{ (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2348 "src/parse-gram.c" #line 2349 "src/parse-gram.c"
break; break;
case 61: case 61:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 431 "parse-gram.y" #line 432 "parse-gram.y"
{ (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2356 "src/parse-gram.c" #line 2357 "src/parse-gram.c"
break; break;
case 62: case 62:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 435 "parse-gram.y" #line 436 "parse-gram.y"
{ (yyval.list) = (yyvsp[0].list); } { (yyval.list) = (yyvsp[0].list); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2364 "src/parse-gram.c" #line 2365 "src/parse-gram.c"
break; break;
case 63: case 63:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 436 "parse-gram.y" #line 437 "parse-gram.y"
{ (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); } { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2372 "src/parse-gram.c" #line 2373 "src/parse-gram.c"
break; break;
case 64: case 64:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 440 "parse-gram.y" #line 441 "parse-gram.y"
{ (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2380 "src/parse-gram.c" #line 2381 "src/parse-gram.c"
break; break;
case 65: case 65:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 441 "parse-gram.y" #line 442 "parse-gram.y"
{ (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); } { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2388 "src/parse-gram.c" #line 2389 "src/parse-gram.c"
break; break;
case 66: case 66:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 442 "parse-gram.y" #line 443 "parse-gram.y"
{ (yyval.list) = symbol_list_default_tagged_new ((yylsp[0])); } { (yyval.list) = symbol_list_default_tagged_new ((yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2396 "src/parse-gram.c" #line 2397 "src/parse-gram.c"
break; break;
case 67: case 67:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 443 "parse-gram.y" #line 444 "parse-gram.y"
{ (yyval.list) = symbol_list_default_tagless_new ((yylsp[0])); } { (yyval.list) = symbol_list_default_tagless_new ((yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2404 "src/parse-gram.c" #line 2405 "src/parse-gram.c"
break; break;
case 68: case 68:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 449 "parse-gram.y" #line 450 "parse-gram.y"
{ {
current_type = (yyvsp[0].uniqstr); current_type = (yyvsp[0].uniqstr);
tag_seen = true; tag_seen = true;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2415 "src/parse-gram.c" #line 2416 "src/parse-gram.c"
break; break;
case 69: case 69:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 454 "parse-gram.y" #line 455 "parse-gram.y"
{ {
symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true); symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0])); symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2426 "src/parse-gram.c" #line 2427 "src/parse-gram.c"
break; break;
case 70: case 70:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 459 "parse-gram.y" #line 460 "parse-gram.y"
{ {
symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2438 "src/parse-gram.c" #line 2439 "src/parse-gram.c"
break; break;
case 71: case 71:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 465 "parse-gram.y" #line 466 "parse-gram.y"
{ {
symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc)); symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2450 "src/parse-gram.c" #line 2451 "src/parse-gram.c"
break; break;
case 72: case 72:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 471 "parse-gram.y" #line 472 "parse-gram.y"
{ {
symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true); symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2])); symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
@@ -2459,110 +2460,110 @@ yyreduce:
symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc)); symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2463 "src/parse-gram.c" #line 2464 "src/parse-gram.c"
break; break;
case 79: case 79:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 501 "parse-gram.y" #line 502 "parse-gram.y"
{ {
yyerrok; yyerrok;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2473 "src/parse-gram.c" #line 2474 "src/parse-gram.c"
break; break;
case 80: case 80:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 507 "parse-gram.y" #line 508 "parse-gram.y"
{ current_lhs = (yyvsp[0].symbol); current_lhs_location = (yylsp[0]); } { current_lhs = (yyvsp[0].symbol); current_lhs_location = (yylsp[0]); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2481 "src/parse-gram.c" #line 2482 "src/parse-gram.c"
break; break;
case 82: case 82:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 511 "parse-gram.y" #line 512 "parse-gram.y"
{ grammar_current_rule_end ((yylsp[0])); } { grammar_current_rule_end ((yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2489 "src/parse-gram.c" #line 2490 "src/parse-gram.c"
break; break;
case 83: case 83:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 512 "parse-gram.y" #line 513 "parse-gram.y"
{ grammar_current_rule_end ((yylsp[0])); } { grammar_current_rule_end ((yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2497 "src/parse-gram.c" #line 2498 "src/parse-gram.c"
break; break;
case 85: case 85:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 518 "parse-gram.y" #line 519 "parse-gram.y"
{ grammar_current_rule_begin (current_lhs, current_lhs_location); } { grammar_current_rule_begin (current_lhs, current_lhs_location); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2505 "src/parse-gram.c" #line 2506 "src/parse-gram.c"
break; break;
case 86: case 86:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 520 "parse-gram.y" #line 521 "parse-gram.y"
{ grammar_current_rule_symbol_append ((yyvsp[0].symbol), (yylsp[0])); } { grammar_current_rule_symbol_append ((yyvsp[0].symbol), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2513 "src/parse-gram.c" #line 2514 "src/parse-gram.c"
break; break;
case 87: case 87:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 522 "parse-gram.y" #line 523 "parse-gram.y"
{ grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0])); } { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2521 "src/parse-gram.c" #line 2522 "src/parse-gram.c"
break; break;
case 88: case 88:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 524 "parse-gram.y" #line 525 "parse-gram.y"
{ grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); } { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2529 "src/parse-gram.c" #line 2530 "src/parse-gram.c"
break; break;
case 89: case 89:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 526 "parse-gram.y" #line 527 "parse-gram.y"
{ grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); } { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2537 "src/parse-gram.c" #line 2538 "src/parse-gram.c"
break; break;
case 90: case 90:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 528 "parse-gram.y" #line 529 "parse-gram.y"
{ grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); } { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2545 "src/parse-gram.c" #line 2546 "src/parse-gram.c"
break; break;
case 92: case 92:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 540 "parse-gram.y" #line 541 "parse-gram.y"
{ (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); } { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2553 "src/parse-gram.c" #line 2554 "src/parse-gram.c"
break; break;
case 93: case 93:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 545 "parse-gram.y" #line 546 "parse-gram.y"
{ (yyval.chars) = ""; } { (yyval.chars) = ""; }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2561 "src/parse-gram.c" #line 2562 "src/parse-gram.c"
break; break;
case 95: case 95:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 556 "parse-gram.y" #line 557 "parse-gram.y"
{ {
code_props plain_code; code_props plain_code;
(yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n'; (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
@@ -2572,51 +2573,51 @@ yyreduce:
(yyval.chars) = plain_code.code; (yyval.chars) = plain_code.code;
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2576 "src/parse-gram.c" #line 2577 "src/parse-gram.c"
break; break;
case 96: case 96:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 576 "parse-gram.y" #line 577 "parse-gram.y"
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2584 "src/parse-gram.c" #line 2585 "src/parse-gram.c"
break; break;
case 97: case 97:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 578 "parse-gram.y" #line 579 "parse-gram.y"
{ {
(yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0])); (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0])); symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2596 "src/parse-gram.c" #line 2597 "src/parse-gram.c"
break; break;
case 98: case 98:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 586 "parse-gram.y" #line 587 "parse-gram.y"
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2604 "src/parse-gram.c" #line 2605 "src/parse-gram.c"
break; break;
case 101: case 101:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 598 "parse-gram.y" #line 599 "parse-gram.y"
{ {
(yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0])); (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2615 "src/parse-gram.c" #line 2616 "src/parse-gram.c"
break; break;
case 103: case 103:
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 607 "parse-gram.y" #line 608 "parse-gram.y"
{ {
code_props plain_code; code_props plain_code;
code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
@@ -2626,12 +2627,12 @@ yyreduce:
code_scanner_last_string_free (); code_scanner_last_string_free ();
} }
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2630 "src/parse-gram.c" #line 2631 "src/parse-gram.c"
break; break;
/* Line 1380 of yacc.c */ /* Line 1380 of yacc.c */
#line 2635 "src/parse-gram.c" #line 2636 "src/parse-gram.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2848,7 +2849,7 @@ yyreturn:
} }
/* Line 1599 of yacc.c */ /* Line 1599 of yacc.c */
#line 617 "parse-gram.y" #line 618 "parse-gram.y"

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 2.4.311-ba5c-dirty. */ /* A Bison parser, made by GNU Bison 2.4.323-f8e7-dirty. */
/* Interface for Bison's Yacc-like parsers in C /* Interface for Bison's Yacc-like parsers in C

View File

@@ -229,7 +229,8 @@ prologue_declaration:
} }
| "%define" variable content.opt | "%define" variable content.opt
{ {
muscle_percent_define_insert ($2, @2, $3); muscle_percent_define_insert ($2, @2, $3,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
} }
| "%defines" { defines_flag = true; } | "%defines" { defines_flag = true; }
| "%defines" STRING | "%defines" STRING

View File

@@ -913,27 +913,49 @@ input.y:5.9-16: warning: %define variable `special2' is not used
AT_CLEANUP AT_CLEANUP
## ------------------- ## ## ----------------------------------- ##
## %define, --define. ## ## %define, --define, --force-define. ##
## ------------------- ## ## ----------------------------------- ##
AT_SETUP([%define, --define]) AT_SETUP([%define, --define, --force-define])
AT_DATA([skel.c],
[[m4@&t@_divert_push(0)@
@output(b4_parser_file_name@)@
[var-dd: ]b4_percent_define_get([[var-dd]])[
var-ff: ]b4_percent_define_get([[var-ff]])[
var-dg: ]b4_percent_define_get([[var-dg]])[
var-dfg: ]b4_percent_define_get([[var-dfg]])[
var-fd: ]b4_percent_define_get([[var-fd]])
m4@&t@_divert_pop(0)
]])
AT_DATA([input.y], AT_DATA([input.y],
[[%define var "value1" [[%define var-dg "gram"
%define var-dfg "gram"
%% %%
start: ; start: ;
]]) ]])
AT_BISON_CHECK([[-DFOO -DFOO -Dvar=value input.y]], [0], [], AT_BISON_CHECK([[-Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
[[<command line>:3: warning: %define variable `FOO' redefined -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
<command line>:2: warning: previous definition -Dvar-dg=cmd-d \
input.y:1.9-11: warning: %define variable `var' redefined -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
<command line>:4: warning: previous definition -Fvar-fd=cmd-f -Dvar-fd=cmd-d \
<command line>:2: warning: %define variable `FOO' is not used -Dunused-d -Funused-f \
<command line>:3: warning: %define variable `FOO' is not used --skeleton ./skel.c input.y]], [0], [],
<command line>:4: warning: %define variable `var' is not used [[input.y:1.9-14: warning: %define variable `var-dg' redefined
input.y:1.9-11: warning: %define variable `var' is not used <command line>:6: warning: previous definition
<command line>:11: warning: %define variable `unused-d' is not used
<command line>:12: warning: %define variable `unused-f' is not used
]])
AT_CHECK([[cat input.tab.c]], [[0]],
[[var-dd: cmd-d2
var-ff: cmd-f2
var-dg: gram
var-dfg: cmd-f
var-fd: cmd-d
]]) ]])
AT_CLEANUP AT_CLEANUP