* src/getargs.c (skeleton_arg): Last arg is now location const *.

Rewrite to simplify the logic.
(language_argmatch): Likewise.

* doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
Java is supported.
* src/complain.c (program_name): Remove decl; no longer needed.
* src/main.c (program_name): Remove; now belongs to getargs.

2006-12-18  Paolo Bonzini  <bonzini@gnu.org>

* NEWS: Document %language.

* data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.

* data/c-skel.m4, data/c++-skel.m4: New files.
* data/glr.c: Complain on push parsers.

* doc/bison.texinfo (C++ Parser Interface): Prefer %language
over %skeleton.
(Directives): Document %language and %skeleton.
(Command line): Document -L.

* examples/extexi: Rewrite %require directive.
* examples/calc++/Makefile.am: Pass VERSION to extexi.

* src/files.c (compute_exts_from_gc): Look in language structure
for .y extension.
(compute_file_name_parts): Check whether .tab should be added.
* src/getargs.c (valid_languages, skeleton_prio, language_prio):
(language, skeleton_arg, language_argmatch): New.
(long_options): Add --language.
(getargs): Use skeleton_arg, add -L/--language.
* src/getargs.h: Include location.h.
(struct bison_language, language, skeleton_arg, language_argmatch): New.
* src/output.c (prepare): Pick default skeleton from struct language.
Don't dispatch C skeletons here.
* src/parse-gram.y (PERCENT_LANGUAGE): New.
(prologue_declaration): Add "%language" rule, use skeleton_arg.
* src/scan-gram.l ("%language"): New rule.

* tests/calc.at: Test %skeleton and %language.
* tests/local.at (AT_SKEL_CC_IF): Look for %language.
(AT_GLR_IF): Look for %skeleton "glr.cc".
(AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
(AT_YACC_IF): Reject %language.

2006-12-18  Paul Eggert  <eggert@cs.ucla.edu>
This commit is contained in:
Paul Eggert
2006-12-19 00:34:37 +00:00
parent db06f0ce72
commit 0e021770cc
19 changed files with 287 additions and 51 deletions

7
NEWS
View File

@@ -6,6 +6,11 @@ Changes in version 2.3a+ (????-??-??):
* The -g and --graph options now output graphs in Graphviz DOT format,
not VCG format.
* An experimental directive %language specifies the language of the
generated parser, which can be C (the default) or C++. This
directive affects the skeleton used, and the names of the generated
files if the grammar file's name ends in ".y".
* The grammar file may now specify the name of the parser header file using
%defines. For example:
@@ -96,7 +101,7 @@ Changes in version 2.3a+ (????-??-??):
- `%start-header {CODE}', which only Bison 2.3a supported.
3. %provides {CODE}
This is the right place to write additional definitions you would like
Bison to expose externally. That is, this directive inserts your CODE
both into the parser header file and into the parser code file after