-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 invocation.
* 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.
* 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.
This commit is contained in:
Joel E. Denny
2009-05-22 17:14:08 -04:00
parent 246c4efafe
commit 34d4193815
11 changed files with 277 additions and 163 deletions

View File

@@ -227,7 +227,8 @@ prologue_declaration:
| "%debug" { debug_flag = true; }
| "%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" STRING
@@ -270,12 +271,14 @@ prologue_declaration:
`%define api.pure' in a backward-compatible manner here. First, don't
complain if %pure-parser is specified multiple times. */
if (!muscle_find_const ("percent_define(api.pure)"))
muscle_percent_define_insert ("api.pure", @1, "");
muscle_percent_define_insert ("api.pure", @1, "",
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
/* 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
conflicting definition from an actual %define. */
if (!muscle_percent_define_flag_if ("api.pure"))
muscle_percent_define_insert ("api.pure", @1, "");
muscle_percent_define_insert ("api.pure", @1, "",
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
| "%require" STRING { version_check (&@2, $2); }
| "%skeleton" STRING