mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-22 09:14:26 +00:00
Compare commits
67
Commits
GCC_2002-10-11
...
v2.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41930e7ad8 | ||
|
|
d07932ef3d | ||
|
|
0364b3344f | ||
|
|
876fd8357a | ||
|
|
1eb0b14659 | ||
|
|
bee1df15b2 | ||
|
|
7e6d1e2296 | ||
|
|
a957d06cef | ||
|
|
462503f825 | ||
|
|
bf151b75ff | ||
|
|
f56274a8f9 | ||
|
|
b5775a81c1 | ||
|
|
7ed73f82ad | ||
|
|
4b1ebc495b | ||
|
|
738cde3e93 | ||
|
|
d6fb461dd8 | ||
|
|
14da0cdd07 | ||
|
|
c9ba9e5978 | ||
|
|
bfb40910e3 | ||
|
|
241fda7a8d | ||
|
|
ed4d67dcbe | ||
|
|
e254a580b5 | ||
|
|
f259e4e63c | ||
|
|
74d6c0fe17 | ||
|
|
cae5057f47 | ||
|
|
4af432ba25 | ||
|
|
e26d4e4314 | ||
|
|
c0ee9e2115 | ||
|
|
482dc52fb7 | ||
|
|
52cbbe845a | ||
|
|
0925d5bfd4 | ||
|
|
cf98343c1d | ||
|
|
9f467b7d84 | ||
|
|
0f0e1ace60 | ||
|
|
548e2104e2 | ||
|
|
ddf17a6e0e | ||
|
|
e1145ad8bd | ||
|
|
0df72d78ff | ||
|
|
9a90b6bbc6 | ||
|
|
6501566813 | ||
|
|
98e26a9201 | ||
|
|
86c0e78460 | ||
|
|
8851116612 | ||
|
|
d67c52e852 | ||
|
|
6bbb2ed5ef | ||
|
|
8dce3875bc | ||
|
|
a3764451d3 | ||
|
|
882a1fbf72 | ||
|
|
dfcc595944 | ||
|
|
a30e920d17 | ||
|
|
445b74704f | ||
|
|
a1e50014a0 | ||
|
|
d43f77e7ee | ||
|
|
fee2ed87aa | ||
|
|
fdd2c97c0b | ||
|
|
78029cd561 | ||
|
|
c53d18b157 | ||
|
|
5523ac79a0 | ||
|
|
8fa369111f | ||
|
|
bcf07cb707 | ||
|
|
9aacab9ae9 | ||
|
|
a9fc7990fa | ||
|
|
0f1d6f10d7 | ||
|
|
7bd1665a86 | ||
|
|
72c5b9828e | ||
|
|
bd02cd5d3a | ||
|
|
9126263e13 |
+4
-1
@@ -1,10 +1,12 @@
|
|||||||
*.cache
|
*.cache
|
||||||
*.flc
|
*.flc
|
||||||
*.patch *.log log patches applied
|
|
||||||
*.prj
|
*.prj
|
||||||
|
*~
|
||||||
|
.tarball-version
|
||||||
.version
|
.version
|
||||||
ABOUT-NLS
|
ABOUT-NLS
|
||||||
COPYING
|
COPYING
|
||||||
|
GNUmakefile
|
||||||
INSTALL
|
INSTALL
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
@@ -21,6 +23,7 @@ config.status
|
|||||||
configure
|
configure
|
||||||
configure.lineno
|
configure.lineno
|
||||||
conftest*
|
conftest*
|
||||||
|
gnulib
|
||||||
javacomp.sh
|
javacomp.sh
|
||||||
javaexec.sh
|
javaexec.sh
|
||||||
patches
|
patches
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ChangeLog merge=merge-changelog
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
/*.cache
|
||||||
|
/*.flc
|
||||||
|
/*.prj
|
||||||
|
/*~
|
||||||
|
/.tarball-version
|
||||||
|
/.version
|
||||||
|
/ABOUT-NLS
|
||||||
|
/COPYING
|
||||||
|
/GNUmakefile
|
||||||
|
/INSTALL
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/_*
|
||||||
|
/a.exe
|
||||||
|
/a.out
|
||||||
|
/aclocal.m4
|
||||||
|
/b.out
|
||||||
|
/bison-*
|
||||||
|
/conf[0-9]*
|
||||||
|
/confdefs*
|
||||||
|
/config.log
|
||||||
|
/config.status
|
||||||
|
/configure
|
||||||
|
/configure.lineno
|
||||||
|
/conftest*
|
||||||
|
/gnulib
|
||||||
|
/javacomp.sh
|
||||||
|
/javaexec.sh
|
||||||
|
/patches
|
||||||
|
/releases
|
||||||
|
/stamp-h*
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "gnulib"]
|
||||||
|
path = gnulib
|
||||||
|
url = git://git.savannah.gnu.org/gnulib.git
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2.3b
|
||||||
@@ -1 +0,0 @@
|
|||||||
@VERSION@
|
|
||||||
@@ -1,3 +1,602 @@
|
|||||||
|
2008-12-11 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Version 2.4.1.
|
||||||
|
* NEWS: Set version and date.
|
||||||
|
* lib/Makefile.am: Update copyright year.
|
||||||
|
* tests/atlocal.in: Update copyright year.
|
||||||
|
|
||||||
|
2008-12-11 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Semicolon feature removal is not about future language support.
|
||||||
|
* NEWS: The semicolon feature is no longer active for newer languages,
|
||||||
|
so don't claim that it causes trouble for them.
|
||||||
|
|
||||||
|
2008-12-11 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* gnulib: Update submodule to HEAD.
|
||||||
|
|
||||||
|
2008-12-09 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Update data/README.
|
||||||
|
* data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
|
||||||
|
|
||||||
|
2008-12-05 Eric Blake <[email protected]>
|
||||||
|
|
||||||
|
Build testsuite with newer autoconf.
|
||||||
|
* tests/output.at (m4_expand): Don't override in newer autoconf,
|
||||||
|
where the underlying implementation changed.
|
||||||
|
* tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
|
||||||
|
(_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
|
||||||
|
(_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||||
|
(_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
|
||||||
|
since some of them contain unbalanced ')'.
|
||||||
|
|
||||||
|
2008-11-19 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Clarify a little.
|
||||||
|
|
||||||
|
2008-11-19 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Update for recent changes.
|
||||||
|
|
||||||
|
2008-11-18 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix unexpanded macros in GLR defines file.
|
||||||
|
Reported by Csaba Raduly at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
|
||||||
|
* THANKS (Csaba Raduly): Add.
|
||||||
|
* data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
|
||||||
|
* tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
|
||||||
|
lexer in a separate module that includes the defines file.
|
||||||
|
(AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
|
||||||
|
source.
|
||||||
|
* tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
|
||||||
|
Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
|
||||||
|
(AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
|
||||||
|
(AT_DATA_SOURCE_PROLOGUE): New.
|
||||||
|
(AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
|
||||||
|
(AT_DATA_SOURCE): New.
|
||||||
|
(AT_FULL_COMPILE): New, copied from master branch and extended to
|
||||||
|
support an additional source file.
|
||||||
|
|
||||||
|
2008-11-17 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Don't let maintainer-*-check targets force a version update.
|
||||||
|
* cfg.mk (_is-dist-target): Implement. maintainer-check* was already
|
||||||
|
handled.
|
||||||
|
|
||||||
|
2008-11-17 Di-an Jan <[email protected]>
|
||||||
|
|
||||||
|
* doc/bison.texinfo: Synchronize ``Detail Node Listing''.
|
||||||
|
Align menus. Adjust word wrapping. Use node names for menu names.
|
||||||
|
(Examples): Don't abbreviate node names.
|
||||||
|
(LocalWords): Remove abbreviations.
|
||||||
|
(Copying): Make description a sentence.
|
||||||
|
(Java Action Features): Remove period to match the rest of menu.
|
||||||
|
|
||||||
|
2008-11-11 Paolo Bonzini <[email protected]>
|
||||||
|
|
||||||
|
* bootstrap.conf: Replace m4/warning.m4 with warnings module.
|
||||||
|
* configure.ac: Adjust usage.
|
||||||
|
* lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
|
||||||
|
* src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
|
||||||
|
* tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
|
||||||
|
|
||||||
|
2008-11-07 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Don't add a semicolon to actions for %skeleton or %language.
|
||||||
|
It breaks Java test cases as reported by Akim Demaille.
|
||||||
|
* src/scan-code.l: Implement.
|
||||||
|
|
||||||
|
2008-11-07 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Clean up %skeleton and %language priority implementation.
|
||||||
|
* src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
|
||||||
|
remove static qualifier because others will soon need to see it.
|
||||||
|
(language_prio): Likewise.
|
||||||
|
(getargs): Use command_line_prio rather than 0.
|
||||||
|
* src/getargs.h (command_line_prio, grammar_prio, default_prio): New
|
||||||
|
enum fields.
|
||||||
|
(skeleton_prio): Extern it.
|
||||||
|
(language_prio): Extern it.
|
||||||
|
* src/parse-gram.y: Use grammar_prio rather than 1.
|
||||||
|
|
||||||
|
2008-11-04 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Mention the trailing semicolon in action.
|
||||||
|
|
||||||
|
2008-11-04 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Reformat NEWS.
|
||||||
|
* NEWS: Use more outline-mode markup.
|
||||||
|
Suggested by Jim Meyering.
|
||||||
|
|
||||||
|
2008-11-04 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix user actions without a trailing semicolon.
|
||||||
|
Reported by Sergei Steshenko at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
|
||||||
|
* THANKS (Sergei Steshenko): Add.
|
||||||
|
* src/scan-code.l (SC_RULE_ACTION): Fix it.
|
||||||
|
* tests/regression.at (Fix user actions without a trailing semicolon):
|
||||||
|
New test case.
|
||||||
|
|
||||||
|
2008-11-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Initiate further development.
|
||||||
|
* NEWS: Create an empty section for new entries.
|
||||||
|
* gnulib: Update submodule to HEAD.
|
||||||
|
|
||||||
|
2008-11-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Version 2.4.
|
||||||
|
|
||||||
|
2008-11-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Prepare for next release.
|
||||||
|
* NEWS: Briefly mention changes since 2.3b.
|
||||||
|
* README: Say GNU m4 1.4.6, which we've been requiring in release
|
||||||
|
announcements already, not 1.4.3, which breaks the build.
|
||||||
|
|
||||||
|
2008-11-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Say %language is experimental.
|
||||||
|
We're thinking of extending it's effect on output file naming. See the
|
||||||
|
thread at
|
||||||
|
<http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
|
||||||
|
* NEWS: Say it's experimental.
|
||||||
|
* doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
|
||||||
|
recommend it over %skeleton for now.
|
||||||
|
(Bison Options): Likewise.
|
||||||
|
(C++ Bison Interface): Use %skeleton not %language.
|
||||||
|
(Calc++ Parser): Use %skeleton not %language.
|
||||||
|
* src/getargs.c (usage): Say it's experimental.
|
||||||
|
|
||||||
|
2008-11-01 Di-an Jan <[email protected]>
|
||||||
|
Paolo Bonzini <[email protected]>
|
||||||
|
|
||||||
|
Support all Java parser class modifiers.
|
||||||
|
* data/java.m4 (b4_percent_define_get3): New.
|
||||||
|
(b4_final_if, b4_strictfp_if): New.
|
||||||
|
* data/lalr1.java (final, strictfp, extends, implements): Support.
|
||||||
|
* doc/bison.texinfo (final, strictfp, extends, implements): Add
|
||||||
|
documentation.
|
||||||
|
* tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
|
||||||
|
(AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
|
||||||
|
(AT_CHECK_JAVA_GREP): New.
|
||||||
|
(Java parser class modifiers): New test.
|
||||||
|
(Java parser class extends and implements): New test.
|
||||||
|
|
||||||
|
Model exception propagation better with throws and lex_throws.
|
||||||
|
* data/java.m4 (b4_list2): New.
|
||||||
|
(throws): Change default.
|
||||||
|
* data/lalr1.java (yyaction): Add throws.
|
||||||
|
(parse): Add lex_throws in addition to throws.
|
||||||
|
* doc/bison.texinfo (throws, lex_throws): Add documentation.
|
||||||
|
* tests/java.at (Java throws specifications): New test.
|
||||||
|
|
||||||
|
Improve documentation for Java parsers.
|
||||||
|
* doc/bison.texinfo (Java Parsers): Add subsections.
|
||||||
|
Don't quote first argument of %define.
|
||||||
|
(Java Bison Interface): Document output files. Move documentation
|
||||||
|
of parser class and merge into Java Parser Interface. Document
|
||||||
|
features that error out. Document directives with no effect.
|
||||||
|
Move note about Javadoc higher.
|
||||||
|
(Java Semantic Values): Explicitly mention stype.
|
||||||
|
Document that generic types cannot be used.
|
||||||
|
(Java Location Values): Use @deftypeivar. Document constructors.
|
||||||
|
Correct return value for toString.
|
||||||
|
(Java Parser Interface): List undocumented constants/fields.
|
||||||
|
Move documentation of fields added by %parse-param closer to list
|
||||||
|
of members. Document that token names are added as fields.
|
||||||
|
Document constructors accurately. Remove error method.
|
||||||
|
(Java Scanner Interface): Move note on %pure-parser to Java Bison
|
||||||
|
Interface. Describe %code lexer and yylex accutately.
|
||||||
|
Remove documentation that does not match the code.
|
||||||
|
(Java Action Features): New.
|
||||||
|
(Java Differences): Add reference. Add item on semantic values.
|
||||||
|
Add note about @{ ... @}. Clarify %% epilogue placement.
|
||||||
|
(Java Declarations Summary): New.
|
||||||
|
|
||||||
|
Fix Java skeleton.
|
||||||
|
* data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
|
||||||
|
(b4_remove_comma): Quote test argument.
|
||||||
|
(b4_identification): Remove "bison" field.
|
||||||
|
* tests/java.at (Java parser class and package names): New test.
|
||||||
|
(Java %parse-param and %lex-param): New test.
|
||||||
|
(Java stype, position_class and location_class): New test.
|
||||||
|
|
||||||
|
2008-10-31 Di-an Jan <[email protected]>
|
||||||
|
|
||||||
|
* data/lalr1.jave: Update copyright years.
|
||||||
|
(YYParser): Correct name of "generated from" file in Javadoc:
|
||||||
|
use b4_file_name instead of @ofile@.
|
||||||
|
(Location constructor): Correct Javadoc parameter name.
|
||||||
|
(yylloc): Add missing opening m4 quote after b4_location_if.
|
||||||
|
This removes a stray [ in the Javadoc of Lexer.getStartPos.
|
||||||
|
(Lexer.yyerror): Fix incorrect m4 and Javadoc.
|
||||||
|
(YYParser constructor): Correct Javadoc parameter name.
|
||||||
|
|
||||||
|
2008-10-30 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Always put auxiliary code files in the same dir as other output files.
|
||||||
|
* src/files.c (compute_file_name_parts): When the user specifies
|
||||||
|
--output but not --file-prefix, extract the directory prefix from the
|
||||||
|
file prefix not from the grammar file name. This affects the location
|
||||||
|
of files like location.hh generated by the C++ skeleton. The includes
|
||||||
|
in the other output files require this fix.
|
||||||
|
* tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
|
||||||
|
for expected output files.
|
||||||
|
(Output files): Add a test for the above.
|
||||||
|
|
||||||
|
2008-10-29 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* gnulib: Update submodule to HEAD.
|
||||||
|
|
||||||
|
2008-10-28 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Update copyright year.
|
||||||
|
* src/files.c: Here.
|
||||||
|
|
||||||
|
2008-10-28 Di-an Jan <[email protected]> (tiny change)
|
||||||
|
|
||||||
|
Don't overwrite the input file.
|
||||||
|
* src/files.c (output_file_name_check): Fatal error if using input file
|
||||||
|
for output.
|
||||||
|
* tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
|
||||||
|
argument.
|
||||||
|
(Conflicting output files): Add test.
|
||||||
|
|
||||||
|
2008-10-28 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Space changes.
|
||||||
|
* data/lalr1.cc: Formatting changes.
|
||||||
|
|
||||||
|
2008-10-28 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Don't define debugging functions when !YYDEBUG.
|
||||||
|
* data/lalr1.cc (debug_stream, set_debug_stream)
|
||||||
|
(debug_level_type, debug_level, set_debug_level): Don't
|
||||||
|
declare them when YYDEBUG is not defined.
|
||||||
|
The implementation are already YYDEBUG-aware.
|
||||||
|
|
||||||
|
2008-10-28 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Prefer "continue" for empty loop bodies.
|
||||||
|
* etc/bench.pl.in: Use "continue" instead of {}.
|
||||||
|
|
||||||
|
2008-10-28 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Space and comments changes.
|
||||||
|
* data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
|
||||||
|
* data/c.m4, data/lalr1.cc: Space changes.
|
||||||
|
|
||||||
|
2008-10-28 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Make gnulib a submodule.
|
||||||
|
* gnulib: New.
|
||||||
|
* .gitmodules (gnulib): New.
|
||||||
|
|
||||||
|
2008-10-18 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix yyerror_range for user-defined location type in C++. Reported by
|
||||||
|
Georg Sauthoff at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
|
||||||
|
* data/lalr1.cc (parse): Change type of yyerror_range to location_type.
|
||||||
|
* THANKS (Georg Sauthoff): Add.
|
||||||
|
|
||||||
|
2008-10-18 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Update several administrative files mainly to facilitate releasing.
|
||||||
|
* HACKING (Administrivia): Make the git-merge-changelog notes more
|
||||||
|
helpful.
|
||||||
|
(Test suite): Don't say lalr1.cc is not exercised in the test suite.
|
||||||
|
(Release Procedure): Update for git and add numerous details that were
|
||||||
|
previously missing.
|
||||||
|
* Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
|
||||||
|
* maint.mk (announcement): Don't list bison as a bootstrap tool so
|
||||||
|
that announcements don't claim we bootstrapped with whatever bison
|
||||||
|
happened to be in PATH. Add flex as a bootstrap tool.
|
||||||
|
* Makefile.maint: Remove, previously replaced by maint.mk.
|
||||||
|
* Makefile.cfg: Remove, and migrate settings to...
|
||||||
|
* cfg.mk: ... here for the sake of `make announcement'.
|
||||||
|
* bootstrap.conf (gnulib_modules): Add announce-gen.
|
||||||
|
* README: Say GNU Bison instead of just Bison. Suggested by Karl
|
||||||
|
Berry.
|
||||||
|
|
||||||
|
2008-10-08 Di-an Jan <[email protected]> (tiny change)
|
||||||
|
|
||||||
|
Small but important bugfixes for the Java skeleton.
|
||||||
|
* data/lalr1.java (yyerror): Change Location to b4_location_type.
|
||||||
|
(yy_symbol_print): Call toString on yyvaluep.
|
||||||
|
|
||||||
|
2008-08-29 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Clarify UPDATED use.
|
||||||
|
* doc/bison.texinfo: It refers to the last edition of this file,
|
||||||
|
not to the release date of Bison.
|
||||||
|
Reported by Joel E. Denny.
|
||||||
|
|
||||||
|
2008-08-29 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
* README: Update FAQ pointer.
|
||||||
|
Reported by Joel E. Denny.
|
||||||
|
|
||||||
|
2008-08-27 Eric Blake <[email protected]>
|
||||||
|
|
||||||
|
Resync m4sugar from autoconf.
|
||||||
|
* data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
|
||||||
|
(m4_init): Adjust to latest m4.git changes.
|
||||||
|
(m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
|
||||||
|
effects.
|
||||||
|
* data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
|
||||||
|
(_m4_list_cmp): Reduce side effects.
|
||||||
|
|
||||||
|
2008-08-27 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Check yyerrok in calc.at.
|
||||||
|
* tests/calc.at (calc.y): Use yyerrok on "( error )".
|
||||||
|
(AT_CHECK_CALC): Add a check that ensures that yyerrok works as
|
||||||
|
expected.
|
||||||
|
|
||||||
|
2008-08-27 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
|
Support yyerrok in lalr1.cc.
|
||||||
|
YYBACKUP is still to import back into lalr1.cc.
|
||||||
|
* data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
|
||||||
|
|
||||||
|
2008-08-26 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
For maintainer-check*, don't recompile for a $(VERSION) update.
|
||||||
|
* cfg.mk: New file.
|
||||||
|
(_is-dist-target): Override the one in GNUmakefile.
|
||||||
|
* Makefile.am (EXTRA_DIST): Add cfg.mk.
|
||||||
|
|
||||||
|
2008-08-26 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Update for recent change to gnulib.
|
||||||
|
* src/parse-gram.y: Don't include strverscmp.h. It comes from
|
||||||
|
string.h now.
|
||||||
|
|
||||||
|
2008-08-15 Eric Blake <[email protected]>
|
||||||
|
|
||||||
|
Remaining m4sugar merge from autoconf.
|
||||||
|
* data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
|
||||||
|
* data/m4sugar/foreach.m4: New file, copied from autoconf.
|
||||||
|
* data/Makefile.am (dist_m4sugar_DATA): Distribute it.
|
||||||
|
* src/output.c (output_skeleton): Tell m4 how to find it.
|
||||||
|
|
||||||
|
Partial m4sugar merge from autoconf: m4_map.
|
||||||
|
* data/m4sugar/m4sugar.m4 (m4_fst): Delete.
|
||||||
|
(m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
|
||||||
|
(m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
|
||||||
|
* data/java.m4 (b4_token_enums): Use more efficient short-circuit
|
||||||
|
for empty list.
|
||||||
|
* data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
|
||||||
|
Likewise.
|
||||||
|
(b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
|
||||||
|
declares it.
|
||||||
|
|
||||||
|
2008-08-07 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Keep .version and PACKAGE_VERSION in sync.
|
||||||
|
* Makefile.am ($(top_srcdir)/.version): Declare configure as a
|
||||||
|
dependency, and add comments justifying this in more detail. Discussed
|
||||||
|
starting at
|
||||||
|
<http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
|
||||||
|
|
||||||
|
2008-08-06 Eric Blake <[email protected]>
|
||||||
|
|
||||||
|
Partial m4sugar merge from autoconf: m4_shiftn.
|
||||||
|
* data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
|
||||||
|
(m4_shift2, m4_shift3): New macros.
|
||||||
|
(m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
|
||||||
|
* data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
|
||||||
|
(b4_c_ansi_function_decl, b4_c_function_call): Likewise.
|
||||||
|
* data/java.m4 (b4_remove_comma): Likewise.
|
||||||
|
|
||||||
|
Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
|
||||||
|
* data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
|
||||||
|
(m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
|
||||||
|
(m4_init): Consolidate wrapped text into single m4_wrap.
|
||||||
|
* data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
|
||||||
|
in wrapped text.
|
||||||
|
|
||||||
|
2008-08-05 Eric Blake <[email protected]>
|
||||||
|
|
||||||
|
Partial m4sugar merge from autoconf: builtins, version.m4.
|
||||||
|
* data/m4sugar/m4sugar.m4 (changeword): Nuke.
|
||||||
|
(m4_prepend): Remove, as it is unused and inherently quadratic,
|
||||||
|
whereas m4_append is linear in newer m4.
|
||||||
|
(m4_mkstemp): New builtin.
|
||||||
|
(m4_symbols): Make rename conditional.
|
||||||
|
(m4_version_prereq): Ensure fatal error if used in bison, which
|
||||||
|
intentionally lacks version.m4.
|
||||||
|
|
||||||
|
Fix comments in m4sugar.
|
||||||
|
* data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
|
||||||
|
|
||||||
|
2008-08-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Update for recent .gitignore fix in Gnulib.
|
||||||
|
* bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
|
||||||
|
anchored .gitignore entries.
|
||||||
|
|
||||||
|
2008-08-02 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Set gnu or gnits strictness.
|
||||||
|
* configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
|
||||||
|
development and gnits strictness for releases. Based on Eric Blake's
|
||||||
|
suggestion at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
|
||||||
|
|
||||||
|
2008-07-31 Paolo Bonzini <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Clarify documentation of %language.
|
||||||
|
|
||||||
|
2008-07-31 Paolo Bonzini <[email protected]>
|
||||||
|
|
||||||
|
Support usage of git-merge-changelog.
|
||||||
|
* .gitattributes: New.
|
||||||
|
* HACKING: Document usage of git-merge-changelog.
|
||||||
|
* bootstrap: Install git-merge-changelog entries in .git/config
|
||||||
|
if appropriate.
|
||||||
|
|
||||||
|
2008-07-27 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Remove remaining dependence on CVS Id keyword.
|
||||||
|
* ChangeLog: For the sake of people still using CVS, don't use dollars
|
||||||
|
when mentioning Id.
|
||||||
|
* data/xslt/bison.xsl: Remove Id from header comments, where it was
|
||||||
|
unusual anyway.
|
||||||
|
* data/xslt/xml2dot.xsl: Likewise.
|
||||||
|
* data/xslt/xml2text.xsl: Likewise.
|
||||||
|
* data/xslt/xml2xhtml.xsl: Likewise.
|
||||||
|
* doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
|
||||||
|
* doc/Makefile.am (neutralize): Remove, no longer needed.
|
||||||
|
(.x.1): Don't use neutralize.
|
||||||
|
(edit): Don't substitute for ID.
|
||||||
|
(Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
|
||||||
|
|
||||||
|
2008-07-27 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix dependence on computed configure variables.
|
||||||
|
* doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
|
||||||
|
$(top_srcdir)/configure.ac so that changes to computed variables, such
|
||||||
|
as PACKAGE_VERSION, are seen.
|
||||||
|
* tests/Makefile.am ($(srcdir)/package.m4): Likewise.
|
||||||
|
|
||||||
|
2008-07-20 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Update copyright dates for recent changes.
|
||||||
|
* Makefile.am: Here.
|
||||||
|
* src/Makefile.am: Here.
|
||||||
|
* src/reduce.c: Here.
|
||||||
|
* tests/reduce.at: Here.
|
||||||
|
|
||||||
|
2008-07-18 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Use git-version-gen for version names between releases.
|
||||||
|
* .cvsignore (.tarball-version, GNUmakefile, *~): Add.
|
||||||
|
* .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
|
||||||
|
* .prev-version: New.
|
||||||
|
* .version.in: Remove.
|
||||||
|
* ChangeLog: Remove the Id previously used for capturing the CVS
|
||||||
|
revision.
|
||||||
|
* GNUmakefile: Remove, now copied from Gnulib.
|
||||||
|
* Makefile.am: Add code suggested by comments in
|
||||||
|
build-aux/git-version-gen.
|
||||||
|
(EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
|
||||||
|
.prev-version, and .version.
|
||||||
|
* NEWS (2.3b+): Rename to...
|
||||||
|
(?.?): ... this because we're dropping the "+" version naming scheme,
|
||||||
|
but, in general, we still can't be sure of our next release name.
|
||||||
|
* bootstrap: Add a quick hack to remove from .gitignore the
|
||||||
|
GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
|
||||||
|
entry. This should really be fixed in gnulib instead.
|
||||||
|
* bootstrap.conf (gnulib_modules): Add gnumakefile.
|
||||||
|
* configure.ac (AC_INIT): Set version name by invoking
|
||||||
|
build-aux/git-version-gen.
|
||||||
|
(AC_CONFIG_FILES): Remove .version, now generated by
|
||||||
|
build-aux/git-version-gen.
|
||||||
|
* maint.mk: New, copied from coreutils.
|
||||||
|
* doc/.cvsignore (bison.1): Add.
|
||||||
|
* doc/.gitignore (/bison.1): Add.
|
||||||
|
* doc/bison.1: Remove, generated.
|
||||||
|
* src/.cvsignore (revision.c): Remove.
|
||||||
|
* src/.gitignore (/revision.c): Remove.
|
||||||
|
* src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
|
||||||
|
(BUILT_SOURCES): Remove revision.c.
|
||||||
|
(revision.c): Remove.
|
||||||
|
* src/getargs.c (version): Don't print revision after the VERSION.
|
||||||
|
* src/revision.h: Remove.
|
||||||
|
|
||||||
|
2008-07-16 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix untranslatable composition of sentences. Reported by Goran
|
||||||
|
Uddeborg at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
|
||||||
|
* THANKS (Goran Uddeborg): Add.
|
||||||
|
* src/reduce.c (reduce_print): Report the number of nonterminals and
|
||||||
|
rules useless in the grammar in separate sentences.
|
||||||
|
* tests/reduce.at (Useless Rules): Update output.
|
||||||
|
(Reduced Automaton): Likewise.
|
||||||
|
(Underivable Rules): Likewise.
|
||||||
|
(Empty Language): Likewise.
|
||||||
|
|
||||||
|
2008-07-15 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Fix some .gitignore and .cvsignore problems.
|
||||||
|
* bootstrap (insert_sorted_if_absent): Replace all uses with...
|
||||||
|
(insert_vc_ignore): ... this new function, which prepends `/' to all
|
||||||
|
.gitignore entries before passing them to insert_sorted_if_absent.
|
||||||
|
* bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
|
||||||
|
.cvsignore files are maintained even though Bison developers run
|
||||||
|
bootstrap while using Git.
|
||||||
|
* .cvsignore (*.patch *.log log patches applied): Remove, apparently
|
||||||
|
unneeded by Bison.
|
||||||
|
(gnulib): Add.
|
||||||
|
* .gitignore (/*.patch *.log log patches applied): Remove, broken and
|
||||||
|
unneeded. Reported by Eric Blake.
|
||||||
|
* lib/.gitignore (/*~): Add.
|
||||||
|
* po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
|
||||||
|
* examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
|
||||||
|
Blake.
|
||||||
|
* src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
|
||||||
|
|
||||||
|
2008-07-15 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Improve forward-compatibility with GNU M4. Reported by Eric Blake at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
|
||||||
|
* bootstrap.conf (gnulib_modules): Add unsetenv.
|
||||||
|
* lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
|
||||||
|
* m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
|
||||||
|
(/setenv.m4): Add.
|
||||||
|
* src/output.c (output_skeleton): For the m4 invocation, pass -dV as
|
||||||
|
the first argument because it may become position-dependent, and unset
|
||||||
|
POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
|
||||||
|
Add comments explaining these issues in more detail.
|
||||||
|
|
||||||
|
2008-07-14 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
Add .gitignore everywhere based on .cvsignore.
|
||||||
|
* .gitignore: New.
|
||||||
|
* build-aux/.gitignore: New.
|
||||||
|
* data/.gitignore: New.
|
||||||
|
* doc/.gitignore: New.
|
||||||
|
* etc/.gitignore: New.
|
||||||
|
* examples/.gitignore: New.
|
||||||
|
* examples/calc++/.gitignore: New.
|
||||||
|
* lib/.gitignore: New.
|
||||||
|
* m4/.gitignore: New.
|
||||||
|
* po/.gitignore: New.
|
||||||
|
* runtime-po/.gitignore: New.
|
||||||
|
* src/.gitignore: New.
|
||||||
|
* tests/.gitignore: New.
|
||||||
|
|
||||||
|
2008-05-27 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS (2.3b+): New section, empty for now.
|
||||||
|
* configure.ac (AC_INIT): 2.3b -> 2.3b+.
|
||||||
|
|
||||||
|
2008-05-27 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS (2.3b): Update release date since there has been a delay in
|
||||||
|
getting the announcements and tarballs out.
|
||||||
|
|
||||||
|
2008-05-23 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* NEWS: Version 2.3b.
|
||||||
|
* configure.ac (AC_INIT): Likewise.
|
||||||
|
(PACKAGE_COPYRIGHT_YEAR): Update to 2008.
|
||||||
|
|
||||||
|
2008-05-23 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
|
* HACKING: Don't say don't mention HACKING in the ChangeLog. We've
|
||||||
|
been doing it for years.
|
||||||
|
(Test suite): Mention maintainer-push-check and maintainer-xml-check.
|
||||||
|
(Release Procedure): Add FIXME about make alpha being unmaintained.
|
||||||
|
|
||||||
2008-05-13 Joel E. Denny <[email protected]>
|
2008-05-13 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
* data/yacc.c: Reformat m4 a little for readability.
|
* data/yacc.c: Reformat m4 a little for readability.
|
||||||
@@ -20508,11 +21107,9 @@
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
|
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
|
||||||
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Copying and distribution of this file, with or without
|
Copying and distribution of this file, with or without
|
||||||
modification, are permitted provided the copyright notice and this
|
modification, are permitted provided the copyright notice and this
|
||||||
notice are preserved.
|
notice are preserved.
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|||||||
-71
@@ -1,71 +0,0 @@
|
|||||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
|
||||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
|
||||||
# This makefile is used only if you run GNU Make.
|
|
||||||
# It is necessary if you want to build targets usually of interest
|
|
||||||
# only to the maintainer.
|
|
||||||
|
|
||||||
# Copyright (C) 2001, 2003, 2006-2007, 2008 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
|
||||||
# command below won't work with e.g. stock DOS/Windows shells.
|
|
||||||
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
|
||||||
SHELL = /bin/sh
|
|
||||||
else
|
|
||||||
# will be used only with the next shell-test line, then overwritten
|
|
||||||
# by a configured-in value
|
|
||||||
SHELL = sh
|
|
||||||
endif
|
|
||||||
|
|
||||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
|
||||||
|
|
||||||
# If the user runs GNU make but has not yet run ./configure,
|
|
||||||
# give them a diagnostic.
|
|
||||||
ifeq ($(have-Makefile),yes)
|
|
||||||
|
|
||||||
# Make tar archive easier to reproduce.
|
|
||||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
|
||||||
|
|
||||||
include Makefile
|
|
||||||
|
|
||||||
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
|
||||||
# for others: rerunning autoconf and recompiling everything isn't cheap.
|
|
||||||
ifeq (0,$(MAKELEVEL))
|
|
||||||
_is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
|
|
||||||
ifneq (,$(_is-dist-target))
|
|
||||||
_curr-ver := $(shell build-aux/git-version-gen .version)
|
|
||||||
ifneq ($(_curr-ver),$(VERSION))
|
|
||||||
$(info INFO: rerunning autoconf for new version string: $(_curr-ver))
|
|
||||||
dummy := $(shell rm -rf autom4te.cache; $(AUTOCONF))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(srcdir)/Makefile.cfg
|
|
||||||
include $(srcdir)/Makefile.maint
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
all:
|
|
||||||
@echo There seems to be no Makefile in this directory. 1>&2
|
|
||||||
@echo "You must run ./configure before running \`make'." 1>&2
|
|
||||||
@exit 1
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
|
||||||
# directory in parallel. This is necessary in case someone tries to
|
|
||||||
# build multiple targets on one command line.
|
|
||||||
.NOTPARALLEL:
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
-*- outline -*-
|
-*- outline -*-
|
||||||
|
|
||||||
This file attempts to describe the rules to use when hacking Bison.
|
This file attempts to describe the rules to use when hacking Bison.
|
||||||
Don't put this file into the distribution. Don't mention it in the
|
Don't put this file into the distribution.
|
||||||
ChangeLog.
|
|
||||||
|
|
||||||
Everything related to the development of Bison is on Savannah:
|
Everything related to the development of Bison is on Savannah:
|
||||||
|
|
||||||
@@ -26,6 +25,15 @@ The correct response to most actual bugs is to write a new test case
|
|||||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||||
and check everything in.
|
and check everything in.
|
||||||
|
|
||||||
|
** You may find it useful to install the git-merge-changelog merge driver:
|
||||||
|
|
||||||
|
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/git-merge-changelog.c
|
||||||
|
|
||||||
|
When following the generic installation instructions there, keep in mind that
|
||||||
|
your clone of Bison's git repository already contains appropriate
|
||||||
|
.gitattributes files, and running Bison's bootstrap script will make the
|
||||||
|
necessary changes to .git/config.
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
* Hacking
|
||||||
|
|
||||||
@@ -57,11 +65,22 @@ release:
|
|||||||
- runs the parsers under Valgrind.
|
- runs the parsers under Valgrind.
|
||||||
- runs the test suite with G++ as C compiler...
|
- runs the test suite with G++ as C compiler...
|
||||||
|
|
||||||
|
- run `make maintainer-push-check', which runs `make maintainer-check'
|
||||||
|
while activating the push implementation and its pull interface wrappers
|
||||||
|
in many test cases that were originally written to exercise only the
|
||||||
|
pull implementation. This makes certain the push implementation can
|
||||||
|
perform every task the pull implementation can.
|
||||||
|
|
||||||
|
- run `make maintainer-xml-check', which runs `make maintainer-check'
|
||||||
|
while checking Bison's XML automaton report for every working grammar
|
||||||
|
passed to Bison in the test suite. The check just diffs the output of
|
||||||
|
Bison's included XSLT style sheets with the output of --report=all and
|
||||||
|
--graph.
|
||||||
|
|
||||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||||
instance, `-traditional' to check that the parsers are K&R. Note
|
instance, `-traditional' to check that the parsers are K&R. Note
|
||||||
that it does not make sense for glr.c, which should be ANSI,
|
that it does not make sense for glr.c, which should be ANSI,
|
||||||
but currently is actually GNU C, nor for lalr1.cc, which anyway is
|
but currently is actually GNU C, nor for lalr1.cc.
|
||||||
not exercised yet in the test suite.
|
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
@@ -78,15 +97,39 @@ This covers PO files too. Sometimes a PO file contains problems that
|
|||||||
causes it to be rejected by recent Gettext releases; please report
|
causes it to be rejected by recent Gettext releases; please report
|
||||||
these to the Translation Project.
|
these to the Translation Project.
|
||||||
|
|
||||||
|
** Update README
|
||||||
|
Make sure the information in this file is current. Most notably, make sure it
|
||||||
|
recommends a version of GNU M4 that is compatible with the latest Bison
|
||||||
|
sources.
|
||||||
|
|
||||||
** Update NEWS
|
** Update NEWS
|
||||||
The version number, *and* the date of the release (including for
|
The version number, *and* the date of the release (including for
|
||||||
betas).
|
betas).
|
||||||
|
|
||||||
** Update ChangeLog
|
** Update ChangeLog
|
||||||
Should have an entry similar to `Version 1.49b.'.
|
Should have an entry similar to `Version 1.49b.'.
|
||||||
Check all this in once `make distcheck' passes.
|
|
||||||
|
** Update configure.ac
|
||||||
|
Be sure PACKAGE_COPYRIGHT_YEAR is up-to-date.
|
||||||
|
|
||||||
|
** Tag the release
|
||||||
|
Before Bison will build with the right version number, you must tag the release
|
||||||
|
in git. Do this after all other changes. The command is similar to:
|
||||||
|
|
||||||
|
git tag -a v2.3b
|
||||||
|
|
||||||
|
The log message can be simply:
|
||||||
|
|
||||||
|
Bison 2.3b
|
||||||
|
|
||||||
|
** Push
|
||||||
|
Once `make distcheck' passes, push your changes and the tag.
|
||||||
|
`git push' without arguments will not push the tag.
|
||||||
|
|
||||||
** make alpha
|
** make alpha
|
||||||
|
FIXME: `make alpha' is not maintained and is broken. These
|
||||||
|
instructions need to be replaced or removed.
|
||||||
|
|
||||||
Running `make alpha' is absolutely perfect for beta releases: it makes
|
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||||
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||||
announcement. It is so neat, that that's what I use anyway for
|
announcement. It is so neat, that that's what I use anyway for
|
||||||
@@ -98,13 +141,39 @@ If it fails, you're on your own...
|
|||||||
It requires GNU Make.
|
It requires GNU Make.
|
||||||
|
|
||||||
** Upload
|
** Upload
|
||||||
Put the tarballs/xdeltas where they should be. Or put it somewhere,
|
The generic GNU upload procedure is at:
|
||||||
and send the URL to [email protected].
|
|
||||||
|
|
||||||
** Bump the version number
|
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
||||||
In configure.ac. Run `make', check this in.
|
|
||||||
|
After following the instructions there to register your information so you're
|
||||||
|
permitted to upload, here's a brief reminder of how to roll the tarballs and
|
||||||
|
upload them:
|
||||||
|
|
||||||
|
*** make distcheck
|
||||||
|
*** gpg -b bison-2.3b.tar.gz
|
||||||
|
*** In a file named `bison-2.3b.tar.gz.directive', type:
|
||||||
|
|
||||||
|
version: 1.1
|
||||||
|
directory: bison
|
||||||
|
filename: bison-2.3b.tar.gz
|
||||||
|
|
||||||
|
*** gpg --clearsign bison-2.3b.tar.gz.directive
|
||||||
|
*** ftp ftp-upload.gnu.org # Log in as anonymous.
|
||||||
|
*** cd /incoming/alpha # cd /incoming/ftp for full release.
|
||||||
|
*** put bison-2.3b.tar.gz # This can take a while.
|
||||||
|
*** put bison-2.3b.tar.gz.sig
|
||||||
|
*** put bison-2.3b.tar.gz.directive.asc
|
||||||
|
*** Repeat all these steps for bison-2.3b.tar.bz2.
|
||||||
|
|
||||||
** Announce
|
** Announce
|
||||||
|
To generate a template announcement file:
|
||||||
|
|
||||||
|
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||||
|
|
||||||
|
where alpha can be replaced by beta or major and F125BDF3 should be replaced
|
||||||
|
with your key ID. For an example of how to fill out the template, search the
|
||||||
|
mailing list archives for the most recent release announcement.
|
||||||
|
|
||||||
Complete/fix the announcement file, and send it at least to
|
Complete/fix the announcement file, and send it at least to
|
||||||
[email protected] (if a real release, or a ``serious beta''),
|
[email protected] (if a real release, or a ``serious beta''),
|
||||||
[email protected], [email protected], [email protected],
|
[email protected], [email protected], [email protected],
|
||||||
@@ -115,6 +184,14 @@ email to [email protected]. Do not make any Cc as the moderator will
|
|||||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||||
separate message.
|
separate message.
|
||||||
|
|
||||||
|
** Bump the version number
|
||||||
|
In configure.ac. Run `make'. So that developers don't accidentally add new
|
||||||
|
items to the old NEWS entry, create a new empty NEWS entry something like:
|
||||||
|
|
||||||
|
Changes in version ?.? (????-??-??):
|
||||||
|
|
||||||
|
Push these changes.
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
+17
-2
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
## Foundation, Inc.
|
## Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -23,7 +23,7 @@ SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
|||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
EXTRA_DIST = .prev-version .version cfg.mk maint.mk \
|
||||||
OChangeLog PACKAGING \
|
OChangeLog PACKAGING \
|
||||||
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||||
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||||
@@ -42,3 +42,18 @@ maintainer-push-check:
|
|||||||
.PHONY: maintainer-xml-check
|
.PHONY: maintainer-xml-check
|
||||||
maintainer-xml-check:
|
maintainer-xml-check:
|
||||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||||
|
|
||||||
|
# See comments in build-aux/git-version-gen. However, we make .version depend
|
||||||
|
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
||||||
|
# working copy (for example, when you run autoreconf && make). Allowing these
|
||||||
|
# to fall out of sync appears to have little potential to improve Bison build
|
||||||
|
# efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version
|
||||||
|
# everywhere possible). On the other hand, it could be harmful. For example,
|
||||||
|
# a developer might naively reference .version in a test case while the bison
|
||||||
|
# executable still compiles with VERSION, and so the test case might fail or
|
||||||
|
# pass incorrectly.
|
||||||
|
BUILT_SOURCES = $(top_srcdir)/.version
|
||||||
|
$(top_srcdir)/.version: configure
|
||||||
|
echo $(VERSION) > $@-t && mv $@-t $@
|
||||||
|
dist-hook:
|
||||||
|
echo $(VERSION) > $(distdir)/.tarball-version
|
||||||
|
|||||||
-637
@@ -1,637 +0,0 @@
|
|||||||
# -*-Makefile-*-
|
|
||||||
# This Makefile fragment is shared between the coreutils,
|
|
||||||
# CPPI, Bison, and Autoconf.
|
|
||||||
|
|
||||||
## Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# 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
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# This is reported not to work with make-3.79.1
|
|
||||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
|
||||||
ME := Makefile.maint
|
|
||||||
|
|
||||||
# Do not save the original name or timestamp in the .tar.gz file.
|
|
||||||
# Use --rsyncable if available.
|
|
||||||
gzip_rsyncable = \
|
|
||||||
(gzip --help|grep rsyncable) >/dev/null 2>&1 && echo --rsyncable
|
|
||||||
GZIP_ENV = "--no-name --best `$(gzip_rsyncable)`"
|
|
||||||
|
|
||||||
CVS = cvs
|
|
||||||
|
|
||||||
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
|
|
||||||
CVS_LIST = sh -c ' \
|
|
||||||
if test -x $(srcdir)/build-aux/cvsu; then \
|
|
||||||
$(srcdir)/build-aux/cvsu --find --types=AFGM $$*; \
|
|
||||||
else \
|
|
||||||
awk -F/ '\''{ \
|
|
||||||
if (!$$1 && $$3 !~ /^-/) { \
|
|
||||||
f=FILENAME; \
|
|
||||||
sub(/CVS\/Entries/, "", f); \
|
|
||||||
print f $$2; \
|
|
||||||
}}'\'' \
|
|
||||||
$$(find $${*-*} -name Entries -print) /dev/null; \
|
|
||||||
fi \
|
|
||||||
' dummy
|
|
||||||
|
|
||||||
CVS_LIST_EXCEPT = \
|
|
||||||
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
|
||||||
|
|
||||||
ifeq ($(origin prev_version_file), undefined)
|
|
||||||
prev_version_file = .prev-version
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
|
||||||
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
|
||||||
|
|
||||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
|
||||||
tag-this-version = $(subst .,_,$(VERSION))
|
|
||||||
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
|
||||||
my_distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
# Old releases are stored here.
|
|
||||||
# Used for diffs and xdeltas.
|
|
||||||
release_archive_dir ?= ../release
|
|
||||||
|
|
||||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
|
||||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
|
||||||
export LC_ALL = C
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------- ##
|
|
||||||
## Sanity checks. ##
|
|
||||||
## --------------- ##
|
|
||||||
|
|
||||||
# FIXME: add a check to prohibit definition in src/*.c of symbols defined
|
|
||||||
# in system.h. E.g. today I removed from tail.c a useless definition of
|
|
||||||
# ENOSYS. It was useless because system.h ensures it's defined.
|
|
||||||
|
|
||||||
# Checks that don't require cvs.
|
|
||||||
# Run `changelog-check' last, as previous test may reveal problems requiring
|
|
||||||
# new ChangeLog entries.
|
|
||||||
local-checks-available = \
|
|
||||||
po-check copyright-check writable-files m4-check author_mark_check \
|
|
||||||
changelog-check strftime-check $(syntax-check-rules) \
|
|
||||||
makefile_path_separator_check \
|
|
||||||
makefile-check
|
|
||||||
.PHONY: $(local-checks-available)
|
|
||||||
|
|
||||||
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
|
||||||
|
|
||||||
.PHONY: $(syntax-check-rules)
|
|
||||||
syntax-check-rules = \
|
|
||||||
sc_cast_of_argument_to_free \
|
|
||||||
sc_cast_of_x_alloc_return_value \
|
|
||||||
sc_cast_of_alloca_return_value \
|
|
||||||
sc_changelog \
|
|
||||||
sc_dd_max_sym_length \
|
|
||||||
sc_error_exit_success \
|
|
||||||
sc_file_system \
|
|
||||||
sc_no_if_have_config_h \
|
|
||||||
sc_obsolete_symbols \
|
|
||||||
sc_prohibit_atoi_atof \
|
|
||||||
sc_prohibit_jm_in_m4 \
|
|
||||||
sc_prohibit_assert_without_use \
|
|
||||||
sc_require_config_h \
|
|
||||||
sc_root_tests \
|
|
||||||
sc_space_tab \
|
|
||||||
sc_sun_os_names \
|
|
||||||
sc_system_h_headers \
|
|
||||||
sc_tight_scope \
|
|
||||||
sc_trailing_blank \
|
|
||||||
sc_two_space_separator_in_usage \
|
|
||||||
sc_unmarked_diagnostics \
|
|
||||||
sc_useless_cpp_parens
|
|
||||||
|
|
||||||
syntax-check: $(syntax-check-rules)
|
|
||||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
|
||||||
# $$(find -type f -name '*.[chly]') && \
|
|
||||||
# { echo '$(ME): found conditional include' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
|
|
||||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
|
||||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
# { echo '$(ME): FIXME' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
|
||||||
|
|
||||||
sc_cast_of_argument_to_free:
|
|
||||||
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
|
||||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_x_alloc_return_value:
|
|
||||||
@grep -nE --exclude=$(srcdir)/lib/regex.c \
|
|
||||||
'\*\) *x(m|c|re)alloc\>' \
|
|
||||||
$(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_alloca_return_value:
|
|
||||||
@grep -nE '\*\) *alloca\>' \
|
|
||||||
$(srcdir)/src/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_space_tab:
|
|
||||||
@grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Don't use the old ato* functions in `real' code.
|
|
||||||
# They provide no error checking mechanism.
|
|
||||||
# Instead, use strto* functions.
|
|
||||||
sc_prohibit_atoi_atof:
|
|
||||||
@grep -nE '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
|
||||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
|
||||||
sc_error_exit_success:
|
|
||||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
|
||||||
$$(find -type f -name '*.[chly]') && \
|
|
||||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_file_system:
|
|
||||||
@grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found use of "file''system";' \
|
|
||||||
'rewrite to use "file system"' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_no_if_have_config_h:
|
|
||||||
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Nearly all .c files must include <config.h>.
|
|
||||||
sc_require_config_h:
|
|
||||||
@grep -L '^# *include <config\.h>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
|
|
||||||
| grep . && \
|
|
||||||
{ echo '$(ME): the above files do not include <config.h>' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Prohibit the inclusion of assert.h without an actual use of assert.
|
|
||||||
sc_prohibit_assert_without_use:
|
|
||||||
@files=$$(grep -l '# *include <assert\.h>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
|
||||||
grep -L '\<assert (' $$files \
|
|
||||||
| grep . && \
|
|
||||||
{ echo "$(ME): the above files include <assert.h> but don't use it" \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
sc_obsolete_symbols:
|
|
||||||
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
|
||||||
|
|
||||||
# Each nonempty line must start with a year number, or a TAB.
|
|
||||||
sc_changelog:
|
|
||||||
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
|
||||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
|
||||||
# with the strings from the two affected variables.
|
|
||||||
dd_c = $(srcdir)/src/dd.c
|
|
||||||
sc_dd_max_sym_length:
|
|
||||||
ifneq ($(wildcard $(dd_c)),)
|
|
||||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
|
||||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
|
||||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
|
||||||
| wc --max-line-length); \
|
|
||||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
|
||||||
|tr -d '"' | wc --max-line-length); \
|
|
||||||
if test "$$len" = "$$max"; then :; else \
|
|
||||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Many m4 macros names once began with `jm_'.
|
|
||||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
|
||||||
# Make sure that none are inadvertently reintroduced.
|
|
||||||
sc_prohibit_jm_in_m4:
|
|
||||||
@grep -nE 'jm_[A-Z]' \
|
|
||||||
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
|
|
||||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
sc_root_tests:
|
|
||||||
@t1=sc-root.expected; t2=sc-root.actual; \
|
|
||||||
grep -nl '^PRIV_CHECK_ARG=require-root' \
|
|
||||||
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
|
||||||
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
|
||||||
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
|
||||||
diff -u $$t1 $$t2 || diff=1; \
|
|
||||||
rm -f $$t1 $$t2; \
|
|
||||||
test "$$diff" \
|
|
||||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Create a list of regular expressions matching the names
|
|
||||||
# of files included from system.h. Exclude a couple.
|
|
||||||
.re-list:
|
|
||||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
|
||||||
| grep -Ev 'sys/(param|file)\.h' \
|
|
||||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
|
||||||
> $@-t
|
|
||||||
@mv $@-t $@
|
|
||||||
|
|
||||||
# Files in src/ should not include directly any of
|
|
||||||
# the headers already included via system.h.
|
|
||||||
sc_system_h_headers: .re-list
|
|
||||||
@if test -f $(srcdir)/src/system.h; then \
|
|
||||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
|
||||||
grep -nE -f .re-list \
|
|
||||||
$$($(CVS_LIST) src | \
|
|
||||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
|
||||||
&& { echo '$(ME): the above are already included via system.h'\
|
|
||||||
1>&2; exit 1; } || :; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
sc_sun_os_names:
|
|
||||||
@grep -nEi \
|
|
||||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_tight_scope:
|
|
||||||
$(MAKE) -C src $@
|
|
||||||
|
|
||||||
sc_trailing_blank:
|
|
||||||
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found trailing blank(s)' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
sc_two_space_separator_in_usage:
|
|
||||||
@grep -n '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo "$(ME): help2man requires at least two spaces between"; \
|
|
||||||
echo "$(ME): an option and its description"; \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Look for diagnostics that aren't marked for translation.
|
|
||||||
# This won't find any for which error's format string is on a separate line.
|
|
||||||
sc_unmarked_diagnostics:
|
|
||||||
@grep -nE \
|
|
||||||
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
|
|
||||||
| grep -v '_''(' && \
|
|
||||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Avoid useless parentheses like those in this example:
|
|
||||||
# #if defined (SYMBOL) || defined (SYM2)
|
|
||||||
sc_useless_cpp_parens:
|
|
||||||
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found useless parentheses in cpp directive' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that date's --help output stays in sync with the info
|
|
||||||
# documentation for GNU strftime. The only exception is %N,
|
|
||||||
# which date accepts but GNU strftime does not.
|
|
||||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
|
||||||
strftime-check:
|
|
||||||
if test -f $(srcdir)/src/date.c; then \
|
|
||||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
|
||||||
| $(extract_char) > $@-src; \
|
|
||||||
{ echo N; \
|
|
||||||
info libc date calendar format | grep '^ `%.'\' \
|
|
||||||
| $(extract_char); } | sort > $@-info; \
|
|
||||||
diff -u $@-src $@-info || exit 1; \
|
|
||||||
rm -f $@-src $@-info; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure that we use only the standard $(VAR) notation,
|
|
||||||
# not @...@ in Makefile.am, now that we can rely on automake
|
|
||||||
# to emit a definition for each substituted variable.
|
|
||||||
makefile-check:
|
|
||||||
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
|
||||||
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
news-date-check: NEWS
|
|
||||||
today=`date +%Y-%m-%d`; \
|
|
||||||
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
|
||||||
>/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "version or today's date is not in NEWS" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
changelog-check:
|
|
||||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
|
||||||
>/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
m4-check:
|
|
||||||
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
|
||||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
|
||||||
# FIXME: don't hard-code file names below; use a more general mechanism.
|
|
||||||
po-check:
|
|
||||||
if test -f po/POTFILES.in; then \
|
|
||||||
grep -E -v '^(#|$$)' po/POTFILES.in \
|
|
||||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
|
||||||
files=; \
|
|
||||||
for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
|
|
||||||
case $$file in \
|
|
||||||
djgpp/* | man/*) continue;; \
|
|
||||||
esac; \
|
|
||||||
case $$file in \
|
|
||||||
*.[ch]) \
|
|
||||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
|
||||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
|
||||||
esac; \
|
|
||||||
files="$$files $$file"; \
|
|
||||||
done; \
|
|
||||||
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > $@-2; \
|
|
||||||
diff -u $@-1 $@-2 || exit 1; \
|
|
||||||
rm -f $@-1 $@-2; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
|
||||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
|
||||||
# gettext recognizes it as a string requiring translation.
|
|
||||||
author_mark_check:
|
|
||||||
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
|
||||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Sometimes it is useful to change the PATH environment variable
|
|
||||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
|
||||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
|
||||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
|
||||||
# and there probably aren't many projects with so many Makefile.am files
|
|
||||||
# that we'd have to worry about limits on command line length.
|
|
||||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
|
||||||
makefile_path_separator_check:
|
|
||||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
|
||||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Check that `make alpha' will not fail at the end of the process.
|
|
||||||
writable-files:
|
|
||||||
if test -d $(release_archive_dir); then :; else \
|
|
||||||
mkdir $(release_archive_dir); \
|
|
||||||
fi
|
|
||||||
for file in $(distdir).tar.gz $(xd-delta) \
|
|
||||||
$(release_archive_dir)/$(distdir).tar.gz \
|
|
||||||
$(release_archive_dir)/$(xd-delta); do \
|
|
||||||
test -e $$file || continue; \
|
|
||||||
test -w $$file \
|
|
||||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1 || :
|
|
||||||
|
|
||||||
v_etc_file = lib/version-etc.c
|
|
||||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
|
||||||
copyright-check:
|
|
||||||
@if test -f $(v_etc_file); then \
|
|
||||||
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
|
||||||
>/dev/null \
|
|
||||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
|
||||||
exit 1; }; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Sanity checks with the CVS repository.
|
|
||||||
cvs-tag-check:
|
|
||||||
echo $(this-cvs-tag); \
|
|
||||||
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
|
|
||||||
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
else :; fi
|
|
||||||
|
|
||||||
cvs-diff-check:
|
|
||||||
if $(CVS) diff >cvs-diffs; then \
|
|
||||||
rm cvs-diffs; \
|
|
||||||
else \
|
|
||||||
echo "Some files are locally modified:" 1>&2; \
|
|
||||||
cat cvs-diffs; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
cvs-check: cvs-diff-check cvs-tag-check
|
|
||||||
|
|
||||||
maintainer-distcheck: changelog-check
|
|
||||||
$(MAKE) distcheck
|
|
||||||
$(MAKE) my-distcheck
|
|
||||||
|
|
||||||
|
|
||||||
# Tag before making distribution. Also, don't make a distribution if
|
|
||||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
|
||||||
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
|
||||||
cvs-dist: $(local-check) cvs-check maintainer-distcheck
|
|
||||||
$(CVS) update po
|
|
||||||
$(CVS) tag -c $(this-cvs-tag)
|
|
||||||
$(MAKE) dist
|
|
||||||
|
|
||||||
# Use this to make sure we don't run these programs when building
|
|
||||||
# from a virgin tgz file, below.
|
|
||||||
null_AM_MAKEFLAGS = \
|
|
||||||
ACLOCAL=false \
|
|
||||||
AUTOCONF=false \
|
|
||||||
AUTOMAKE=false \
|
|
||||||
AUTOHEADER=false \
|
|
||||||
MAKEINFO=false
|
|
||||||
|
|
||||||
# Detect format-string/arg-list mismatches that would normally be obscured
|
|
||||||
# by the use of _(). The --disable-nls effectively defines away that macro,
|
|
||||||
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
|
||||||
# treated as a failure. Also, check for shadowing problems with -Wshadow.
|
|
||||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
|
||||||
# have to have a recent version of gcc and glibc headers.
|
|
||||||
TMPDIR ?= /tmp
|
|
||||||
t=$(TMPDIR)/$(PACKAGE)/test
|
|
||||||
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
|
||||||
-rm -rf $(t)
|
|
||||||
mkdir -p $(t)
|
|
||||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
|
||||||
cd $(t)/$(distdir) \
|
|
||||||
&& ./configure --disable-nls \
|
|
||||||
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
|
|
||||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
|
||||||
&& $(MAKE) dvi \
|
|
||||||
&& $(MAKE) check \
|
|
||||||
&& $(MAKE) distclean
|
|
||||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
|
||||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
|
||||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
|
||||||
-rm -rf $(t)
|
|
||||||
@echo "========================"; \
|
|
||||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
|
||||||
echo "========================"
|
|
||||||
|
|
||||||
WGET = wget
|
|
||||||
WGETFLAGS = -C off
|
|
||||||
|
|
||||||
rel-check:
|
|
||||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
|
||||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
|
||||||
set -e; \
|
|
||||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
|
||||||
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
|
||||||
echo "$(md5) -" > $$md5_tmp; \
|
|
||||||
md5sum -c $$md5_tmp < $$tarz
|
|
||||||
|
|
||||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
|
||||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
|
||||||
|
|
||||||
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
|
||||||
announcement: NEWS ChangeLog $(rel-files)
|
|
||||||
@./announce-gen \
|
|
||||||
--release-type=$(RELEASE_TYPE) \
|
|
||||||
--package=$(PACKAGE) \
|
|
||||||
--prev=$(PREV_VERSION) \
|
|
||||||
--curr=$(VERSION) \
|
|
||||||
--release-archive-directory=$(release_archive_dir) \
|
|
||||||
--gpg-key-id=$(gpg_key_ID) \
|
|
||||||
--news=NEWS \
|
|
||||||
$(addprefix --url-dir=, $(url_dir_list)) \
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Updating files. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
|
||||||
www-gnu = http://www.gnu.org
|
|
||||||
|
|
||||||
# Use mv, if you don't have/want move-if-change.
|
|
||||||
move_if_change ?= move-if-change
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------- #
|
|
||||||
# Updating everything. #
|
|
||||||
# --------------------- #
|
|
||||||
|
|
||||||
.PHONY: update
|
|
||||||
local_updates ?= wget-update cvs-update po-update
|
|
||||||
update: $(local_updates)
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------- #
|
|
||||||
# Updating PO files. #
|
|
||||||
# ------------------- #
|
|
||||||
|
|
||||||
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
|
|
||||||
.PHONY: do-po-update po-update
|
|
||||||
do-po-update:
|
|
||||||
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
|
||||||
rm -rf $$tmppo && \
|
|
||||||
mkdir $$tmppo && \
|
|
||||||
(cd $$tmppo && \
|
|
||||||
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
|
||||||
cp $$tmppo/*.po po
|
|
||||||
cd po && $(MAKE) update-po
|
|
||||||
$(MAKE) po-check
|
|
||||||
|
|
||||||
po-update:
|
|
||||||
if test -d "po"; then \
|
|
||||||
$(MAKE) do-po-update; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -------------------------- #
|
|
||||||
# Updating GNU build tools. #
|
|
||||||
# -------------------------- #
|
|
||||||
|
|
||||||
# The following pseudo table associates a local directory and a URL
|
|
||||||
# with each of the files that belongs to some other package and is
|
|
||||||
# regularly updated from the specified URL.
|
|
||||||
wget_files ?= \
|
|
||||||
$(srcdir)/build-aux/config.guess \
|
|
||||||
$(srcdir)/build-aux/config.sub \
|
|
||||||
$(srcdir)/build-aux/texinfo.tex \
|
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
|
|
||||||
get-targets = $(patsubst %, get-%, $(wget_files))
|
|
||||||
|
|
||||||
config.guess-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
config.sub-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
|
|
||||||
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
|
||||||
|
|
||||||
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
|
||||||
|
|
||||||
standards.texi-url_prefix = $(www-gnu)/prep/
|
|
||||||
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
|
|
||||||
|
|
||||||
target = $(patsubst get-%, %, $@)
|
|
||||||
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
|
||||||
|
|
||||||
.PHONY: $(get-targets)
|
|
||||||
$(get-targets):
|
|
||||||
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
|
|
||||||
&& $(move_if_change) $(target).t $(target)
|
|
||||||
|
|
||||||
cvs_files ?= \
|
|
||||||
$(srcdir)/build-aux/depcomp \
|
|
||||||
$(srcdir)/build-aux/install-sh \
|
|
||||||
$(srcdir)/build-aux/missing \
|
|
||||||
$(srcdir)/build-aux/mkinstalldirs \
|
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
|
||||||
.PHONY: wget-update
|
|
||||||
wget-update: $(get-targets)
|
|
||||||
|
|
||||||
.PHONY: cvs-update
|
|
||||||
cvs-update:
|
|
||||||
fail=; \
|
|
||||||
for f in $(cvs_files); do \
|
|
||||||
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
|
|
||||||
cvs diff $$f > /dev/null \
|
|
||||||
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
|
|
||||||
fail=yes; continue; }; \
|
|
||||||
file=$$(basename $$f); \
|
|
||||||
echo checking out $$file...; \
|
|
||||||
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
|
|
||||||
&& $(move_if_change) $$f.t $$f; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1
|
|
||||||
|
|
||||||
emit_upload_commands:
|
|
||||||
@echo =====================================
|
|
||||||
@echo =====================================
|
|
||||||
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
|
|
||||||
@echo " --to $(gnu_rel_host):coreutils \\"
|
|
||||||
@echo " $(rel-files)"
|
|
||||||
@echo '# send the /tmp/announcement e-mail'
|
|
||||||
@echo =====================================
|
|
||||||
@echo =====================================
|
|
||||||
|
|
||||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
|
||||||
xdelta delta -9 $^ $@ || :
|
|
||||||
|
|
||||||
.PHONY: alpha beta major
|
|
||||||
alpha beta major: news-date-check $(local-check)
|
|
||||||
$(MAKE) cvs-dist
|
|
||||||
$(MAKE) $(xd-delta)
|
|
||||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
|
||||||
ln $(rel-files) $(release_archive_dir)
|
|
||||||
chmod a-w $(rel-files)
|
|
||||||
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
|
||||||
echo $(VERSION) > $(prev_version_file)
|
|
||||||
$(CVS) ci -m. $(prev_version_file)
|
|
||||||
@@ -1,21 +1,61 @@
|
|||||||
Bison News
|
Bison News
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Changes in version 2.3a+ (????-??-??):
|
* Changes in version 2.4.1 (2008-12-11):
|
||||||
|
|
||||||
* The quotes around NAME that used to be required in the following directive
|
** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc
|
||||||
|
declarations have been fixed.
|
||||||
|
|
||||||
|
** Temporary hack for adding a semicolon to the user action.
|
||||||
|
|
||||||
|
Bison used to prepend a trailing semicolon at the end of the user
|
||||||
|
action for reductions. This allowed actions such as
|
||||||
|
|
||||||
|
exp: exp "+" exp { $$ = $1 + $3 };
|
||||||
|
|
||||||
|
instead of
|
||||||
|
|
||||||
|
exp: exp "+" exp { $$ = $1 + $3; };
|
||||||
|
|
||||||
|
Some grammars still depend on this `feature'. Bison 2.4.1 restores
|
||||||
|
the previous behavior in the case of C output (specifically, when
|
||||||
|
neither %language or %skeleton or equivalent command-line options
|
||||||
|
are used) to leave more time for grammars depending on the old
|
||||||
|
behavior to be adjusted. Future releases of Bison will disable this
|
||||||
|
feature.
|
||||||
|
|
||||||
|
** A few minor improvements to the Bison manual.
|
||||||
|
|
||||||
|
* Changes in version 2.4 (2008-11-02):
|
||||||
|
|
||||||
|
** %language is an experimental feature.
|
||||||
|
|
||||||
|
We first introduced this feature in test release 2.3b as a cleaner
|
||||||
|
alternative to %skeleton. Since then, we have discussed the possibility of
|
||||||
|
modifying its effect on Bison's output file names. Thus, in this release,
|
||||||
|
we consider %language to be an experimental feature that will likely evolve
|
||||||
|
in future releases.
|
||||||
|
|
||||||
|
** Forward compatibility with GNU M4 has been improved.
|
||||||
|
|
||||||
|
** Several bugs in the C++ skeleton and the experimental Java skeleton have been
|
||||||
|
fixed.
|
||||||
|
|
||||||
|
* Changes in version 2.3b (2008-05-27):
|
||||||
|
|
||||||
|
** The quotes around NAME that used to be required in the following directive
|
||||||
are now deprecated:
|
are now deprecated:
|
||||||
|
|
||||||
%define NAME "VALUE"
|
%define NAME "VALUE"
|
||||||
|
|
||||||
* The directive `%pure-parser' is now deprecated in favor of:
|
** The directive `%pure-parser' is now deprecated in favor of:
|
||||||
|
|
||||||
%define api.pure
|
%define api.pure
|
||||||
|
|
||||||
which has the same effect except that Bison is more careful to warn about
|
which has the same effect except that Bison is more careful to warn about
|
||||||
unreasonable usage in the latter case.
|
unreasonable usage in the latter case.
|
||||||
|
|
||||||
* Push Parsing
|
** Push Parsing
|
||||||
|
|
||||||
Bison can now generate an LALR(1) parser in C with a push interface. That
|
Bison can now generate an LALR(1) parser in C with a push interface. That
|
||||||
is, instead of invoking `yyparse', which pulls tokens from `yylex', you can
|
is, instead of invoking `yyparse', which pulls tokens from `yylex', you can
|
||||||
@@ -31,11 +71,11 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
The current push parsing interface is experimental and may evolve. More user
|
The current push parsing interface is experimental and may evolve. More user
|
||||||
feedback will help to stabilize it.
|
feedback will help to stabilize it.
|
||||||
|
|
||||||
* The -g and --graph options now output graphs in Graphviz DOT format,
|
** The -g and --graph options now output graphs in Graphviz DOT format,
|
||||||
not VCG format. Like --graph, -g now also takes an optional FILE argument
|
not VCG format. Like --graph, -g now also takes an optional FILE argument
|
||||||
and thus cannot be bundled with other short options.
|
and thus cannot be bundled with other short options.
|
||||||
|
|
||||||
* Java
|
** Java
|
||||||
|
|
||||||
Bison can now generate an LALR(1) parser in Java. The skeleton is
|
Bison can now generate an LALR(1) parser in Java. The skeleton is
|
||||||
`data/lalr1.java'. Consider using the new %language directive instead of
|
`data/lalr1.java'. Consider using the new %language directive instead of
|
||||||
@@ -46,30 +86,30 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
The current Java interface is experimental and may evolve. More user
|
The current Java interface is experimental and may evolve. More user
|
||||||
feedback will help to stabilize it.
|
feedback will help to stabilize it.
|
||||||
|
|
||||||
* %language
|
** %language
|
||||||
|
|
||||||
This new directive specifies the programming language of the generated
|
This new directive specifies the programming language of the generated
|
||||||
parser, which can be C (the default), C++, or Java. This directive affects
|
parser, which can be C (the default), C++, or Java. Besides the skeleton
|
||||||
the skeleton used and the names of the generated files if the grammar file's
|
that Bison uses, the directive affects the names of the generated files if
|
||||||
name ends in ".y".
|
the grammar file's name ends in ".y".
|
||||||
|
|
||||||
* XML Automaton Report
|
** XML Automaton Report
|
||||||
|
|
||||||
Bison can now generate an XML report of the LALR(1) automaton using the new
|
Bison can now generate an XML report of the LALR(1) automaton using the new
|
||||||
`--xml' option. The current XML schema is experimental and may evolve. More
|
`--xml' option. The current XML schema is experimental and may evolve. More
|
||||||
user feedback will help to stabilize it.
|
user feedback will help to stabilize it.
|
||||||
|
|
||||||
* The grammar file may now specify the name of the parser header file using
|
** The grammar file may now specify the name of the parser header file using
|
||||||
%defines. For example:
|
%defines. For example:
|
||||||
|
|
||||||
%defines "parser.h"
|
%defines "parser.h"
|
||||||
|
|
||||||
* When reporting useless rules, useless nonterminals, and unused terminals,
|
** When reporting useless rules, useless nonterminals, and unused terminals,
|
||||||
Bison now employs the terms "useless in grammar" instead of "useless",
|
Bison now employs the terms "useless in grammar" instead of "useless",
|
||||||
"useless in parser" instead of "never reduced", and "unused in grammar"
|
"useless in parser" instead of "never reduced", and "unused in grammar"
|
||||||
instead of "unused".
|
instead of "unused".
|
||||||
|
|
||||||
* Unreachable State Removal
|
** Unreachable State Removal
|
||||||
|
|
||||||
Previously, Bison sometimes generated parser tables containing unreachable
|
Previously, Bison sometimes generated parser tables containing unreachable
|
||||||
states. A state can become unreachable during conflict resolution if Bison
|
states. A state can become unreachable during conflict resolution if Bison
|
||||||
@@ -91,7 +131,7 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
See the %define entry in the `Bison Declaration Summary' in the Bison manual
|
See the %define entry in the `Bison Declaration Summary' in the Bison manual
|
||||||
for further discussion.
|
for further discussion.
|
||||||
|
|
||||||
* Lookahead Set Correction in the `.output' Report
|
** Lookahead Set Correction in the `.output' Report
|
||||||
|
|
||||||
When instructed to generate a `.output' file including lookahead sets
|
When instructed to generate a `.output' file including lookahead sets
|
||||||
(using `--report=lookahead', for example), Bison now prints each reduction's
|
(using `--report=lookahead', for example), Bison now prints each reduction's
|
||||||
@@ -102,17 +142,17 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
bug affected only the `.output' file and not the generated parser source
|
bug affected only the `.output' file and not the generated parser source
|
||||||
code.
|
code.
|
||||||
|
|
||||||
* --report-file=FILE is a new option to override the default `.output' file
|
** --report-file=FILE is a new option to override the default `.output' file
|
||||||
name.
|
name.
|
||||||
|
|
||||||
* The `=' that used to be required in the following directives is now
|
** The `=' that used to be required in the following directives is now
|
||||||
deprecated:
|
deprecated:
|
||||||
|
|
||||||
%file-prefix "parser"
|
%file-prefix "parser"
|
||||||
%name-prefix "c_"
|
%name-prefix "c_"
|
||||||
%output "parser.c"
|
%output "parser.c"
|
||||||
|
|
||||||
* An Alternative to `%{...%}' -- `%code QUALIFIER {CODE}'
|
** An Alternative to `%{...%}' -- `%code QUALIFIER {CODE}'
|
||||||
|
|
||||||
Bison 2.3a provided a new set of directives as a more flexible alternative to
|
Bison 2.3a provided a new set of directives as a more flexible alternative to
|
||||||
the traditional Yacc prologue blocks. Those have now been consolidated into
|
the traditional Yacc prologue blocks. Those have now been consolidated into
|
||||||
@@ -133,7 +173,7 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
The prologue alternatives are experimental. More user feedback will help to
|
The prologue alternatives are experimental. More user feedback will help to
|
||||||
determine whether they should become permanent features.
|
determine whether they should become permanent features.
|
||||||
|
|
||||||
* Revised warning: unset or unused mid-rule values
|
** Revised warning: unset or unused mid-rule values
|
||||||
|
|
||||||
Since Bison 2.2, Bison has warned about mid-rule values that are set but not
|
Since Bison 2.2, Bison has warned about mid-rule values that are set but not
|
||||||
used within any of the actions of the parent rule. For example, Bison warns
|
used within any of the actions of the parent rule. For example, Bison warns
|
||||||
@@ -153,7 +193,7 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
To enable these warnings, specify the option `--warnings=midrule-values' or
|
To enable these warnings, specify the option `--warnings=midrule-values' or
|
||||||
`-W', which is a synonym for `--warnings=all'.
|
`-W', which is a synonym for `--warnings=all'.
|
||||||
|
|
||||||
* Default %destructor or %printer with `<*>' or `<>'
|
** Default %destructor or %printer with `<*>' or `<>'
|
||||||
|
|
||||||
Bison now recognizes two separate kinds of default %destructor's and
|
Bison now recognizes two separate kinds of default %destructor's and
|
||||||
%printer's:
|
%printer's:
|
||||||
@@ -178,25 +218,25 @@ Changes in version 2.3a+ (????-??-??):
|
|||||||
See the section `Freeing Discarded Symbols' in the Bison manual for further
|
See the section `Freeing Discarded Symbols' in the Bison manual for further
|
||||||
details.
|
details.
|
||||||
|
|
||||||
* %left, %right, and %nonassoc can now declare token numbers. This is required
|
** %left, %right, and %nonassoc can now declare token numbers. This is required
|
||||||
by POSIX. However, see the end of section `Operator Precedence' in the Bison
|
by POSIX. However, see the end of section `Operator Precedence' in the Bison
|
||||||
manual for a caveat concerning the treatment of literal strings.
|
manual for a caveat concerning the treatment of literal strings.
|
||||||
|
|
||||||
* The nonfunctional --no-parser, -n, and %no-parser options have been
|
** The nonfunctional --no-parser, -n, and %no-parser options have been
|
||||||
completely removed from Bison.
|
completely removed from Bison.
|
||||||
|
|
||||||
Changes in version 2.3a, 2006-09-13:
|
* Changes in version 2.3a, 2006-09-13:
|
||||||
|
|
||||||
* Instead of %union, you can define and use your own union type
|
** Instead of %union, you can define and use your own union type
|
||||||
YYSTYPE if your grammar contains at least one <type> tag.
|
YYSTYPE if your grammar contains at least one <type> tag.
|
||||||
Your YYSTYPE need not be a macro; it can be a typedef.
|
Your YYSTYPE need not be a macro; it can be a typedef.
|
||||||
This change is for compatibility with other Yacc implementations,
|
This change is for compatibility with other Yacc implementations,
|
||||||
and is required by POSIX.
|
and is required by POSIX.
|
||||||
|
|
||||||
* Locations columns and lines start at 1.
|
** Locations columns and lines start at 1.
|
||||||
In accordance with the GNU Coding Standards and Emacs.
|
In accordance with the GNU Coding Standards and Emacs.
|
||||||
|
|
||||||
* You may now declare per-type and default %destructor's and %printer's:
|
** You may now declare per-type and default %destructor's and %printer's:
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@@ -222,13 +262,13 @@ Changes in version 2.3a, 2006-09-13:
|
|||||||
%destructor's and %printer's were experimental, and they were rewritten in
|
%destructor's and %printer's were experimental, and they were rewritten in
|
||||||
future versions.]
|
future versions.]
|
||||||
|
|
||||||
* Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
|
** Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
|
||||||
`--yacc', or `%yacc'), Bison no longer generates #define statements for
|
`--yacc', or `%yacc'), Bison no longer generates #define statements for
|
||||||
associating token numbers with token names. Removing the #define statements
|
associating token numbers with token names. Removing the #define statements
|
||||||
helps to sanitize the global namespace during preprocessing, but POSIX Yacc
|
helps to sanitize the global namespace during preprocessing, but POSIX Yacc
|
||||||
requires them. Bison still generates an enum for token names in all cases.
|
requires them. Bison still generates an enum for token names in all cases.
|
||||||
|
|
||||||
* Handling of traditional Yacc prologue blocks is now more consistent but
|
** Handling of traditional Yacc prologue blocks is now more consistent but
|
||||||
potentially incompatible with previous releases of Bison.
|
potentially incompatible with previous releases of Bison.
|
||||||
|
|
||||||
As before, you declare prologue blocks in your grammar file with the
|
As before, you declare prologue blocks in your grammar file with the
|
||||||
@@ -247,7 +287,7 @@ Changes in version 2.3a, 2006-09-13:
|
|||||||
Now, Bison never inserts the pre-prologue into the header file. In the code
|
Now, Bison never inserts the pre-prologue into the header file. In the code
|
||||||
file, it always inserts it before the token definitions.
|
file, it always inserts it before the token definitions.
|
||||||
|
|
||||||
* Bison now provides a more flexible alternative to the traditional Yacc
|
** Bison now provides a more flexible alternative to the traditional Yacc
|
||||||
prologue blocks: %before-header, %start-header, %end-header, and
|
prologue blocks: %before-header, %start-header, %end-header, and
|
||||||
%after-header.
|
%after-header.
|
||||||
|
|
||||||
@@ -295,32 +335,32 @@ Changes in version 2.3a, 2006-09-13:
|
|||||||
[Although we failed to mention this here in the 2.3a release, the prologue
|
[Although we failed to mention this here in the 2.3a release, the prologue
|
||||||
alternatives were experimental, and they were rewritten in future versions.]
|
alternatives were experimental, and they were rewritten in future versions.]
|
||||||
|
|
||||||
* The option `--report=look-ahead' has been changed to `--report=lookahead'.
|
** The option `--report=look-ahead' has been changed to `--report=lookahead'.
|
||||||
The old spelling still works, but is not documented and may be removed
|
The old spelling still works, but is not documented and may be removed
|
||||||
in a future release.
|
in a future release.
|
||||||
|
|
||||||
Changes in version 2.3, 2006-06-05:
|
* Changes in version 2.3, 2006-06-05:
|
||||||
|
|
||||||
* GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
|
** GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
|
||||||
for compatibility with LALR(1) grammars.
|
for compatibility with LALR(1) grammars.
|
||||||
|
|
||||||
* It is now documented that any definition of YYSTYPE or YYLTYPE should
|
** It is now documented that any definition of YYSTYPE or YYLTYPE should
|
||||||
be to a type name that does not contain parentheses or brackets.
|
be to a type name that does not contain parentheses or brackets.
|
||||||
|
|
||||||
Changes in version 2.2, 2006-05-19:
|
* Changes in version 2.2, 2006-05-19:
|
||||||
|
|
||||||
* The distribution terms for all Bison-generated parsers now permit
|
** The distribution terms for all Bison-generated parsers now permit
|
||||||
using the parsers in nonfree programs. Previously, this permission
|
using the parsers in nonfree programs. Previously, this permission
|
||||||
was granted only for Bison-generated LALR(1) parsers in C.
|
was granted only for Bison-generated LALR(1) parsers in C.
|
||||||
|
|
||||||
* %name-prefix changes the namespace name in C++ outputs.
|
** %name-prefix changes the namespace name in C++ outputs.
|
||||||
|
|
||||||
* The C++ parsers export their token_type.
|
** The C++ parsers export their token_type.
|
||||||
|
|
||||||
* Bison now allows multiple %union declarations, and concatenates
|
** Bison now allows multiple %union declarations, and concatenates
|
||||||
their contents together.
|
their contents together.
|
||||||
|
|
||||||
* New warning: unused values
|
** New warning: unused values
|
||||||
Right-hand side symbols whose values are not used are reported,
|
Right-hand side symbols whose values are not used are reported,
|
||||||
if the symbols have destructors. For instance:
|
if the symbols have destructors. For instance:
|
||||||
|
|
||||||
@@ -354,26 +394,26 @@ Changes in version 2.2, 2006-05-19:
|
|||||||
The warning is intended to help catching lost values and memory leaks.
|
The warning is intended to help catching lost values and memory leaks.
|
||||||
If a value is ignored, its associated memory typically is not reclaimed.
|
If a value is ignored, its associated memory typically is not reclaimed.
|
||||||
|
|
||||||
* %destructor vs. YYABORT, YYACCEPT, and YYERROR.
|
** %destructor vs. YYABORT, YYACCEPT, and YYERROR.
|
||||||
Destructors are now called when user code invokes YYABORT, YYACCEPT,
|
Destructors are now called when user code invokes YYABORT, YYACCEPT,
|
||||||
and YYERROR, for all objects on the stack, other than objects
|
and YYERROR, for all objects on the stack, other than objects
|
||||||
corresponding to the right-hand side of the current rule.
|
corresponding to the right-hand side of the current rule.
|
||||||
|
|
||||||
* %expect, %expect-rr
|
** %expect, %expect-rr
|
||||||
Incorrect numbers of expected conflicts are now actual errors,
|
Incorrect numbers of expected conflicts are now actual errors,
|
||||||
instead of warnings.
|
instead of warnings.
|
||||||
|
|
||||||
* GLR, YACC parsers.
|
** GLR, YACC parsers.
|
||||||
The %parse-params are available in the destructors (and the
|
The %parse-params are available in the destructors (and the
|
||||||
experimental printers) as per the documentation.
|
experimental printers) as per the documentation.
|
||||||
|
|
||||||
* Bison now warns if it finds a stray `$' or `@' in an action.
|
** Bison now warns if it finds a stray `$' or `@' in an action.
|
||||||
|
|
||||||
* %require "VERSION"
|
** %require "VERSION"
|
||||||
This specifies that the grammar file depends on features implemented
|
This specifies that the grammar file depends on features implemented
|
||||||
in Bison version VERSION or higher.
|
in Bison version VERSION or higher.
|
||||||
|
|
||||||
* lalr1.cc: The token and value types are now class members.
|
** lalr1.cc: The token and value types are now class members.
|
||||||
The tokens were defined as free form enums and cpp macros. YYSTYPE
|
The tokens were defined as free form enums and cpp macros. YYSTYPE
|
||||||
was defined as a free form union. They are now class members:
|
was defined as a free form union. They are now class members:
|
||||||
tokens are enumerations of the `yy::parser::token' struct, and the
|
tokens are enumerations of the `yy::parser::token' struct, and the
|
||||||
@@ -387,37 +427,37 @@ Changes in version 2.2, 2006-05-19:
|
|||||||
If you wish to update, then make sure older version of Bison will
|
If you wish to update, then make sure older version of Bison will
|
||||||
fail using `%require "2.2"'.
|
fail using `%require "2.2"'.
|
||||||
|
|
||||||
* DJGPP support added.
|
** DJGPP support added.
|
||||||
|
|
||||||
Changes in version 2.1, 2005-09-16:
|
* Changes in version 2.1, 2005-09-16:
|
||||||
|
|
||||||
* The C++ lalr1.cc skeleton supports %lex-param.
|
** The C++ lalr1.cc skeleton supports %lex-param.
|
||||||
|
|
||||||
* Bison-generated parsers now support the translation of diagnostics like
|
** Bison-generated parsers now support the translation of diagnostics like
|
||||||
"syntax error" into languages other than English. The default
|
"syntax error" into languages other than English. The default
|
||||||
language is still English. For details, please see the new
|
language is still English. For details, please see the new
|
||||||
Internationalization section of the Bison manual. Software
|
Internationalization section of the Bison manual. Software
|
||||||
distributors should also see the new PACKAGING file. Thanks to
|
distributors should also see the new PACKAGING file. Thanks to
|
||||||
Bruno Haible for this new feature.
|
Bruno Haible for this new feature.
|
||||||
|
|
||||||
* Wording in the Bison-generated parsers has been changed slightly to
|
** Wording in the Bison-generated parsers has been changed slightly to
|
||||||
simplify translation. In particular, the message "memory exhausted"
|
simplify translation. In particular, the message "memory exhausted"
|
||||||
has replaced "parser stack overflow", as the old message was not
|
has replaced "parser stack overflow", as the old message was not
|
||||||
always accurate for modern Bison-generated parsers.
|
always accurate for modern Bison-generated parsers.
|
||||||
|
|
||||||
* Destructors are now called when the parser aborts, for all symbols left
|
** Destructors are now called when the parser aborts, for all symbols left
|
||||||
behind on the stack. Also, the start symbol is now destroyed after a
|
behind on the stack. Also, the start symbol is now destroyed after a
|
||||||
successful parse. In both cases, the behavior was formerly inconsistent.
|
successful parse. In both cases, the behavior was formerly inconsistent.
|
||||||
|
|
||||||
* When generating verbose diagnostics, Bison-generated parsers no longer
|
** When generating verbose diagnostics, Bison-generated parsers no longer
|
||||||
quote the literal strings associated with tokens. For example, for
|
quote the literal strings associated with tokens. For example, for
|
||||||
a syntax error associated with '%token NUM "number"' they might
|
a syntax error associated with '%token NUM "number"' they might
|
||||||
print 'syntax error, unexpected number' instead of 'syntax error,
|
print 'syntax error, unexpected number' instead of 'syntax error,
|
||||||
unexpected "number"'.
|
unexpected "number"'.
|
||||||
|
|
||||||
Changes in version 2.0, 2004-12-25:
|
* Changes in version 2.0, 2004-12-25:
|
||||||
|
|
||||||
* Possibly-incompatible changes
|
** Possibly-incompatible changes
|
||||||
|
|
||||||
- Bison-generated parsers no longer default to using the alloca function
|
- Bison-generated parsers no longer default to using the alloca function
|
||||||
(when available) to extend the parser stack, due to widespread
|
(when available) to extend the parser stack, due to widespread
|
||||||
@@ -442,7 +482,7 @@ Changes in version 2.0, 2004-12-25:
|
|||||||
|
|
||||||
- NUL bytes are no longer allowed in Bison string literals, unfortunately.
|
- NUL bytes are no longer allowed in Bison string literals, unfortunately.
|
||||||
|
|
||||||
* New features
|
** New features
|
||||||
|
|
||||||
- GLR grammars now support locations.
|
- GLR grammars now support locations.
|
||||||
|
|
||||||
@@ -464,7 +504,7 @@ Changes in version 2.0, 2004-12-25:
|
|||||||
- New configure option --disable-yacc, to disable installation of the
|
- New configure option --disable-yacc, to disable installation of the
|
||||||
yacc command and -ly library introduced in 1.875 for POSIX conformance.
|
yacc command and -ly library introduced in 1.875 for POSIX conformance.
|
||||||
|
|
||||||
* Bug fixes
|
** Bug fixes
|
||||||
|
|
||||||
- For now, %expect-count violations are now just warnings, not errors.
|
- For now, %expect-count violations are now just warnings, not errors.
|
||||||
This is for compatibility with Bison 1.75 and earlier (when there are
|
This is for compatibility with Bison 1.75 and earlier (when there are
|
||||||
@@ -478,12 +518,12 @@ Changes in version 2.0, 2004-12-25:
|
|||||||
|
|
||||||
- Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
|
- Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
|
||||||
|
|
||||||
Changes in version 1.875, 2003-01-01:
|
* Changes in version 1.875, 2003-01-01:
|
||||||
|
|
||||||
* The documentation license has been upgraded to version 1.2
|
** The documentation license has been upgraded to version 1.2
|
||||||
of the GNU Free Documentation License.
|
of the GNU Free Documentation License.
|
||||||
|
|
||||||
* syntax error processing
|
** syntax error processing
|
||||||
|
|
||||||
- In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
|
- In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
|
||||||
locations too. This fixes bugs in error-location computation.
|
locations too. This fixes bugs in error-location computation.
|
||||||
@@ -498,7 +538,7 @@ Changes in version 1.875, 2003-01-01:
|
|||||||
- #defining yyerror to steal internal variables is discouraged.
|
- #defining yyerror to steal internal variables is discouraged.
|
||||||
It is not guaranteed to work forever.
|
It is not guaranteed to work forever.
|
||||||
|
|
||||||
* POSIX conformance
|
** POSIX conformance
|
||||||
|
|
||||||
- Semicolons are once again optional at the end of grammar rules.
|
- Semicolons are once again optional at the end of grammar rules.
|
||||||
This reverts to the behavior of Bison 1.33 and earlier, and improves
|
This reverts to the behavior of Bison 1.33 and earlier, and improves
|
||||||
@@ -531,7 +571,7 @@ Changes in version 1.875, 2003-01-01:
|
|||||||
using typedef instead of defining it as a macro.
|
using typedef instead of defining it as a macro.
|
||||||
For consistency, YYLTYPE is also declared instead of defined.
|
For consistency, YYLTYPE is also declared instead of defined.
|
||||||
|
|
||||||
* Other compatibility issues
|
** Other compatibility issues
|
||||||
|
|
||||||
- %union directives can now have a tag before the `{', e.g., the
|
- %union directives can now have a tag before the `{', e.g., the
|
||||||
directive `%union foo {...}' now generates the C code
|
directive `%union foo {...}' now generates the C code
|
||||||
@@ -550,7 +590,7 @@ Changes in version 1.875, 2003-01-01:
|
|||||||
typedefs or tags; they are no longer documented and are planned to be
|
typedefs or tags; they are no longer documented and are planned to be
|
||||||
withdrawn in a future release.
|
withdrawn in a future release.
|
||||||
|
|
||||||
* GLR parser notes
|
** GLR parser notes
|
||||||
|
|
||||||
- GLR and inline
|
- GLR and inline
|
||||||
Users of Bison have to decide how they handle the portability of the
|
Users of Bison have to decide how they handle the portability of the
|
||||||
@@ -559,32 +599,32 @@ Changes in version 1.875, 2003-01-01:
|
|||||||
- `parsing stack overflow...' -> `parser stack overflow'
|
- `parsing stack overflow...' -> `parser stack overflow'
|
||||||
GLR parsers now report `parser stack overflow' as per the Bison manual.
|
GLR parsers now report `parser stack overflow' as per the Bison manual.
|
||||||
|
|
||||||
* Bison now warns if it detects conflicting outputs to the same file,
|
** Bison now warns if it detects conflicting outputs to the same file,
|
||||||
e.g., it generates a warning for `bison -d -o foo.h foo.y' since
|
e.g., it generates a warning for `bison -d -o foo.h foo.y' since
|
||||||
that command outputs both code and header to foo.h.
|
that command outputs both code and header to foo.h.
|
||||||
|
|
||||||
* #line in output files
|
** #line in output files
|
||||||
- --no-line works properly.
|
- --no-line works properly.
|
||||||
|
|
||||||
* Bison can no longer be built by a K&R C compiler; it requires C89 or
|
** Bison can no longer be built by a K&R C compiler; it requires C89 or
|
||||||
later to be built. This change originally took place a few versions
|
later to be built. This change originally took place a few versions
|
||||||
ago, but nobody noticed until we recently asked someone to try
|
ago, but nobody noticed until we recently asked someone to try
|
||||||
building Bison with a K&R C compiler.
|
building Bison with a K&R C compiler.
|
||||||
|
|
||||||
Changes in version 1.75, 2002-10-14:
|
* Changes in version 1.75, 2002-10-14:
|
||||||
|
|
||||||
* Bison should now work on 64-bit hosts.
|
** Bison should now work on 64-bit hosts.
|
||||||
|
|
||||||
* Indonesian translation thanks to Tedi Heriyanto.
|
** Indonesian translation thanks to Tedi Heriyanto.
|
||||||
|
|
||||||
* GLR parsers
|
** GLR parsers
|
||||||
Fix spurious parse errors.
|
Fix spurious parse errors.
|
||||||
|
|
||||||
* Pure parsers
|
** Pure parsers
|
||||||
Some people redefine yyerror to steal yyparse' private variables.
|
Some people redefine yyerror to steal yyparse' private variables.
|
||||||
Reenable this trick until an official feature replaces it.
|
Reenable this trick until an official feature replaces it.
|
||||||
|
|
||||||
* Type Clashes
|
** Type Clashes
|
||||||
In agreement with POSIX and with other Yaccs, leaving a default
|
In agreement with POSIX and with other Yaccs, leaving a default
|
||||||
action is valid when $$ is untyped, and $1 typed:
|
action is valid when $$ is untyped, and $1 typed:
|
||||||
|
|
||||||
@@ -594,7 +634,7 @@ Changes in version 1.75, 2002-10-14:
|
|||||||
|
|
||||||
typed: ... untyped;
|
typed: ... untyped;
|
||||||
|
|
||||||
* Values of mid-rule actions
|
** Values of mid-rule actions
|
||||||
The following code:
|
The following code:
|
||||||
|
|
||||||
foo: { ... } { $$ = $1; } ...
|
foo: { ... } { $$ = $1; } ...
|
||||||
@@ -602,9 +642,9 @@ Changes in version 1.75, 2002-10-14:
|
|||||||
was incorrectly rejected: $1 is defined in the second mid-rule
|
was incorrectly rejected: $1 is defined in the second mid-rule
|
||||||
action, and is equal to the $$ of the first mid-rule action.
|
action, and is equal to the $$ of the first mid-rule action.
|
||||||
|
|
||||||
Changes in version 1.50, 2002-10-04:
|
* Changes in version 1.50, 2002-10-04:
|
||||||
|
|
||||||
* GLR parsing
|
** GLR parsing
|
||||||
The declaration
|
The declaration
|
||||||
%glr-parser
|
%glr-parser
|
||||||
causes Bison to produce a Generalized LR (GLR) parser, capable of handling
|
causes Bison to produce a Generalized LR (GLR) parser, capable of handling
|
||||||
@@ -615,33 +655,33 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
Unfortunately Bison 1.50 does not work properly on 64-bit hosts
|
Unfortunately Bison 1.50 does not work properly on 64-bit hosts
|
||||||
like the Alpha, so please stick to 32-bit hosts for now.
|
like the Alpha, so please stick to 32-bit hosts for now.
|
||||||
|
|
||||||
* Output Directory
|
** Output Directory
|
||||||
When not in Yacc compatibility mode, when the output file was not
|
When not in Yacc compatibility mode, when the output file was not
|
||||||
specified, running `bison foo/bar.y' created `foo/bar.c'. It
|
specified, running `bison foo/bar.y' created `foo/bar.c'. It
|
||||||
now creates `bar.c'.
|
now creates `bar.c'.
|
||||||
|
|
||||||
* Undefined token
|
** Undefined token
|
||||||
The undefined token was systematically mapped to 2 which prevented
|
The undefined token was systematically mapped to 2 which prevented
|
||||||
the use of 2 by the user. This is no longer the case.
|
the use of 2 by the user. This is no longer the case.
|
||||||
|
|
||||||
* Unknown token numbers
|
** Unknown token numbers
|
||||||
If yylex returned an out of range value, yyparse could die. This is
|
If yylex returned an out of range value, yyparse could die. This is
|
||||||
no longer the case.
|
no longer the case.
|
||||||
|
|
||||||
* Error token
|
** Error token
|
||||||
According to POSIX, the error token must be 256.
|
According to POSIX, the error token must be 256.
|
||||||
Bison extends this requirement by making it a preference: *if* the
|
Bison extends this requirement by making it a preference: *if* the
|
||||||
user specified that one of her tokens is numbered 256, then error
|
user specified that one of her tokens is numbered 256, then error
|
||||||
will be mapped onto another number.
|
will be mapped onto another number.
|
||||||
|
|
||||||
* Verbose error messages
|
** Verbose error messages
|
||||||
They no longer report `..., expecting error or...' for states where
|
They no longer report `..., expecting error or...' for states where
|
||||||
error recovery is possible.
|
error recovery is possible.
|
||||||
|
|
||||||
* End token
|
** End token
|
||||||
Defaults to `$end' instead of `$'.
|
Defaults to `$end' instead of `$'.
|
||||||
|
|
||||||
* Error recovery now conforms to documentation and to POSIX
|
** Error recovery now conforms to documentation and to POSIX
|
||||||
When a Bison-generated parser encounters a syntax error, it now pops
|
When a Bison-generated parser encounters a syntax error, it now pops
|
||||||
the stack until it finds a state that allows shifting the error
|
the stack until it finds a state that allows shifting the error
|
||||||
token. Formerly, it popped the stack until it found a state that
|
token. Formerly, it popped the stack until it found a state that
|
||||||
@@ -651,32 +691,32 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
|
Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
|
||||||
<http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
|
<http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
|
||||||
|
|
||||||
* Traces
|
** Traces
|
||||||
Popped tokens and nonterminals are now reported.
|
Popped tokens and nonterminals are now reported.
|
||||||
|
|
||||||
* Larger grammars
|
** Larger grammars
|
||||||
Larger grammars are now supported (larger token numbers, larger grammar
|
Larger grammars are now supported (larger token numbers, larger grammar
|
||||||
size (= sum of the LHS and RHS lengths), larger LALR tables).
|
size (= sum of the LHS and RHS lengths), larger LALR tables).
|
||||||
Formerly, many of these numbers ran afoul of 16-bit limits;
|
Formerly, many of these numbers ran afoul of 16-bit limits;
|
||||||
now these limits are 32 bits on most hosts.
|
now these limits are 32 bits on most hosts.
|
||||||
|
|
||||||
* Explicit initial rule
|
** Explicit initial rule
|
||||||
Bison used to play hacks with the initial rule, which the user does
|
Bison used to play hacks with the initial rule, which the user does
|
||||||
not write. It is now explicit, and visible in the reports and
|
not write. It is now explicit, and visible in the reports and
|
||||||
graphs as rule 0.
|
graphs as rule 0.
|
||||||
|
|
||||||
* Useless rules
|
** Useless rules
|
||||||
Before, Bison reported the useless rules, but, although not used,
|
Before, Bison reported the useless rules, but, although not used,
|
||||||
included them in the parsers. They are now actually removed.
|
included them in the parsers. They are now actually removed.
|
||||||
|
|
||||||
* Useless rules, useless nonterminals
|
** Useless rules, useless nonterminals
|
||||||
They are now reported, as a warning, with their locations.
|
They are now reported, as a warning, with their locations.
|
||||||
|
|
||||||
* Rules never reduced
|
** Rules never reduced
|
||||||
Rules that can never be reduced because of conflicts are now
|
Rules that can never be reduced because of conflicts are now
|
||||||
reported.
|
reported.
|
||||||
|
|
||||||
* Incorrect `Token not used'
|
** Incorrect `Token not used'
|
||||||
On a grammar such as
|
On a grammar such as
|
||||||
|
|
||||||
%token useless useful
|
%token useless useful
|
||||||
@@ -686,16 +726,16 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
where a token was used to set the precedence of the last rule,
|
where a token was used to set the precedence of the last rule,
|
||||||
bison reported both `useful' and `useless' as useless tokens.
|
bison reported both `useful' and `useless' as useless tokens.
|
||||||
|
|
||||||
* Revert the C++ namespace changes introduced in 1.31
|
** Revert the C++ namespace changes introduced in 1.31
|
||||||
as they caused too many portability hassles.
|
as they caused too many portability hassles.
|
||||||
|
|
||||||
* Default locations
|
** Default locations
|
||||||
By an accident of design, the default computation of @$ was
|
By an accident of design, the default computation of @$ was
|
||||||
performed after another default computation was performed: @$ = @1.
|
performed after another default computation was performed: @$ = @1.
|
||||||
The latter is now removed: YYLLOC_DEFAULT is fully responsible of
|
The latter is now removed: YYLLOC_DEFAULT is fully responsible of
|
||||||
the computation of @$.
|
the computation of @$.
|
||||||
|
|
||||||
* Token end-of-file
|
** Token end-of-file
|
||||||
The token end of file may be specified by the user, in which case,
|
The token end of file may be specified by the user, in which case,
|
||||||
the user symbol is used in the reports, the graphs, and the verbose
|
the user symbol is used in the reports, the graphs, and the verbose
|
||||||
error messages instead of `$end', which remains being the default.
|
error messages instead of `$end', which remains being the default.
|
||||||
@@ -704,22 +744,22 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
or
|
or
|
||||||
%token MYEOF 0 "end of file"
|
%token MYEOF 0 "end of file"
|
||||||
|
|
||||||
* Semantic parser
|
** Semantic parser
|
||||||
This old option, which has been broken for ages, is removed.
|
This old option, which has been broken for ages, is removed.
|
||||||
|
|
||||||
* New translations
|
** New translations
|
||||||
Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
|
Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
|
||||||
Croatian, thanks to Denis Lackovic.
|
Croatian, thanks to Denis Lackovic.
|
||||||
|
|
||||||
* Incorrect token definitions
|
** Incorrect token definitions
|
||||||
When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
|
When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
|
||||||
|
|
||||||
* Token definitions as enums
|
** Token definitions as enums
|
||||||
Tokens are output both as the traditional #define's, and, provided
|
Tokens are output both as the traditional #define's, and, provided
|
||||||
the compiler supports ANSI C or is a C++ compiler, as enums.
|
the compiler supports ANSI C or is a C++ compiler, as enums.
|
||||||
This lets debuggers display names instead of integers.
|
This lets debuggers display names instead of integers.
|
||||||
|
|
||||||
* Reports
|
** Reports
|
||||||
In addition to --verbose, bison supports --report=THINGS, which
|
In addition to --verbose, bison supports --report=THINGS, which
|
||||||
produces additional information:
|
produces additional information:
|
||||||
- itemset
|
- itemset
|
||||||
@@ -731,7 +771,7 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
Bison used to systematically output this information on top of
|
Bison used to systematically output this information on top of
|
||||||
the report. Solved conflicts are now attached to their states.
|
the report. Solved conflicts are now attached to their states.
|
||||||
|
|
||||||
* Type clashes
|
** Type clashes
|
||||||
Previous versions don't complain when there is a type clash on
|
Previous versions don't complain when there is a type clash on
|
||||||
the default action if the rule has a mid-rule action, such as in:
|
the default action if the rule has a mid-rule action, such as in:
|
||||||
|
|
||||||
@@ -741,11 +781,11 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
|
|
||||||
This is fixed.
|
This is fixed.
|
||||||
|
|
||||||
* GNU M4 is now required when using Bison.
|
** GNU M4 is now required when using Bison.
|
||||||
|
|
||||||
Changes in version 1.35, 2002-03-25:
|
* Changes in version 1.35, 2002-03-25:
|
||||||
|
|
||||||
* C Skeleton
|
** C Skeleton
|
||||||
Some projects use Bison's C parser with C++ compilers, and define
|
Some projects use Bison's C parser with C++ compilers, and define
|
||||||
YYSTYPE as a class. The recent adjustment of C parsers for data
|
YYSTYPE as a class. The recent adjustment of C parsers for data
|
||||||
alignment and 64 bit architectures made this impossible.
|
alignment and 64 bit architectures made this impossible.
|
||||||
@@ -758,234 +798,234 @@ Changes in version 1.35, 2002-03-25:
|
|||||||
This kludge also addresses some C++ problems when the stack was
|
This kludge also addresses some C++ problems when the stack was
|
||||||
extended.
|
extended.
|
||||||
|
|
||||||
Changes in version 1.34, 2002-03-12:
|
* Changes in version 1.34, 2002-03-12:
|
||||||
|
|
||||||
* File name clashes are detected
|
** File name clashes are detected
|
||||||
$ bison foo.y -d -o foo.x
|
$ bison foo.y -d -o foo.x
|
||||||
fatal error: header and parser would both be named `foo.x'
|
fatal error: header and parser would both be named `foo.x'
|
||||||
|
|
||||||
* A missing `;' at the end of a rule triggers a warning
|
** A missing `;' at the end of a rule triggers a warning
|
||||||
In accordance with POSIX, and in agreement with other
|
In accordance with POSIX, and in agreement with other
|
||||||
Yacc implementations, Bison will mandate this semicolon in the near
|
Yacc implementations, Bison will mandate this semicolon in the near
|
||||||
future. This eases the implementation of a Bison parser of Bison
|
future. This eases the implementation of a Bison parser of Bison
|
||||||
grammars by making this grammar LALR(1) instead of LR(2). To
|
grammars by making this grammar LALR(1) instead of LR(2). To
|
||||||
facilitate the transition, this release introduces a warning.
|
facilitate the transition, this release introduces a warning.
|
||||||
|
|
||||||
* Revert the C++ namespace changes introduced in 1.31, as they caused too
|
** Revert the C++ namespace changes introduced in 1.31, as they caused too
|
||||||
many portability hassles.
|
many portability hassles.
|
||||||
|
|
||||||
* DJGPP support added.
|
** DJGPP support added.
|
||||||
|
|
||||||
* Fix test suite portability problems.
|
** Fix test suite portability problems.
|
||||||
|
|
||||||
Changes in version 1.33, 2002-02-07:
|
* Changes in version 1.33, 2002-02-07:
|
||||||
|
|
||||||
* Fix C++ issues
|
** Fix C++ issues
|
||||||
Groff could not be compiled for the definition of size_t was lacking
|
Groff could not be compiled for the definition of size_t was lacking
|
||||||
under some conditions.
|
under some conditions.
|
||||||
|
|
||||||
* Catch invalid @n
|
** Catch invalid @n
|
||||||
As is done with $n.
|
As is done with $n.
|
||||||
|
|
||||||
Changes in version 1.32, 2002-01-23:
|
* Changes in version 1.32, 2002-01-23:
|
||||||
|
|
||||||
* Fix Yacc output file names
|
** Fix Yacc output file names
|
||||||
|
|
||||||
* Portability fixes
|
** Portability fixes
|
||||||
|
|
||||||
* Italian, Dutch translations
|
** Italian, Dutch translations
|
||||||
|
|
||||||
Changes in version 1.31, 2002-01-14:
|
* Changes in version 1.31, 2002-01-14:
|
||||||
|
|
||||||
* Many Bug Fixes
|
** Many Bug Fixes
|
||||||
|
|
||||||
* GNU Gettext and %expect
|
** GNU Gettext and %expect
|
||||||
GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
|
GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
|
||||||
Bison dies on incorrect %expectations, we fear there will be
|
Bison dies on incorrect %expectations, we fear there will be
|
||||||
too many bug reports for Gettext, so _for the time being_, %expect
|
too many bug reports for Gettext, so _for the time being_, %expect
|
||||||
does not trigger an error when the input file is named `plural.y'.
|
does not trigger an error when the input file is named `plural.y'.
|
||||||
|
|
||||||
* Use of alloca in parsers
|
** Use of alloca in parsers
|
||||||
If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
|
If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
|
||||||
malloc exclusively. Since 1.29, but was not NEWS'ed.
|
malloc exclusively. Since 1.29, but was not NEWS'ed.
|
||||||
|
|
||||||
alloca is used only when compiled with GCC, to avoid portability
|
alloca is used only when compiled with GCC, to avoid portability
|
||||||
problems as on AIX.
|
problems as on AIX.
|
||||||
|
|
||||||
* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
|
** yyparse now returns 2 if memory is exhausted; formerly it dumped core.
|
||||||
|
|
||||||
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
** When the generated parser lacks debugging code, YYDEBUG is now 0
|
||||||
(as POSIX requires) instead of being undefined.
|
(as POSIX requires) instead of being undefined.
|
||||||
|
|
||||||
* User Actions
|
** User Actions
|
||||||
Bison has always permitted actions such as { $$ = $1 }: it adds the
|
Bison has always permitted actions such as { $$ = $1 }: it adds the
|
||||||
ending semicolon. Now if in Yacc compatibility mode, the semicolon
|
ending semicolon. Now if in Yacc compatibility mode, the semicolon
|
||||||
is no longer output: one has to write { $$ = $1; }.
|
is no longer output: one has to write { $$ = $1; }.
|
||||||
|
|
||||||
* Better C++ compliance
|
** Better C++ compliance
|
||||||
The output parsers try to respect C++ namespaces.
|
The output parsers try to respect C++ namespaces.
|
||||||
[This turned out to be a failed experiment, and it was reverted later.]
|
[This turned out to be a failed experiment, and it was reverted later.]
|
||||||
|
|
||||||
* Reduced Grammars
|
** Reduced Grammars
|
||||||
Fixed bugs when reporting useless nonterminals.
|
Fixed bugs when reporting useless nonterminals.
|
||||||
|
|
||||||
* 64 bit hosts
|
** 64 bit hosts
|
||||||
The parsers work properly on 64 bit hosts.
|
The parsers work properly on 64 bit hosts.
|
||||||
|
|
||||||
* Error messages
|
** Error messages
|
||||||
Some calls to strerror resulted in scrambled or missing error messages.
|
Some calls to strerror resulted in scrambled or missing error messages.
|
||||||
|
|
||||||
* %expect
|
** %expect
|
||||||
When the number of shift/reduce conflicts is correct, don't issue
|
When the number of shift/reduce conflicts is correct, don't issue
|
||||||
any warning.
|
any warning.
|
||||||
|
|
||||||
* The verbose report includes the rule line numbers.
|
** The verbose report includes the rule line numbers.
|
||||||
|
|
||||||
* Rule line numbers are fixed in traces.
|
** Rule line numbers are fixed in traces.
|
||||||
|
|
||||||
* Swedish translation
|
** Swedish translation
|
||||||
|
|
||||||
* Parse errors
|
** Parse errors
|
||||||
Verbose parse error messages from the parsers are better looking.
|
Verbose parse error messages from the parsers are better looking.
|
||||||
Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
|
Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
|
||||||
Now: parse error: unexpected '/', expecting "number" or '-' or '('
|
Now: parse error: unexpected '/', expecting "number" or '-' or '('
|
||||||
|
|
||||||
* Fixed parser memory leaks.
|
** Fixed parser memory leaks.
|
||||||
When the generated parser was using malloc to extend its stacks, the
|
When the generated parser was using malloc to extend its stacks, the
|
||||||
previous allocations were not freed.
|
previous allocations were not freed.
|
||||||
|
|
||||||
* Fixed verbose output file.
|
** Fixed verbose output file.
|
||||||
Some newlines were missing.
|
Some newlines were missing.
|
||||||
Some conflicts in state descriptions were missing.
|
Some conflicts in state descriptions were missing.
|
||||||
|
|
||||||
* Fixed conflict report.
|
** Fixed conflict report.
|
||||||
Option -v was needed to get the result.
|
Option -v was needed to get the result.
|
||||||
|
|
||||||
* %expect
|
** %expect
|
||||||
Was not used.
|
Was not used.
|
||||||
Mismatches are errors, not warnings.
|
Mismatches are errors, not warnings.
|
||||||
|
|
||||||
* Fixed incorrect processing of some invalid input.
|
** Fixed incorrect processing of some invalid input.
|
||||||
|
|
||||||
* Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
|
** Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
|
||||||
|
|
||||||
* Fixed some typos in the documentation.
|
** Fixed some typos in the documentation.
|
||||||
|
|
||||||
* %token MY_EOF 0 is supported.
|
** %token MY_EOF 0 is supported.
|
||||||
Before, MY_EOF was silently renumbered as 257.
|
Before, MY_EOF was silently renumbered as 257.
|
||||||
|
|
||||||
* doc/refcard.tex is updated.
|
** doc/refcard.tex is updated.
|
||||||
|
|
||||||
* %output, %file-prefix, %name-prefix.
|
** %output, %file-prefix, %name-prefix.
|
||||||
New.
|
New.
|
||||||
|
|
||||||
* --output
|
** --output
|
||||||
New, aliasing `--output-file'.
|
New, aliasing `--output-file'.
|
||||||
|
|
||||||
Changes in version 1.30, 2001-10-26:
|
* Changes in version 1.30, 2001-10-26:
|
||||||
|
|
||||||
* `--defines' and `--graph' have now an optional argument which is the
|
** `--defines' and `--graph' have now an optional argument which is the
|
||||||
output file name. `-d' and `-g' do not change; they do not take any
|
output file name. `-d' and `-g' do not change; they do not take any
|
||||||
argument.
|
argument.
|
||||||
|
|
||||||
* `%source_extension' and `%header_extension' are removed, failed
|
** `%source_extension' and `%header_extension' are removed, failed
|
||||||
experiment.
|
experiment.
|
||||||
|
|
||||||
* Portability fixes.
|
** Portability fixes.
|
||||||
|
|
||||||
Changes in version 1.29, 2001-09-07:
|
* Changes in version 1.29, 2001-09-07:
|
||||||
|
|
||||||
* The output file does not define const, as this caused problems when used
|
** The output file does not define const, as this caused problems when used
|
||||||
with common autoconfiguration schemes. If you still use ancient compilers
|
with common autoconfiguration schemes. If you still use ancient compilers
|
||||||
that lack const, compile with the equivalent of the C compiler option
|
that lack const, compile with the equivalent of the C compiler option
|
||||||
`-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
|
`-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
|
||||||
|
|
||||||
* Added `-g' and `--graph'.
|
** Added `-g' and `--graph'.
|
||||||
|
|
||||||
* The Bison manual is now distributed under the terms of the GNU FDL.
|
** The Bison manual is now distributed under the terms of the GNU FDL.
|
||||||
|
|
||||||
* The input and the output files has automatically a similar extension.
|
** The input and the output files has automatically a similar extension.
|
||||||
|
|
||||||
* Russian translation added.
|
** Russian translation added.
|
||||||
|
|
||||||
* NLS support updated; should hopefully be less troublesome.
|
** NLS support updated; should hopefully be less troublesome.
|
||||||
|
|
||||||
* Added the old Bison reference card.
|
** Added the old Bison reference card.
|
||||||
|
|
||||||
* Added `--locations' and `%locations'.
|
** Added `--locations' and `%locations'.
|
||||||
|
|
||||||
* Added `-S' and `--skeleton'.
|
** Added `-S' and `--skeleton'.
|
||||||
|
|
||||||
* `%raw', `-r', `--raw' is disabled.
|
** `%raw', `-r', `--raw' is disabled.
|
||||||
|
|
||||||
* Special characters are escaped when output. This solves the problems
|
** Special characters are escaped when output. This solves the problems
|
||||||
of the #line lines with path names including backslashes.
|
of the #line lines with path names including backslashes.
|
||||||
|
|
||||||
* New directives.
|
** New directives.
|
||||||
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
||||||
`%debug', `%source_extension' and `%header_extension'.
|
`%debug', `%source_extension' and `%header_extension'.
|
||||||
|
|
||||||
* @$
|
** @$
|
||||||
Automatic location tracking.
|
Automatic location tracking.
|
||||||
|
|
||||||
Changes in version 1.28, 1999-07-06:
|
* Changes in version 1.28, 1999-07-06:
|
||||||
|
|
||||||
* Should compile better now with K&R compilers.
|
** Should compile better now with K&R compilers.
|
||||||
|
|
||||||
* Added NLS.
|
** Added NLS.
|
||||||
|
|
||||||
* Fixed a problem with escaping the double quote character.
|
** Fixed a problem with escaping the double quote character.
|
||||||
|
|
||||||
* There is now a FAQ.
|
** There is now a FAQ.
|
||||||
|
|
||||||
Changes in version 1.27:
|
* Changes in version 1.27:
|
||||||
|
|
||||||
* The make rule which prevented bison.simple from being created on
|
** The make rule which prevented bison.simple from being created on
|
||||||
some systems has been fixed.
|
some systems has been fixed.
|
||||||
|
|
||||||
Changes in version 1.26:
|
* Changes in version 1.26:
|
||||||
|
|
||||||
* Bison now uses automake.
|
** Bison now uses automake.
|
||||||
|
|
||||||
* New mailing lists: <[email protected]> and <[email protected]>.
|
** New mailing lists: <[email protected]> and <[email protected]>.
|
||||||
|
|
||||||
* Token numbers now start at 257 as previously documented, not 258.
|
** Token numbers now start at 257 as previously documented, not 258.
|
||||||
|
|
||||||
* Bison honors the TMPDIR environment variable.
|
** Bison honors the TMPDIR environment variable.
|
||||||
|
|
||||||
* A couple of buffer overruns have been fixed.
|
** A couple of buffer overruns have been fixed.
|
||||||
|
|
||||||
* Problems when closing files should now be reported.
|
** Problems when closing files should now be reported.
|
||||||
|
|
||||||
* Generated parsers should now work even on operating systems which do
|
** Generated parsers should now work even on operating systems which do
|
||||||
not provide alloca().
|
not provide alloca().
|
||||||
|
|
||||||
Changes in version 1.25, 1995-10-16:
|
* Changes in version 1.25, 1995-10-16:
|
||||||
|
|
||||||
* Errors in the input grammar are not fatal; Bison keeps reading
|
** Errors in the input grammar are not fatal; Bison keeps reading
|
||||||
the grammar file, and reports all the errors found in it.
|
the grammar file, and reports all the errors found in it.
|
||||||
|
|
||||||
* Tokens can now be specified as multiple-character strings: for
|
** Tokens can now be specified as multiple-character strings: for
|
||||||
example, you could use "<=" for a token which looks like <=, instead
|
example, you could use "<=" for a token which looks like <=, instead
|
||||||
of chosing a name like LESSEQ.
|
of chosing a name like LESSEQ.
|
||||||
|
|
||||||
* The %token_table declaration says to write a table of tokens (names
|
** The %token_table declaration says to write a table of tokens (names
|
||||||
and numbers) into the parser file. The yylex function can use this
|
and numbers) into the parser file. The yylex function can use this
|
||||||
table to recognize multiple-character string tokens, or for other
|
table to recognize multiple-character string tokens, or for other
|
||||||
purposes.
|
purposes.
|
||||||
|
|
||||||
* The %no_lines declaration says not to generate any #line preprocessor
|
** The %no_lines declaration says not to generate any #line preprocessor
|
||||||
directives in the parser file.
|
directives in the parser file.
|
||||||
|
|
||||||
* The %raw declaration says to use internal Bison token numbers, not
|
** The %raw declaration says to use internal Bison token numbers, not
|
||||||
Yacc-compatible token numbers, when token names are defined as macros.
|
Yacc-compatible token numbers, when token names are defined as macros.
|
||||||
|
|
||||||
* The --no-parser option produces the parser tables without including
|
** The --no-parser option produces the parser tables without including
|
||||||
the parser engine; a project can now use its own parser engine.
|
the parser engine; a project can now use its own parser engine.
|
||||||
The actions go into a separate file called NAME.act, in the form of
|
The actions go into a separate file called NAME.act, in the form of
|
||||||
a switch statement body.
|
a switch statement body.
|
||||||
|
|
||||||
Changes in version 1.23:
|
* Changes in version 1.23:
|
||||||
|
|
||||||
The user can define YYPARSE_PARAM as the name of an argument to be
|
The user can define YYPARSE_PARAM as the name of an argument to be
|
||||||
passed into yyparse. The argument should have type void *. It should
|
passed into yyparse. The argument should have type void *. It should
|
||||||
@@ -994,11 +1034,11 @@ by casting it to the proper pointer type.
|
|||||||
|
|
||||||
Line numbers in output file corrected.
|
Line numbers in output file corrected.
|
||||||
|
|
||||||
Changes in version 1.22:
|
* Changes in version 1.22:
|
||||||
|
|
||||||
--help option added.
|
--help option added.
|
||||||
|
|
||||||
Changes in version 1.20:
|
* Changes in version 1.20:
|
||||||
|
|
||||||
Output file does not redefine const for C++.
|
Output file does not redefine const for C++.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
This directory contains the Bison parser generator.
|
This package contains the GNU Bison parser generator.
|
||||||
|
|
||||||
See the file INSTALL for generic compilation and installation instructions.
|
See the file INSTALL for generic compilation and installation instructions.
|
||||||
See the file doc/FAQ for frequently asked questions.
|
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.3 or later. See:
|
See the section FAQ in the documentation (doc/bison.info) for
|
||||||
|
frequently asked questions. The documentation is also available in
|
||||||
|
PDF and HTML, provided you have a recent version of Texinfo installed:
|
||||||
|
run "make pdf" or "make html".
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
Bison requires GNU m4 1.4.6 or later. See:
|
||||||
|
|
||||||
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
||||||
|
|
||||||
|
Bison can work with pre-1.4.6 distributions of GNU m4 if they are
|
||||||
sufficiently patched, but if you encounter a bug with an older
|
sufficiently patched, but if you encounter a bug with an older
|
||||||
distribution and report a bug we will probably suggest that you
|
distribution and report a bug we will probably suggest that you
|
||||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
upgrade to 1.4.6 as the first step in trying to fix it.
|
||||||
|
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
version number from `bison --version', and a complete, self-contained
|
version number from `bison --version', and a complete, self-contained
|
||||||
@@ -21,7 +25,7 @@ not answer them, please send mail to <[email protected]>.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
# If each line in $STR is not already on a line by itself in $FILE, insert it,
|
||||||
# sorting the new contents of the file and replacing $FILE with the result.
|
# sorting the new contents of the file and replacing $FILE with the result.
|
||||||
insert_sorted_if_absent() {
|
insert_sorted_if_absent() {
|
||||||
file=$1
|
file=$1
|
||||||
@@ -222,6 +222,21 @@ insert_sorted_if_absent() {
|
|||||||
|| exit 1
|
|| exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||||
|
# insert_sorted_if_absent.
|
||||||
|
insert_vc_ignore() {
|
||||||
|
vc_ignore_file="$1"
|
||||||
|
case $vc_ignore_file in
|
||||||
|
*.gitignore)
|
||||||
|
# A .gitignore entry that does not start with `/' applies recursively to
|
||||||
|
# subdirectories, so prepend `/' to every .gitignore entry.
|
||||||
|
pattern=`echo "$2" | sed s,^,/,`;;
|
||||||
|
*)
|
||||||
|
pattern="$2";;
|
||||||
|
esac
|
||||||
|
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
||||||
|
}
|
||||||
|
|
||||||
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||||
found_aux_dir=no
|
found_aux_dir=no
|
||||||
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
||||||
@@ -240,7 +255,7 @@ if test ! -d $build_aux; then
|
|||||||
mkdir $build_aux
|
mkdir $build_aux
|
||||||
for dot_ig in x $vc_ignore; do
|
for dot_ig in x $vc_ignore; do
|
||||||
test $dot_ig = x && continue
|
test $dot_ig = x && continue
|
||||||
insert_sorted_if_absent $dot_ig $build_aux
|
insert_vc_ignore $dot_ig $build_aux
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -252,6 +267,20 @@ cleanup_gnulib() {
|
|||||||
exit $status
|
exit $status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||||
|
|
||||||
|
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
||||||
|
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||||
|
:
|
||||||
|
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
||||||
|
echo "initializing git-merge-changelog driver"
|
||||||
|
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||||
|
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||||
|
else
|
||||||
|
echo "consider installing git-merge-changelog from gnulib"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Get gnulib files.
|
# Get gnulib files.
|
||||||
|
|
||||||
case ${GNULIB_SRCDIR--} in
|
case ${GNULIB_SRCDIR--} in
|
||||||
@@ -350,7 +379,7 @@ check_dst_dir()
|
|||||||
for dot_ig in x $vc_ignore; do
|
for dot_ig in x $vc_ignore; do
|
||||||
test $dot_ig = x && continue
|
test $dot_ig = x && continue
|
||||||
ig=$parent/$dot_ig
|
ig=$parent/$dot_ig
|
||||||
insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -507,18 +536,18 @@ slurp() {
|
|||||||
test $dot_ig = x && continue
|
test $dot_ig = x && continue
|
||||||
ig=$dir/$dot_ig
|
ig=$dir/$dot_ig
|
||||||
if test -n "$copied"; then
|
if test -n "$copied"; then
|
||||||
insert_sorted_if_absent $ig "$copied"
|
insert_vc_ignore $ig "$copied"
|
||||||
# If an ignored file name ends with _.h, then also add
|
# If an ignored file name ends with _.h, then also add
|
||||||
# the name with just ".h". Many gnulib headers are generated,
|
# the name with just ".h". Many gnulib headers are generated,
|
||||||
# e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc.
|
# e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc.
|
||||||
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
|
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
|
||||||
f=`echo "$copied"|sed 's/_\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
|
f=`echo "$copied"|sed 's/_\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
|
||||||
insert_sorted_if_absent $ig "$f"
|
insert_vc_ignore $ig "$f"
|
||||||
|
|
||||||
# For files like sys_stat_.h and sys_time_.h, record as
|
# For files like sys_stat_.h and sys_time_.h, record as
|
||||||
# ignorable the directory we might eventually create: sys/.
|
# ignorable the directory we might eventually create: sys/.
|
||||||
f=`echo "$copied"|sed 's/sys_.*_\.h$/sys/'`
|
f=`echo "$copied"|sed 's/sys_.*_\.h$/sys/'`
|
||||||
insert_sorted_if_absent $ig "$f"
|
insert_vc_ignore $ig "$f"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
+9
-10
@@ -17,17 +17,12 @@
|
|||||||
|
|
||||||
# gnulib modules used by this package.
|
# gnulib modules used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
argmatch config-h c-strcase configmake
|
announce-gen argmatch config-h c-strcase configmake
|
||||||
dirname error extensions fopen-safer git-version-gen
|
dirname error extensions fopen-safer getopt gettext git-version-gen
|
||||||
getopt gettext hash inttypes javacomp-script javaexec-script malloc
|
gnumakefile hash inttypes javacomp-script javaexec-script malloc
|
||||||
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
||||||
strverscmp unistd unistd-safer unlocked-io verify xalloc xalloc-die
|
strverscmp unistd unistd-safer unlocked-io unsetenv verify
|
||||||
xstrndup
|
warnings xalloc xalloc-die xstrndup
|
||||||
'
|
|
||||||
|
|
||||||
# Any gnulib files needed that are not in modules.
|
|
||||||
gnulib_files='
|
|
||||||
m4/warning.m4
|
|
||||||
'
|
'
|
||||||
|
|
||||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
@@ -65,3 +60,7 @@ excluded_files='
|
|||||||
m4/visibility.m4
|
m4/visibility.m4
|
||||||
m4/xsize.m4
|
m4/xsize.m4
|
||||||
'
|
'
|
||||||
|
|
||||||
|
# In directories like lib/, m4/, and po/, generate both these files because we
|
||||||
|
# still try to support CVS emulation.
|
||||||
|
vc_ignore='.cvsignore .gitignore'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
announce-gen
|
||||||
compile
|
compile
|
||||||
config.guess
|
config.guess
|
||||||
config.rpath
|
config.rpath
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/announce-gen
|
||||||
|
/compile
|
||||||
|
/config.guess
|
||||||
|
/config.rpath
|
||||||
|
/config.sub
|
||||||
|
/depcomp
|
||||||
|
/git-version-gen
|
||||||
|
/install-sh
|
||||||
|
/javacomp.sh.in
|
||||||
|
/javaexec.sh.in
|
||||||
|
/link-warning.h
|
||||||
|
/mdate-sh
|
||||||
|
/missing
|
||||||
|
/texinfo.tex
|
||||||
|
/ylwrap
|
||||||
+12
-5
@@ -1,19 +1,26 @@
|
|||||||
# Customize Makefile.maint. -*- makefile -*-
|
# Customize maint.mk -*- makefile -*-
|
||||||
# Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# It's useful to run maintainer-*check* targets during development, but we
|
||||||
|
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
||||||
|
# override the _is-dist-target from GNUmakefile so that maintainer-*check*
|
||||||
|
# targets are filtered out.
|
||||||
|
_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \
|
||||||
|
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
||||||
|
|
||||||
# Use alpha.gnu.org for alpha and beta releases.
|
# Use alpha.gnu.org for alpha and beta releases.
|
||||||
# Use ftp.gnu.org for major releases.
|
# Use ftp.gnu.org for major releases.
|
||||||
gnu_ftp_host-alpha = alpha.gnu.org
|
gnu_ftp_host-alpha = alpha.gnu.org
|
||||||
@@ -32,4 +39,4 @@ local-checks-to-skip = changelog-check
|
|||||||
|
|
||||||
# The local directory containing the checked-out copy of gnulib used in
|
# The local directory containing the checked-out copy of gnulib used in
|
||||||
# this release. Used solely to get a date for the "announcement" target.
|
# this release. Used solely to get a date for the "announcement" target.
|
||||||
gnulib_dir = /gnulib
|
gnulib_dir = $(srcdir)/../../gnulib
|
||||||
+27
-22
@@ -19,16 +19,22 @@
|
|||||||
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
||||||
AC_PREREQ(2.61)
|
AC_PREREQ(2.61)
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [2.3a+], [[email protected]])
|
AC_INIT([GNU Bison],
|
||||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2007],
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
|
[[email protected]])
|
||||||
|
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008],
|
||||||
[The copyright year for this package])
|
[The copyright year for this package])
|
||||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2007])
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
# We want gnits strictness only when rolling a formal release so that we can,
|
||||||
|
# for example, run make dist at other times without being required to add a
|
||||||
|
# bogus NEWS entry.
|
||||||
|
AM_INIT_AUTOMAKE([1.8 dist-bzip2]
|
||||||
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-], [gnu], [gnits]))
|
||||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
@@ -45,23 +51,23 @@ AC_ARG_ENABLE(gcc-warnings,
|
|||||||
esac],
|
esac],
|
||||||
[enableval=no])
|
[enableval=no])
|
||||||
if test "${enableval}" = yes; then
|
if test "${enableval}" = yes; then
|
||||||
gl_WARNING_CFLAGS([-Werror])
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
AC_SUBST([WERROR_CFLAGS])
|
||||||
WARNING_CFLAGS=
|
gl_WARN_ADD([-Wall])
|
||||||
gl_WARNING_CFLAGS([-Wall])
|
gl_WARN_ADD([-Wextra -Wno-sign-compare])
|
||||||
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
gl_WARN_ADD([-Wcast-align])
|
||||||
gl_WARNING_CFLAGS([-Wcast-align])
|
gl_WARN_ADD([-Wcast-qual])
|
||||||
gl_WARNING_CFLAGS([-Wcast-qual])
|
gl_WARN_ADD([-Wformat])
|
||||||
gl_WARNING_CFLAGS([-Wformat])
|
gl_WARN_ADD([-Wpointer-arith])
|
||||||
gl_WARNING_CFLAGS([-Wpointer-arith])
|
gl_WARN_ADD([-Wwrite-strings])
|
||||||
gl_WARNING_CFLAGS([-Wwrite-strings])
|
AC_SUBST([WARN_CXXFLAGS], [$WARN_CFLAGS])
|
||||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
|
||||||
# The following warnings are not suitable for C++.
|
# The following warnings are not suitable for C++.
|
||||||
gl_WARNING_CFLAGS([-Wbad-function-cast])
|
gl_WARN_ADD([-Wbad-function-cast])
|
||||||
gl_WARNING_CFLAGS([-Wmissing-declarations])
|
gl_WARN_ADD([-Wmissing-declarations])
|
||||||
gl_WARNING_CFLAGS([-Wmissing-prototypes])
|
gl_WARN_ADD([-Wmissing-prototypes])
|
||||||
gl_WARNING_CFLAGS([-Wshadow])
|
gl_WARN_ADD([-Wshadow])
|
||||||
gl_WARNING_CFLAGS([-Wstrict-prototypes])
|
gl_WARN_ADD([-Wstrict-prototypes])
|
||||||
|
AC_SUBST([WARN_CFLAGS])
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -142,8 +148,7 @@ AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
|||||||
gt_JAVACOMP([1.3])
|
gt_JAVACOMP([1.3])
|
||||||
gt_JAVAEXEC
|
gt_JAVAEXEC
|
||||||
|
|
||||||
AC_CONFIG_FILES([.version
|
AC_CONFIG_FILES([Makefile
|
||||||
Makefile
|
|
||||||
build-aux/Makefile
|
build-aux/Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile.in
|
||||||
|
/Makefile
|
||||||
+1
-1
@@ -19,7 +19,7 @@ dist_pkgdata_DATA = README bison.m4 \
|
|||||||
java-skel.m4 java.m4 lalr1.java
|
java-skel.m4 java.m4 lalr1.java
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
m4sugardir = $(pkgdatadir)/m4sugar
|
||||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4
|
||||||
|
|
||||||
xsltdir = $(pkgdatadir)/xslt
|
xsltdir = $(pkgdatadir)/xslt
|
||||||
dist_xslt_DATA = \
|
dist_xslt_DATA = \
|
||||||
|
|||||||
+34
-7
@@ -1,31 +1,58 @@
|
|||||||
-*- outline -*-
|
-*- outline -*-
|
||||||
|
|
||||||
This directory contains Bison skeletons: the general shapes of the
|
This directory contains data needed by Bison.
|
||||||
different parser kinds, that are specialized for specific grammars by
|
|
||||||
the bison program.
|
|
||||||
|
|
||||||
Currently, there are only three supported skeletons:
|
* Skeletons
|
||||||
|
Bison skeletons: the general shapes of the different parser kinds,
|
||||||
|
that are specialized for specific grammars by the bison program.
|
||||||
|
|
||||||
|
Currently, the supported skeletons are:
|
||||||
|
|
||||||
- yacc.c
|
- yacc.c
|
||||||
It used to be named bison.simple: it corresponds to C Yacc
|
It used to be named bison.simple: it corresponds to C Yacc
|
||||||
compatible LALR(1) parsers.
|
compatible LALR(1) parsers.
|
||||||
|
|
||||||
- lalr1.cc
|
- lalr1.cc
|
||||||
Produces a C++ parser class. It is still very experimental, and not
|
Produces a C++ parser class.
|
||||||
yet supported. Please, subscribe to [email protected].
|
|
||||||
|
- lalr1.java
|
||||||
|
Produces a Java parser class.
|
||||||
|
|
||||||
- glr.c
|
- glr.c
|
||||||
A Generalized LR C parser based on Bison's LALR(1) tables.
|
A Generalized LR C parser based on Bison's LALR(1) tables.
|
||||||
|
|
||||||
|
- glr.cc
|
||||||
|
A Generalized LR C++ parser. Actually a C++ wrapper around glr.c.
|
||||||
|
|
||||||
These skeletons are the only ones supported by the Bison team.
|
These skeletons are the only ones supported by the Bison team.
|
||||||
Because the interface between skeletons and the bison program is not
|
Because the interface between skeletons and the bison program is not
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
finished, *we are not bound to it*. In particular, Bison is not
|
||||||
mature enough for us to consider that ``foreign skeletons'' are
|
mature enough for us to consider that ``foreign skeletons'' are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
|
* m4sugar
|
||||||
|
This directory contains M4sugar, sort of an extended library for M4,
|
||||||
|
which is used by Bison to instantiate the skeletons.
|
||||||
|
|
||||||
|
* xslt
|
||||||
|
This directory contains XSLT programs that transform Bison's XML output
|
||||||
|
into various formats.
|
||||||
|
|
||||||
|
- bison.xsl
|
||||||
|
A library of routines used by the other XSLT programs.
|
||||||
|
|
||||||
|
- xml2dot.xsl
|
||||||
|
Conversion into GraphViz's dot format.
|
||||||
|
|
||||||
|
- xml2text.xsl
|
||||||
|
Conversion into text.
|
||||||
|
|
||||||
|
- xml2xhtml.xsl
|
||||||
|
Conversion into XHTML.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -550,7 +550,7 @@ m4_define([b4_check_user_names_wrap],
|
|||||||
[b4_percent_]$1[_user_]$2[s],
|
[b4_percent_]$1[_user_]$2[s],
|
||||||
[[b4_percent_]$1[_bison_]$2[s]])])])
|
[[b4_percent_]$1[_bison_]$2[s]])])])
|
||||||
|
|
||||||
m4_wrap([
|
m4_wrap_lifo([
|
||||||
b4_check_user_names_wrap([[define]], [[variable]])
|
b4_check_user_names_wrap([[define]], [[variable]])
|
||||||
b4_check_user_names_wrap([[code]], [[qualifier]])
|
b4_check_user_names_wrap([[code]], [[qualifier]])
|
||||||
])
|
])
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||||
# Inc.
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -89,7 +90,7 @@ b4_parse_param)
|
|||||||
# the formal name to FORMAL, and evaluating the BODY.
|
# the formal name to FORMAL, and evaluating the BODY.
|
||||||
m4_define([b4_parse_param_for],
|
m4_define([b4_parse_param_for],
|
||||||
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
|
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
|
||||||
[m4_pushdef([$1], m4_fst($1_$2))dnl
|
[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl
|
||||||
m4_pushdef([$2], m4_shift($1_$2))dnl
|
m4_pushdef([$2], m4_shift($1_$2))dnl
|
||||||
$3[]dnl
|
$3[]dnl
|
||||||
m4_popdef([$2])dnl
|
m4_popdef([$2])dnl
|
||||||
@@ -132,6 +133,8 @@ m4_define([b4_int_type],
|
|||||||
m4_define([b4_int_type_for],
|
m4_define([b4_int_type_for],
|
||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------##
|
## ---------##
|
||||||
## Values. ##
|
## Values. ##
|
||||||
## ---------##
|
## ---------##
|
||||||
@@ -143,6 +146,8 @@ m4_define([b4_int_type_for],
|
|||||||
m4_define([b4_null], [0])
|
m4_define([b4_null], [0])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## Assigning token numbers. ##
|
## Assigning token numbers. ##
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
@@ -159,7 +164,7 @@ m4_define([b4_token_define],
|
|||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as #defines.
|
# Output the definition of the tokens (if there are) as #defines.
|
||||||
m4_define([b4_token_defines],
|
m4_define([b4_token_defines],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
m4_map([b4_token_define], [$@])])
|
m4_map([b4_token_define], [$@])])
|
||||||
])
|
])
|
||||||
@@ -176,7 +181,7 @@ m4_define([b4_token_enum],
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
@@ -228,8 +233,8 @@ m4_define([b4_c_function_def],
|
|||||||
b4_c_ansi_function_def($@)
|
b4_c_ansi_function_def($@)
|
||||||
#else
|
#else
|
||||||
$2
|
$2
|
||||||
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
|
$1 (b4_c_knr_formal_names(m4_shift2($@)))
|
||||||
b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
b4_c_knr_formal_decls(m4_shift2($@))
|
||||||
#endif[]dnl
|
#endif[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -239,7 +244,7 @@ b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
|||||||
# Declare the function NAME in ANSI.
|
# Declare the function NAME in ANSI.
|
||||||
m4_define([b4_c_ansi_function_def],
|
m4_define([b4_c_ansi_function_def],
|
||||||
[$2
|
[$2
|
||||||
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -247,9 +252,8 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Output the arguments ANSI-C definition.
|
# Output the arguments ANSI-C definition.
|
||||||
m4_define([b4_c_ansi_formals],
|
m4_define([b4_c_ansi_formals],
|
||||||
[m4_case([$@],
|
[m4_if([$#], [0], [void],
|
||||||
[], [void],
|
[$#$1], [1], [void],
|
||||||
[[]], [void],
|
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
m4_define([b4_c_ansi_formal],
|
||||||
@@ -301,7 +305,7 @@ $2 $1 ();
|
|||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_ansi_function_decl],
|
m4_define([b4_c_ansi_function_decl],
|
||||||
[$2 $1 (b4_c_ansi_formals(m4_shiftn(2, $@)));[]dnl
|
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -316,7 +320,7 @@ m4_define([b4_c_ansi_function_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Call the function NAME with arguments NAME1, NAME2 etc.
|
# Call the function NAME with arguments NAME1, NAME2 etc.
|
||||||
m4_define([b4_c_function_call],
|
m4_define([b4_c_function_call],
|
||||||
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
|
[$1 (b4_c_args(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
-*- C -*-
|
-*- C -*-
|
||||||
|
|
||||||
# GLR skeleton for Bison
|
# GLR skeleton for Bison
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -2644,10 +2644,10 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
|||||||
b4_shared_declarations
|
b4_shared_declarations
|
||||||
|
|
||||||
b4_pure_if([],
|
b4_pure_if([],
|
||||||
[[extern YYSTYPE b4_prefix][lval;]])
|
[[extern YYSTYPE ]b4_prefix[lval;]])
|
||||||
|
|
||||||
b4_locations_if([b4_pure_if([],
|
b4_locations_if([b4_pure_if([],
|
||||||
[extern YYLTYPE b4_prefix[]lloc;])
|
[extern YYLTYPE ]b4_prefix[lloc;])
|
||||||
])
|
])
|
||||||
])])
|
])])
|
||||||
m4_divert_pop(0)
|
m4_divert_pop(0)
|
||||||
|
|||||||
+40
-10
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java language support for Bison
|
# Java language support for Bison
|
||||||
|
|
||||||
# Copyright (C) 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,6 +25,23 @@ m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
|||||||
]) */])
|
]) */])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_list2(LIST1, LIST2)
|
||||||
|
# --------------------------
|
||||||
|
# Join two lists with a comma if necessary.
|
||||||
|
m4_define([b4_list2],
|
||||||
|
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
||||||
|
# -------------------------------------------
|
||||||
|
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
||||||
|
# otherwise NOT.
|
||||||
|
m4_define([b4_percent_define_get3],
|
||||||
|
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||||
|
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_flag_value(BOOLEAN-FLAG)
|
# b4_flag_value(BOOLEAN-FLAG)
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
|
m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
|
||||||
@@ -44,6 +61,20 @@ m4_define([b4_abstract_if],
|
|||||||
[b4_percent_define_flag_if([abstract], [$1], [$2])])
|
[b4_percent_define_flag_if([abstract], [$1], [$2])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_final_if(TRUE, FALSE)
|
||||||
|
# ---------------------------
|
||||||
|
b4_percent_define_default([[final]], [[false]])
|
||||||
|
m4_define([b4_final_if],
|
||||||
|
[b4_percent_define_flag_if([final], [$1], [$2])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_strictfp_if(TRUE, FALSE)
|
||||||
|
# ---------------------------
|
||||||
|
b4_percent_define_default([[strictfp]], [[false]])
|
||||||
|
m4_define([b4_strictfp_if],
|
||||||
|
[b4_percent_define_flag_if([strictfp], [$1], [$2])])
|
||||||
|
|
||||||
|
|
||||||
# b4_lexer_if(TRUE, FALSE)
|
# b4_lexer_if(TRUE, FALSE)
|
||||||
# ------------------------
|
# ------------------------
|
||||||
m4_define([b4_lexer_if],
|
m4_define([b4_lexer_if],
|
||||||
@@ -53,10 +84,7 @@ m4_define([b4_lexer_if],
|
|||||||
# b4_identification
|
# b4_identification
|
||||||
# -----------------
|
# -----------------
|
||||||
m4_define([b4_identification],
|
m4_define([b4_identification],
|
||||||
[/** Always <tt>true</tt>, identifies Bison output. */
|
[ /** Version number for the Bison executable that generated this parser. */
|
||||||
public static final boolean bison = true;
|
|
||||||
|
|
||||||
/** Version number for the Bison executable that generated this parser. */
|
|
||||||
public static final String bisonVersion = "b4_version";
|
public static final String bisonVersion = "b4_version";
|
||||||
|
|
||||||
/** Name of the skeleton that generated this parser. */
|
/** Name of the skeleton that generated this parser. */
|
||||||
@@ -75,7 +103,7 @@ m4_define([b4_identification],
|
|||||||
m4_define([b4_int_type],
|
m4_define([b4_int_type],
|
||||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
@@ -106,7 +134,7 @@ m4_define([b4_token_enum],
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
m4_map([b4_token_enum], [$@])])
|
m4_map([b4_token_enum], [$@])])
|
||||||
])
|
])
|
||||||
@@ -128,14 +156,16 @@ m4_define([b4_case], [ case $1:
|
|||||||
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
||||||
b4_percent_define_default([[stype]], [[Object]])])
|
b4_percent_define_default([[stype]], [[Object]])])
|
||||||
|
|
||||||
m4_define_default([[b4_prefix]], [[YY]])])
|
# %name-prefix
|
||||||
|
m4_define_default([b4_prefix], [[YY]])
|
||||||
|
|
||||||
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
|
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
|
||||||
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
||||||
|
|
||||||
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
|
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
|
||||||
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[throws]], [b4_lex_throws])])
|
b4_percent_define_default([[throws]], [])])
|
||||||
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[location_type]], [Location])])
|
b4_percent_define_default([[location_type]], [Location])])
|
||||||
@@ -205,7 +235,7 @@ m4_define([b4_param_decls],
|
|||||||
[m4_map([b4_param_decl], [$@])])
|
[m4_map([b4_param_decl], [$@])])
|
||||||
m4_define([b4_param_decl], [, $1])
|
m4_define([b4_param_decl], [, $1])
|
||||||
|
|
||||||
m4_define([b4_remove_comma], [m4_ifval($1, [$1, ], [])m4_shiftn(2, $@)])
|
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+17
-9
@@ -1,7 +1,7 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||||
# Inc.
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -35,7 +35,7 @@ m4_divert_push(0)dnl
|
|||||||
b4_defines_if(
|
b4_defines_if(
|
||||||
[@output(b4_spec_defines_file@)
|
[@output(b4_spec_defines_file@)
|
||||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008])
|
||||||
dnl FIXME: This is wrong, we want computed header guards.
|
dnl FIXME: This is wrong, we want computed header guards.
|
||||||
[
|
[
|
||||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||||
@@ -130,6 +130,7 @@ b4_user_stype
|
|||||||
/// \returns 0 iff parsing succeeded.
|
/// \returns 0 iff parsing succeeded.
|
||||||
virtual int parse ();
|
virtual int parse ();
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
/// The current debugging stream.
|
/// The current debugging stream.
|
||||||
std::ostream& debug_stream () const;
|
std::ostream& debug_stream () const;
|
||||||
/// Set the current debugging stream.
|
/// Set the current debugging stream.
|
||||||
@@ -141,6 +142,7 @@ b4_user_stype
|
|||||||
debug_level_type debug_level () const;
|
debug_level_type debug_level () const;
|
||||||
/// Set the current debugging level.
|
/// Set the current debugging level.
|
||||||
void set_debug_level (debug_level_type l);
|
void set_debug_level (debug_level_type l);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Report a syntax error.
|
/// Report a syntax error.
|
||||||
@@ -298,7 +300,7 @@ b4_percent_code_get([[provides]])[]dnl
|
|||||||
])dnl
|
])dnl
|
||||||
@output(b4_parser_file_name@)
|
@output(b4_parser_file_name@)
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008])
|
||||||
b4_percent_code_get([[top]])[]dnl
|
b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_prefix, [yy], [],
|
m4_if(b4_prefix, [yy], [],
|
||||||
[
|
[
|
||||||
@@ -367,9 +369,13 @@ do { \
|
|||||||
|
|
||||||
#endif /* !YYDEBUG */
|
#endif /* !YYDEBUG */
|
||||||
|
|
||||||
|
#define yyerrok (yyerrstatus_ = 0)
|
||||||
|
#define yyclearin (yychar = yyempty_)
|
||||||
|
|
||||||
#define YYACCEPT goto yyacceptlab
|
#define YYACCEPT goto yyacceptlab
|
||||||
#define YYABORT goto yyabortlab
|
#define YYABORT goto yyabortlab
|
||||||
#define YYERROR goto yyerrorlab
|
#define YYERROR goto yyerrorlab
|
||||||
|
#define YYRECOVERING() (!!yyerrstatus_)
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
#if YYERROR_VERBOSE
|
#if YYERROR_VERBOSE
|
||||||
@@ -533,7 +539,7 @@ do { \
|
|||||||
/// Location of the lookahead.
|
/// Location of the lookahead.
|
||||||
location_type yylloc;
|
location_type yylloc;
|
||||||
/// The locations where the error started and ended.
|
/// The locations where the error started and ended.
|
||||||
location yyerror_range[2];
|
location_type yyerror_range[2];
|
||||||
|
|
||||||
/// $$.
|
/// $$.
|
||||||
semantic_type yyval;
|
semantic_type yyval;
|
||||||
@@ -670,7 +676,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_user_actions[
|
]b4_user_actions[
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||||
|
|
||||||
@@ -788,7 +795,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
|
|
||||||
/* Shift the error token. */
|
/* Shift the error token. */
|
||||||
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
|
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
|
||||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||||
|
|
||||||
yystate = yyn;
|
yystate = yyn;
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
@@ -1050,7 +1057,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
dnl
|
dnl
|
||||||
@output(b4_dir_prefix[]stack.hh@)
|
@output(b4_dir_prefix[]stack.hh@)
|
||||||
b4_copyright([Stack handling for Bison parsers in C++],
|
b4_copyright([Stack handling for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008])[
|
||||||
|
|
||||||
#ifndef BISON_STACK_HH
|
#ifndef BISON_STACK_HH
|
||||||
# define BISON_STACK_HH
|
# define BISON_STACK_HH
|
||||||
@@ -1145,5 +1152,6 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
|||||||
};
|
};
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
|
|
||||||
#endif // not BISON_STACK_HH]
|
#endif // not BISON_STACK_HH[]dnl
|
||||||
|
]
|
||||||
m4_divert_pop(0)
|
m4_divert_pop(0)
|
||||||
|
|||||||
+20
-15
@@ -1,6 +1,6 @@
|
|||||||
# Java skeleton for Bison -*- autoconf -*-
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,18 +25,24 @@ m4_ifval(m4_defn([b4_symbol_destructors]),
|
|||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_parser_file_name@)
|
@output(b4_parser_file_name@)
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||||
[2007])
|
[2007, 2008])
|
||||||
|
|
||||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||||
])[/* First part of user declarations. */
|
])[/* First part of user declarations. */
|
||||||
]b4_pre_prologue
|
]b4_pre_prologue
|
||||||
b4_percent_code_get([[imports]])
|
b4_percent_code_get([[imports]])
|
||||||
[/**
|
[/**
|
||||||
* A Bison parser, automatically generated from <tt>@ofile@</tt>.
|
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
||||||
*
|
*
|
||||||
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
||||||
*/
|
*/
|
||||||
]b4_public_if([public ])b4_abstract_if([abstract ])[class ]b4_parser_class_name[
|
]b4_public_if([public ])dnl
|
||||||
|
b4_abstract_if([abstract ])dnl
|
||||||
|
b4_final_if([final ])dnl
|
||||||
|
b4_strictfp_if([strictfp ])dnl
|
||||||
|
[class ]b4_parser_class_name[]dnl
|
||||||
|
b4_percent_define_get3([extends], [ extends ])dnl
|
||||||
|
b4_percent_define_get3([implements], [ implements ])[
|
||||||
{
|
{
|
||||||
]b4_identification[
|
]b4_identification[
|
||||||
|
|
||||||
@@ -57,7 +63,7 @@ b4_locations_if([[
|
|||||||
public ]b4_position_type[ end;
|
public ]b4_position_type[ end;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a ]b4_location_type[ denoting an empty range located at
|
* Create a <code>]b4_location_type[</code> denoting an empty range located at
|
||||||
* a given point.
|
* a given point.
|
||||||
* @@param loc The position at which the range is anchored. */
|
* @@param loc The position at which the range is anchored. */
|
||||||
public ]b4_location_type[ (]b4_position_type[ loc) {
|
public ]b4_location_type[ (]b4_position_type[ loc) {
|
||||||
@@ -67,7 +73,7 @@ b4_locations_if([[
|
|||||||
/**
|
/**
|
||||||
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
||||||
* @@param begin The first position included in the range.
|
* @@param begin The first position included in the range.
|
||||||
* @@param begin The first position beyond the range. */
|
* @@param end The first position beyond the range. */
|
||||||
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
||||||
this.begin = begin;
|
this.begin = begin;
|
||||||
this.end = end;
|
this.end = end;
|
||||||
@@ -99,7 +105,7 @@ b4_token_enums(b4_tokens)
|
|||||||
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
||||||
else
|
else
|
||||||
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
||||||
}]])
|
}]])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Communication interface between the scanner and the Bison-generated
|
* Communication interface between the scanner and the Bison-generated
|
||||||
@@ -130,10 +136,9 @@ b4_token_enums(b4_tokens)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point for error reporting. Emits an error
|
* Entry point for error reporting. Emits an error
|
||||||
* ]b4_locations_if([ referring to the given location])[in a user-defined
|
* ]b4_locations_if([referring to the given location ])[in a user-defined way.
|
||||||
* way.
|
|
||||||
*
|
*
|
||||||
* ]b4_locations_if([loc], [[The location of the element to which the
|
* ]b4_locations_if([[@@param loc The location of the element to which the
|
||||||
* error message is related]])[
|
* error message is related]])[
|
||||||
* @@param s The string for the error message. */
|
* @@param s The string for the error message. */
|
||||||
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
|
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
|
||||||
@@ -160,7 +165,7 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates the Bison-generated parser.
|
* Instantiates the Bison-generated parser.
|
||||||
* @@param yylex The scanner that will supply tokens to the parser.
|
* @@param yylexer The scanner that will supply tokens to the parser.
|
||||||
*/
|
*/
|
||||||
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
|
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
|
||||||
this.yylexer = yylexer;
|
this.yylexer = yylexer;
|
||||||
@@ -205,7 +210,7 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
]b4_locations_if([
|
]b4_locations_if([
|
||||||
protected final void yyerror (String s) {
|
protected final void yyerror (String s) {
|
||||||
yylexer.yyerror ((Location)null, s);
|
yylexer.yyerror ((]b4_location_type[)null, s);
|
||||||
}
|
}
|
||||||
protected final void yyerror (]b4_position_type[ loc, String s) {
|
protected final void yyerror (]b4_position_type[ loc, String s) {
|
||||||
yylexer.yyerror (new ]b4_location_type[ (loc), s);
|
yylexer.yyerror (new ]b4_location_type[ (loc), s);
|
||||||
@@ -325,7 +330,7 @@ b4_lexer_if([[
|
|||||||
return yyerrstatus_ == 0;
|
return yyerrstatus_ == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int yyaction (int yyn, YYStack yystack, int yylen)
|
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
||||||
{
|
{
|
||||||
]b4_yystype[ yyval;
|
]b4_yystype[ yyval;
|
||||||
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
||||||
@@ -414,7 +419,7 @@ b4_lexer_if([[
|
|||||||
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
||||||
+ yytname_[yytype] + " ("]b4_locations_if([
|
+ yytname_[yytype] + " ("]b4_locations_if([
|
||||||
+ yylocationp + ": "])[
|
+ yylocationp + ": "])[
|
||||||
+ (yyvaluep == null ? "(null)" : yyvaluep) + ")");
|
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -424,7 +429,7 @@ b4_lexer_if([[
|
|||||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||||
* imply that there were no syntax errors.
|
* imply that there were no syntax errors.
|
||||||
*/
|
*/
|
||||||
public boolean parse () ]b4_maybe_throws([b4_throws])[
|
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||||
{
|
{
|
||||||
/// Lookahead and lookahead in internal form.
|
/// Lookahead and lookahead in internal form.
|
||||||
int yychar = yyempty_;
|
int yychar = yyempty_;
|
||||||
|
|||||||
@@ -0,0 +1,400 @@
|
|||||||
|
# -*- Autoconf -*-
|
||||||
|
# This file is part of Autoconf.
|
||||||
|
# foreach-based replacements for recursive functions.
|
||||||
|
# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
|
||||||
|
# GNU M4 1.6 by requiring more memory and macro expansions.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2008 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# As a special exception, the Free Software Foundation gives unlimited
|
||||||
|
# permission to copy, distribute and modify the configure scripts that
|
||||||
|
# are the output of Autoconf. You need not follow the terms of the GNU
|
||||||
|
# General Public License when using or distributing such scripts, even
|
||||||
|
# though portions of the text of Autoconf appear in them. The GNU
|
||||||
|
# General Public License (GPL) does govern all other use of the material
|
||||||
|
# that constitutes the Autoconf program.
|
||||||
|
#
|
||||||
|
# Certain portions of the Autoconf source text are designed to be copied
|
||||||
|
# (in certain cases, depending on the input) into the output of
|
||||||
|
# Autoconf. We call these the "data" portions. The rest of the Autoconf
|
||||||
|
# source text consists of comments plus executable code that decides which
|
||||||
|
# of the data portions to output in any given case. We call these
|
||||||
|
# comments and executable code the "non-data" portions. Autoconf never
|
||||||
|
# copies any of the non-data portions into its output.
|
||||||
|
#
|
||||||
|
# This special exception to the GPL applies to versions of Autoconf
|
||||||
|
# released by the Free Software Foundation. When you make and
|
||||||
|
# distribute a modified version of Autoconf, you may extend this special
|
||||||
|
# exception to the GPL to apply to your modified version as well, *unless*
|
||||||
|
# your modified version has the potential to copy into its output some
|
||||||
|
# of the text that was the non-data portion of the version that you started
|
||||||
|
# with. (In other words, unless your change moves or copies text from
|
||||||
|
# the non-data portions to the data portions.) If your modification has
|
||||||
|
# such potential, you must delete any notice of this special exception
|
||||||
|
# to the GPL from your modified version.
|
||||||
|
#
|
||||||
|
# Written by Eric Blake.
|
||||||
|
#
|
||||||
|
|
||||||
|
# In M4 1.4.x, every byte of $@ is rescanned. This means that an
|
||||||
|
# algorithm on n arguments that recurses with one less argument each
|
||||||
|
# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In
|
||||||
|
# M4 1.6, this was fixed so that $@ is only scanned once, then
|
||||||
|
# back-references are made to information stored about the scan.
|
||||||
|
# Thus, n iterations need only scan n arguments, for O(n) time.
|
||||||
|
# Additionally, in M4 1.4.x, recursive algorithms did not clean up
|
||||||
|
# memory very well, requiring O(n^2) memory rather than O(n) for n
|
||||||
|
# iterations.
|
||||||
|
#
|
||||||
|
# This file is designed to overcome the quadratic nature of $@
|
||||||
|
# recursion by writing a variant of m4_foreach that uses m4_for rather
|
||||||
|
# than $@ recursion to operate on the list. This involves more macro
|
||||||
|
# expansions, but avoids the need to rescan a quadratic number of
|
||||||
|
# arguments, making these replacements very attractive for M4 1.4.x.
|
||||||
|
# On the other hand, in any version of M4, expanding additional macros
|
||||||
|
# costs additional time; therefore, in M4 1.6, where $@ recursion uses
|
||||||
|
# fewer macros, these replacements actually pessimize performance.
|
||||||
|
# Additionally, the use of $10 to mean the tenth argument violates
|
||||||
|
# POSIX; although all versions of m4 1.4.x support this meaning, a
|
||||||
|
# future m4 version may switch to take it as the first argument
|
||||||
|
# concatenated with a literal 0, so the implementations in this file
|
||||||
|
# are not future-proof. Thus, this file is conditionally included as
|
||||||
|
# part of m4_init(), only when it is detected that M4 probably has
|
||||||
|
# quadratic behavior (ie. it lacks the macro __m4_version__).
|
||||||
|
#
|
||||||
|
# Please keep this file in sync with m4sugar.m4.
|
||||||
|
|
||||||
|
# m4_foreach(VARIABLE, LIST, EXPRESSION)
|
||||||
|
# --------------------------------------
|
||||||
|
# Expand EXPRESSION assigning each value of the LIST to VARIABLE.
|
||||||
|
# LIST should have the form `item_1, item_2, ..., item_n', i.e. the
|
||||||
|
# whole list must *quoted*. Quote members too if you don't want them
|
||||||
|
# to be expanded.
|
||||||
|
#
|
||||||
|
# This version minimizes the number of times that $@ is evaluated by
|
||||||
|
# using m4_for to generate a boilerplate into VARIABLE then passing $@
|
||||||
|
# to that temporary macro. Thus, the recursion is done in m4_for
|
||||||
|
# without reparsing any user input, and is not quadratic. For an idea
|
||||||
|
# of how this works, note that m4_foreach(i,[1,2],[i]) defines i to be
|
||||||
|
# m4_define([$1],[$3])$2[]m4_define([$1],[$4])$2[]m4_popdef([i])
|
||||||
|
# then calls i([i],[i],[1],[2]).
|
||||||
|
m4_define([m4_foreach],
|
||||||
|
[m4_if([$2], [], [], [_$0([$1], [$3], $2)])])
|
||||||
|
|
||||||
|
m4_define([_m4_foreach],
|
||||||
|
[m4_define([$1], m4_pushdef([$1])_m4_for([$1], [3], [$#], [1],
|
||||||
|
[$0_([1], [2], _m4_defn([$1]))])[m4_popdef([$1])])m4_indir([$1], $@)])
|
||||||
|
|
||||||
|
m4_define([_m4_foreach_],
|
||||||
|
[[m4_define([$$1], [$$3])$$2[]]])
|
||||||
|
|
||||||
|
# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
# Find the first VAL that SWITCH matches, and expand the corresponding
|
||||||
|
# IF-VAL. If there are no matches, expand DEFAULT.
|
||||||
|
#
|
||||||
|
# Use m4_for to create a temporary macro in terms of a boilerplate
|
||||||
|
# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is
|
||||||
|
# odd, then rounding the last $# up in the temporary macro is
|
||||||
|
# harmless. For example, both m4_case(1,2,3,4,5) and
|
||||||
|
# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being
|
||||||
|
# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6])
|
||||||
|
m4_define([m4_case],
|
||||||
|
[m4_if(m4_eval([$# <= 2]), [1], [$2],
|
||||||
|
[m4_pushdef([_$0], [m4_if(]m4_for([_m4_count], [2], m4_decr([$#]), [2],
|
||||||
|
[_$0_([1], _m4_count, m4_incr(_m4_count))])[_m4_popdef(
|
||||||
|
[_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_case_],
|
||||||
|
[[[$$1],[$$2],[$$3],]])
|
||||||
|
|
||||||
|
# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
|
||||||
|
# -----------------------------------------------------
|
||||||
|
# m4 equivalent of
|
||||||
|
#
|
||||||
|
# if (SWITCH =~ RE1)
|
||||||
|
# VAL1;
|
||||||
|
# elif (SWITCH =~ RE2)
|
||||||
|
# VAL2;
|
||||||
|
# elif ...
|
||||||
|
# ...
|
||||||
|
# else
|
||||||
|
# DEFAULT
|
||||||
|
#
|
||||||
|
# We build the temporary macro _m4_b:
|
||||||
|
# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])...
|
||||||
|
# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b]))
|
||||||
|
# then invoke m4_unquote(_m4_b($@)), for concatenation with later text.
|
||||||
|
m4_define([m4_bmatch],
|
||||||
|
[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
|
||||||
|
[$#], 2, [$2],
|
||||||
|
[m4_define([_m4_b], m4_pushdef([_m4_b])[m4_define([_m4_b],
|
||||||
|
_m4_defn([_$0]))]_m4_for([_m4_b], [3], m4_eval([($# + 1) / 2 * 2 - 1]),
|
||||||
|
[2], [_$0_([1], m4_decr(_m4_b), _m4_b)])[_m4_b([], [],]m4_dquote(
|
||||||
|
[$]m4_incr(_m4_b))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
|
||||||
|
|
||||||
|
m4_define([_m4_bmatch],
|
||||||
|
[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
|
||||||
|
|
||||||
|
m4_define([_m4_bmatch_],
|
||||||
|
[[_m4_b([$$1], [$$2], [$$3])]])
|
||||||
|
|
||||||
|
|
||||||
|
# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Similar to m4_if, except that each TEST is expanded when encountered.
|
||||||
|
# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
|
||||||
|
# The result is DEFAULT if no tests passed. This macro allows
|
||||||
|
# short-circuiting of expensive tests, where it pays to arrange quick
|
||||||
|
# filter tests to run first.
|
||||||
|
#
|
||||||
|
# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n.
|
||||||
|
# We only have to speed up _m4_cond, by building the temporary _m4_c:
|
||||||
|
# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)],
|
||||||
|
# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)],
|
||||||
|
# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)],
|
||||||
|
# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c]))
|
||||||
|
# We invoke m4_unquote(_m4_c($@)), for concatenation with later text.
|
||||||
|
m4_define([_m4_cond],
|
||||||
|
[m4_define([_m4_c], m4_pushdef([_m4_c])[m4_define([_m4_c],
|
||||||
|
_m4_defn([m4_unquote]))]_m4_for([_m4_c], [2], m4_eval([$# / 3 * 3 - 1]), [3],
|
||||||
|
[$0_(m4_decr(_m4_c), _m4_c, m4_incr(_m4_c))])[_m4_c(]m4_dquote(m4_dquote(
|
||||||
|
[$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
|
||||||
|
|
||||||
|
m4_define([_m4_cond_],
|
||||||
|
[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
|
||||||
|
|
||||||
|
# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
|
||||||
|
# ----------------------------------------------------
|
||||||
|
# m4 equivalent of
|
||||||
|
#
|
||||||
|
# $_ = STRING;
|
||||||
|
# s/RE1/SUBST1/g;
|
||||||
|
# s/RE2/SUBST2/g;
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# m4_bpatsubsts already validated an odd number of arguments; we only
|
||||||
|
# need to speed up _m4_bpatsubsts. To avoid nesting, we build the
|
||||||
|
# temporary _m4_p:
|
||||||
|
# m4_define([_m4_p], [$1])m4_define([_m4_p],
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
|
||||||
|
# _m4_defn([_m4_p])_m4_popdef([_m4_p]))
|
||||||
|
m4_define([_m4_bpatsubsts],
|
||||||
|
[m4_define([_m4_p], m4_pushdef([_m4_p])[m4_define([_m4_p],
|
||||||
|
]m4_dquote([$]1)[)]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
|
||||||
|
_m4_p)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
|
||||||
|
|
||||||
|
m4_define([_m4_bpatsubsts_],
|
||||||
|
[[m4_define([_m4_p],
|
||||||
|
m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
|
||||||
|
|
||||||
|
# m4_shiftn(N, ...)
|
||||||
|
# -----------------
|
||||||
|
# Returns ... shifted N times. Useful for recursive "varargs" constructs.
|
||||||
|
#
|
||||||
|
# m4_shiftn already validated arguments; we only need to speed up
|
||||||
|
# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as
|
||||||
|
# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s])
|
||||||
|
# before calling m4_shift(_m4_s($@)).
|
||||||
|
m4_define([_m4_shiftn],
|
||||||
|
[m4_if(m4_incr([$1]), [$#], [], [m4_define([_m4_s],
|
||||||
|
m4_pushdef([_m4_s])_m4_for([_m4_s], m4_eval([$1 + 2]), [$#], [1],
|
||||||
|
[[,]m4_dquote([$]_m4_s)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
|
||||||
|
|
||||||
|
# m4_do(STRING, ...)
|
||||||
|
# ------------------
|
||||||
|
# This macro invokes all its arguments (in sequence, of course). It is
|
||||||
|
# useful for making your macros more structured and readable by dropping
|
||||||
|
# unnecessary dnl's and have the macros indented properly.
|
||||||
|
#
|
||||||
|
# Here, we use the temporary macro _m4_do, defined as
|
||||||
|
# $1[]$2[]...[]$n[]_m4_popdef([_m4_do])
|
||||||
|
m4_define([m4_do],
|
||||||
|
[m4_if([$#], [0], [],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [1], [$#], [1],
|
||||||
|
[$_$0[[]]])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
# m4_dquote_elt(ARGS)
|
||||||
|
# -------------------
|
||||||
|
# Return ARGS as an unquoted list of double-quoted arguments.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue. It's easier to shift off the leading comma.
|
||||||
|
m4_define([m4_dquote_elt],
|
||||||
|
[m4_shift(m4_foreach([_m4_elt], [$@], [,m4_dquote(_m4_defn([_m4_elt]))]))])
|
||||||
|
|
||||||
|
# m4_reverse(ARGS)
|
||||||
|
# ----------------
|
||||||
|
# Output ARGS in reverse order.
|
||||||
|
#
|
||||||
|
# Invoke _m4_r($@) with the temporary _m4_r built as
|
||||||
|
# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r])
|
||||||
|
m4_define([m4_reverse],
|
||||||
|
[m4_if([$#], [0], [], [$#], [1], [[$1]],
|
||||||
|
[m4_define([_m4_r], m4_dquote([$$#])m4_pushdef([_m4_r])_m4_for([_m4_r],
|
||||||
|
m4_decr([$#]), [1], [-1],
|
||||||
|
[[, ]m4_dquote([$]_m4_r)])[_m4_popdef([_m4_r])])_m4_r($@)])])
|
||||||
|
|
||||||
|
|
||||||
|
# m4_map(MACRO, LIST)
|
||||||
|
# -------------------
|
||||||
|
# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements
|
||||||
|
# of LIST. $1, $2... must in turn be lists, appropriate for m4_apply.
|
||||||
|
#
|
||||||
|
# m4_map/m4_map_sep only execute once; the speedup comes in fixing
|
||||||
|
# _m4_map. The mismatch in () is intentional, since $1 supplies the
|
||||||
|
# opening `(' (but it sure looks odd!). Build the temporary _m4_m:
|
||||||
|
# $1, [$3])$1, [$4])...$1, [$m])_m4_popdef([_m4_m])
|
||||||
|
m4_define([_m4_map],
|
||||||
|
[m4_if([$#], [2], [],
|
||||||
|
[m4_define([_m4_m], m4_pushdef([_m4_m])_m4_for([_m4_m], [3], [$#], [1],
|
||||||
|
[$0_([1], _m4_m)])[_m4_popdef([_m4_m])])_m4_m($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_map_],
|
||||||
|
[[$$1, [$$2])]])
|
||||||
|
|
||||||
|
# m4_transform(EXPRESSION, ARG...)
|
||||||
|
# --------------------------------
|
||||||
|
# Expand EXPRESSION([ARG]) for each argument. More efficient than
|
||||||
|
# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
|
||||||
|
#
|
||||||
|
# Invoke the temporary macro _m4_transform, defined as:
|
||||||
|
# $1([$2])[]$1([$3])[]...$1([$m])[]_m4_popdef([_m4_transform])
|
||||||
|
m4_define([m4_transform],
|
||||||
|
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], [1], [],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [2], [$#], [1],
|
||||||
|
[_$0_([1], _$0)])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_],
|
||||||
|
[[$$1([$$2])[]]])
|
||||||
|
|
||||||
|
# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
# Perform a pairwise grouping of consecutive ARGs, by expanding
|
||||||
|
# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the
|
||||||
|
# final argument is expanded with END-EXPR([ARGn]).
|
||||||
|
#
|
||||||
|
# Build the temporary macro _m4_transform_pair, with the $2([$m+1])
|
||||||
|
# only output if $# is odd:
|
||||||
|
# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1],
|
||||||
|
# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_transform_pair])
|
||||||
|
m4_define([m4_transform_pair],
|
||||||
|
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
|
||||||
|
[$#], [2], [],
|
||||||
|
[$#], [3], [m4_default([$2], [$1])([$3])[]],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [3],
|
||||||
|
m4_eval([$# / 2 * 2 - 1]), [2], [_$0_([1], _$0, m4_incr(_$0))])_$0_end(
|
||||||
|
[1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_pair_],
|
||||||
|
[[$$1([$$2], [$$3])[]]])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_pair_end],
|
||||||
|
[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
|
||||||
|
|
||||||
|
# m4_join(SEP, ARG1, ARG2...)
|
||||||
|
# ---------------------------
|
||||||
|
# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG
|
||||||
|
# is the empty string. No expansion is performed on SEP or ARGs.
|
||||||
|
#
|
||||||
|
# Use a self-modifying separator, since we don't know how many
|
||||||
|
# arguments might be skipped before a separator is first printed, but
|
||||||
|
# be careful if the separator contains $. m4_foreach to the rescue.
|
||||||
|
m4_define([m4_join],
|
||||||
|
[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl
|
||||||
|
[m4_foreach([_m4_arg], [m4_shift($@)],
|
||||||
|
[m4_ifset([_m4_arg], [_m4_sep([$1])_m4_defn([_m4_arg])])])]dnl
|
||||||
|
[_m4_popdef([_m4_sep])])
|
||||||
|
|
||||||
|
# m4_joinall(SEP, ARG1, ARG2...)
|
||||||
|
# ------------------------------
|
||||||
|
# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP.
|
||||||
|
# No expansion is performed on SEP or ARGs.
|
||||||
|
#
|
||||||
|
# A bit easier than m4_join. m4_foreach to the rescue.
|
||||||
|
m4_define([m4_joinall],
|
||||||
|
[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
|
||||||
|
[m4_foreach([_m4_arg], [m4_shift2($@)],
|
||||||
|
[[$1]_m4_defn([_m4_arg])])])])
|
||||||
|
|
||||||
|
# m4_list_cmp(A, B)
|
||||||
|
# -----------------
|
||||||
|
# Compare the two lists of integer expressions A and B.
|
||||||
|
#
|
||||||
|
# m4_list_cmp takes care of any side effects; we only override
|
||||||
|
# _m4_list_cmp_raw, where we can safely expand lists multiple times.
|
||||||
|
# First, insert padding so that both lists are the same length; the
|
||||||
|
# trailing +0 is necessary to handle a missing list. Next, create a
|
||||||
|
# temporary macro to perform pairwise comparisons until an inequality
|
||||||
|
# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as
|
||||||
|
# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])],
|
||||||
|
# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])],
|
||||||
|
# [0]_m4_popdef([_m4_cmp], [_m4_size]))
|
||||||
|
# then calls _m4_cmp([1+0], [0], [1], [2+0])
|
||||||
|
m4_define([_m4_list_cmp_raw],
|
||||||
|
[m4_if([$1], [$2], 0, [m4_pushdef(
|
||||||
|
[_m4_size])_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
|
||||||
|
$2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
|
||||||
|
|
||||||
|
m4_define([_m4_list_pad],
|
||||||
|
[m4_if(m4_eval($1 < $2), [1],
|
||||||
|
[_m4_for([_m4_size], m4_incr([$1]), [$2], [1], [,0])])])
|
||||||
|
|
||||||
|
m4_define([_m4_list_cmp],
|
||||||
|
[m4_define([_m4_size], m4_eval([$# >> 1]))]dnl
|
||||||
|
[m4_define([_m4_cmp], m4_pushdef([_m4_cmp])[m4_if(]_m4_for([_m4_cmp],
|
||||||
|
[1], _m4_size, [1], [$0_(_m4_cmp, m4_eval(_m4_cmp + _m4_size))])[
|
||||||
|
[0]_m4_popdef([_m4_cmp], [_m4_size]))])_m4_cmp($@)])
|
||||||
|
|
||||||
|
m4_define([_m4_list_cmp_],
|
||||||
|
[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
|
||||||
|
]])
|
||||||
|
|
||||||
|
# m4_max(EXPR, ...)
|
||||||
|
# m4_min(EXPR, ...)
|
||||||
|
# -----------------
|
||||||
|
# Return the decimal value of the maximum (or minimum) in a series of
|
||||||
|
# integer expressions.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue; we only need to replace _m4_minmax. Here,
|
||||||
|
# we need a temporary macro to track the best answer so far, so that
|
||||||
|
# the foreach expression is tractable.
|
||||||
|
m4_define([_m4_minmax],
|
||||||
|
[m4_pushdef([_m4_best], m4_eval([$2]))m4_foreach([_m4_arg], [m4_shift2($@)],
|
||||||
|
[m4_define([_m4_best], $1(_m4_best, _m4_defn([_m4_arg])))])]dnl
|
||||||
|
[_m4_best[]_m4_popdef([_m4_best])])
|
||||||
|
|
||||||
|
# m4_set_add_all(SET, VALUE...)
|
||||||
|
# -----------------------------
|
||||||
|
# Add each VALUE into SET. This is O(n) in the number of VALUEs, and
|
||||||
|
# can be faster than calling m4_set_add for each VALUE.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue. If no deletions have occurred, then avoid
|
||||||
|
# the speed penalty of m4_set_add.
|
||||||
|
m4_define([m4_set_add_all],
|
||||||
|
[m4_if([$#], [0], [], [$#], [1], [],
|
||||||
|
[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
|
||||||
|
+ m4_len(m4_foreach([_m4_arg], [m4_shift($@)],
|
||||||
|
m4_ifdef([_m4_set_cleanup($1)],
|
||||||
|
[[m4_set_add([$1], _m4_defn([_m4_arg]))]],
|
||||||
|
[[m4_ifdef([_m4_set([$1],]_m4_defn([_m4_arg])[)], [],
|
||||||
|
[m4_define([_m4_set([$1],]_m4_defn([_m4_arg])[)],
|
||||||
|
[1])m4_pushdef([_m4_set([$1])],
|
||||||
|
_m4_defn([_m4_arg]))-])]])))))])])
|
||||||
+1388
-373
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
bison.xsl - common templates for Bison XSLT.
|
bison.xsl - common templates for Bison XSLT.
|
||||||
$Id$
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
$Id$
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2text.xsl - transform Bison XML Report into plain text.
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
$Id$
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
$Id$
|
|
||||||
|
|
||||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Makefile
|
Makefile
|
||||||
|
bison.1
|
||||||
bison.aux
|
bison.aux
|
||||||
bison.cp
|
bison.cp
|
||||||
bison.cps
|
bison.cps
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
/Makefile
|
||||||
|
/bison.1
|
||||||
|
/bison.aux
|
||||||
|
/bison.cp
|
||||||
|
/bison.cps
|
||||||
|
/bison.dvi
|
||||||
|
/bison.fn
|
||||||
|
/bison.html
|
||||||
|
/bison.ky
|
||||||
|
/bison.log
|
||||||
|
/bison.pdf
|
||||||
|
/bison.pg
|
||||||
|
/bison.ps
|
||||||
|
/bison.toc
|
||||||
|
/bison.tp
|
||||||
|
/bison.vr
|
||||||
|
/cross-options.texi
|
||||||
|
/Makefile.in
|
||||||
|
/refcard.dvi
|
||||||
|
/refcard.log
|
||||||
|
/refcard.ps
|
||||||
|
/*.info*
|
||||||
|
/stamp-vti
|
||||||
|
/version.texi
|
||||||
|
/yacc.1
|
||||||
+1
-1
@@ -23,7 +23,7 @@ PROJECT_NAME = "@PACKAGE_NAME@"
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = "@PACKAGE_VERSION@ @ID@"
|
PROJECT_NUMBER = "@PACKAGE_VERSION@"
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
|
|||||||
+6
-14
@@ -1,5 +1,6 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008 Free Software
|
||||||
|
## Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -53,15 +54,11 @@ dist_man_MANS = $(srcdir)/bison.1
|
|||||||
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
||||||
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||||
|
|
||||||
# Depend on configure.ac to get version number changes.
|
# Depend on configure to get version number changes.
|
||||||
common_dep = $(top_srcdir)/configure.ac $(srcdir)/common.x
|
common_dep = $(top_srcdir)/configure $(srcdir)/common.x
|
||||||
srcsrcdir = $(top_srcdir)/bin
|
srcsrcdir = $(top_srcdir)/bin
|
||||||
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
||||||
|
|
||||||
# Output from --help and --version that must not appear in the man page.
|
|
||||||
neutralize = \
|
|
||||||
perl -0777 -pi -e 's/\.PP\nId:.*\n//g'
|
|
||||||
|
|
||||||
# Differences to ignore when comparing the man page (the date).
|
# Differences to ignore when comparing the man page (the date).
|
||||||
remove_time_stamp = \
|
remove_time_stamp = \
|
||||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||||
@@ -87,7 +84,6 @@ PREPATH = $(top_builddir)/src
|
|||||||
--include=$*.x \
|
--include=$*.x \
|
||||||
--include=$(srcdir)/common.x \
|
--include=$(srcdir)/common.x \
|
||||||
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
||||||
$(neutralize) $@.t
|
|
||||||
if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
||||||
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
||||||
touch $@; \
|
touch $@; \
|
||||||
@@ -111,8 +107,7 @@ doc: html
|
|||||||
html-local: Doxyfile
|
html-local: Doxyfile
|
||||||
$(DOXYGEN)
|
$(DOXYGEN)
|
||||||
|
|
||||||
edit = sed -e "s|@ID@|$$Id|" \
|
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
|
||||||
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
-e 's,@top_builddir\@,$(top_builddir),g' \
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
@@ -121,10 +116,7 @@ EXTRA_DIST += Doxyfile.in
|
|||||||
CLEANFILES += Doxyfile
|
CLEANFILES += Doxyfile
|
||||||
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
# configure, because the former is way faster than the latter.
|
# configure, because the former is way faster than the latter.
|
||||||
# Moreover, this file is updated whenever ChangeLog is touched: using
|
Doxyfile: $(srcdir)/Doxyfile.in
|
||||||
# sed instead of configure saves us a lot of time.
|
|
||||||
Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
|
|
||||||
Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
|
|
||||||
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
||||||
|
|
||||||
CLEANDIRS += html latex
|
CLEANDIRS += html latex
|
||||||
|
|||||||
-197
@@ -1,197 +0,0 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
|
||||||
.TH BISON "1" "March 2008" "bison 2.3a+" "User Commands"
|
|
||||||
.SH NAME
|
|
||||||
bison \- GNU Project parser generator (yacc replacement)
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.B bison
|
|
||||||
[\fIOPTION\fR]... \fIFILE\fR
|
|
||||||
.SH DESCRIPTION
|
|
||||||
.I Bison
|
|
||||||
is a parser generator in the style of
|
|
||||||
.IR yacc (1).
|
|
||||||
It should be upwardly compatible with input files designed
|
|
||||||
for
|
|
||||||
.IR yacc .
|
|
||||||
.PP
|
|
||||||
Input files should follow the
|
|
||||||
.I yacc
|
|
||||||
convention of ending in
|
|
||||||
.BR .y .
|
|
||||||
Unlike
|
|
||||||
.IR yacc ,
|
|
||||||
the generated files do not have fixed names, but instead use the prefix
|
|
||||||
of the input file.
|
|
||||||
Moreover, if you need to put
|
|
||||||
.I C++
|
|
||||||
code in the input file, you can end his name by a C++-like extension
|
|
||||||
(.ypp or .y++), then bison will follow your extension to name the
|
|
||||||
output file (.cpp or .c++).
|
|
||||||
For instance, a grammar description file named
|
|
||||||
.B parse.yxx
|
|
||||||
would produce the generated parser in a file named
|
|
||||||
.BR parse.tab.cxx ,
|
|
||||||
instead of
|
|
||||||
.IR yacc 's
|
|
||||||
.B y.tab.c
|
|
||||||
or old
|
|
||||||
.I Bison
|
|
||||||
version's
|
|
||||||
.BR parse.tab.c .
|
|
||||||
.PP
|
|
||||||
This description of the options that can be given to
|
|
||||||
.I bison
|
|
||||||
is adapted from the node
|
|
||||||
.B Invocation
|
|
||||||
in the
|
|
||||||
.B bison.texinfo
|
|
||||||
manual, which should be taken as authoritative.
|
|
||||||
.PP
|
|
||||||
.I Bison
|
|
||||||
supports both traditional single-letter options and mnemonic long
|
|
||||||
option names. Long option names are indicated with
|
|
||||||
.B \-\-
|
|
||||||
instead of
|
|
||||||
.BR \- .
|
|
||||||
Abbreviations for option names are allowed as long as they
|
|
||||||
are unique. When a long option takes an argument, like
|
|
||||||
.BR \-\-file-prefix ,
|
|
||||||
connect the option name and the argument with
|
|
||||||
.BR = .
|
|
||||||
.PP
|
|
||||||
Generate LALR(1) and GLR parsers.
|
|
||||||
.PP
|
|
||||||
Mandatory arguments to long options are mandatory for short options too.
|
|
||||||
The same is true for optional arguments.
|
|
||||||
.SS "Operation modes:"
|
|
||||||
.TP
|
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
|
||||||
display this help and exit
|
|
||||||
.TP
|
|
||||||
\fB\-V\fR, \fB\-\-version\fR
|
|
||||||
output version information and exit
|
|
||||||
.TP
|
|
||||||
\fB\-\-print\-localedir\fR
|
|
||||||
output directory containing locale\-dependent data
|
|
||||||
.TP
|
|
||||||
\fB\-\-print\-datadir\fR
|
|
||||||
output directory containing skeletons and XSLT
|
|
||||||
.TP
|
|
||||||
\fB\-y\fR, \fB\-\-yacc\fR
|
|
||||||
emulate POSIX Yacc
|
|
||||||
.TP
|
|
||||||
\fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR
|
|
||||||
report the warnings falling in CATEGORY
|
|
||||||
.SS "Parser:"
|
|
||||||
.TP
|
|
||||||
\fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\fR
|
|
||||||
specify the output programming language
|
|
||||||
.TP
|
|
||||||
\fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR
|
|
||||||
specify the skeleton to use
|
|
||||||
.TP
|
|
||||||
\fB\-t\fR, \fB\-\-debug\fR
|
|
||||||
instrument the parser for debugging
|
|
||||||
.TP
|
|
||||||
\fB\-\-locations\fR
|
|
||||||
enable locations computation
|
|
||||||
.TP
|
|
||||||
\fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR
|
|
||||||
prepend PREFIX to the external symbols
|
|
||||||
.TP
|
|
||||||
\fB\-l\fR, \fB\-\-no\-lines\fR
|
|
||||||
don't generate `#line' directives
|
|
||||||
.TP
|
|
||||||
\fB\-k\fR, \fB\-\-token\-table\fR
|
|
||||||
include a table of token names
|
|
||||||
.SS "Output:"
|
|
||||||
.TP
|
|
||||||
\fB\-\-defines\fR[=\fIFILE\fR]
|
|
||||||
also produce a header file
|
|
||||||
.TP
|
|
||||||
\fB\-d\fR
|
|
||||||
likewise but cannot specify FILE (for POSIX Yacc)
|
|
||||||
.TP
|
|
||||||
\fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR
|
|
||||||
also produce details on the automaton
|
|
||||||
.TP
|
|
||||||
\fB\-\-report\-file\fR=\fIFILE\fR
|
|
||||||
write report to FILE
|
|
||||||
.TP
|
|
||||||
\fB\-v\fR, \fB\-\-verbose\fR
|
|
||||||
same as `\-\-report=state'
|
|
||||||
.TP
|
|
||||||
\fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR
|
|
||||||
specify a PREFIX for output files
|
|
||||||
.TP
|
|
||||||
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
|
||||||
leave output to FILE
|
|
||||||
.TP
|
|
||||||
\fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR]
|
|
||||||
also output a graph of the automaton
|
|
||||||
.TP
|
|
||||||
\fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR]
|
|
||||||
also output an XML report of the automaton
|
|
||||||
(the XML schema is experimental)
|
|
||||||
.SS "Warning categories include:"
|
|
||||||
.TP
|
|
||||||
`midrule\-values'
|
|
||||||
unset or unused midrule values
|
|
||||||
.TP
|
|
||||||
`yacc'
|
|
||||||
incompatibilities with POSIX YACC
|
|
||||||
.TP
|
|
||||||
`all'
|
|
||||||
all the warnings
|
|
||||||
.TP
|
|
||||||
`no\-CATEGORY'
|
|
||||||
turn off warnings in CATEGORY
|
|
||||||
.TP
|
|
||||||
`none'
|
|
||||||
turn off all the warnings
|
|
||||||
.TP
|
|
||||||
`error'
|
|
||||||
treat warnings as errors
|
|
||||||
.SS "THINGS is a list of comma separated words that can include:"
|
|
||||||
.TP
|
|
||||||
`state'
|
|
||||||
describe the states
|
|
||||||
.TP
|
|
||||||
`itemset'
|
|
||||||
complete the core item sets with their closure
|
|
||||||
.TP
|
|
||||||
`lookahead'
|
|
||||||
explicitly associate lookahead tokens to items
|
|
||||||
.TP
|
|
||||||
`solved'
|
|
||||||
describe shift/reduce conflicts solving
|
|
||||||
.TP
|
|
||||||
`all'
|
|
||||||
include all the above information
|
|
||||||
.TP
|
|
||||||
`none'
|
|
||||||
disable the report
|
|
||||||
.SH AUTHOR
|
|
||||||
Written by Robert Corbett and Richard Stallman.
|
|
||||||
.SH "REPORTING BUGS"
|
|
||||||
Report bugs to <bug\-[email protected]>.
|
|
||||||
.SH COPYRIGHT
|
|
||||||
Copyright \(co 2007 Free Software Foundation, Inc.
|
|
||||||
.br
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.BR lex (1),
|
|
||||||
.BR flex (1),
|
|
||||||
.BR yacc (1).
|
|
||||||
.PP
|
|
||||||
The full documentation for
|
|
||||||
.B bison
|
|
||||||
is maintained as a Texinfo manual. If the
|
|
||||||
.B info
|
|
||||||
and
|
|
||||||
.B bison
|
|
||||||
programs are properly installed at your site, the command
|
|
||||||
.IP
|
|
||||||
.B info bison
|
|
||||||
.PP
|
|
||||||
should give you access to the complete manual.
|
|
||||||
+558
-303
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/bench.pl
|
||||||
+1
-3
@@ -270,9 +270,7 @@ yylex (void)
|
|||||||
|
|
||||||
/* Skip white space. */
|
/* Skip white space. */
|
||||||
while ((c = get_char ()) == ' ' || c == '\t')
|
while ((c = get_char ()) == ' ' || c == '\t')
|
||||||
{
|
continue;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process numbers */
|
/* process numbers */
|
||||||
if (c == '.' || isdigit (c))
|
if (c == '.' || isdigit (c))
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*.cc
|
||||||
|
/*.hh
|
||||||
|
/*.ll
|
||||||
|
/*.o
|
||||||
|
/*.output
|
||||||
|
/*.stamp
|
||||||
|
/*.tmp
|
||||||
|
/*.yy
|
||||||
|
/.deps
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/calc++
|
||||||
|
/calc++.exe
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
external: gnulib
|
||||||
Submodule
+1
Submodule gnulib added at 58fe6dca7b
@@ -17,6 +17,7 @@ configmake.h
|
|||||||
dirname.c
|
dirname.c
|
||||||
dirname.h
|
dirname.h
|
||||||
dup-safer.c
|
dup-safer.c
|
||||||
|
errno.in.h
|
||||||
error.c
|
error.c
|
||||||
error.h
|
error.h
|
||||||
exitfail.c
|
exitfail.c
|
||||||
@@ -87,6 +88,7 @@ unitypes.h
|
|||||||
uniwidth
|
uniwidth
|
||||||
uniwidth.h
|
uniwidth.h
|
||||||
unlocked-io.h
|
unlocked-io.h
|
||||||
|
unsetenv.c
|
||||||
verify.h
|
verify.h
|
||||||
wchar.h
|
wchar.h
|
||||||
wchar.in.h
|
wchar.in.h
|
||||||
|
|||||||
+108
@@ -0,0 +1,108 @@
|
|||||||
|
/*.a
|
||||||
|
/*.o
|
||||||
|
/*~
|
||||||
|
/.deps
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/argmatch.c
|
||||||
|
/argmatch.h
|
||||||
|
/basename.c
|
||||||
|
/c-ctype.c
|
||||||
|
/c-ctype.h
|
||||||
|
/c-strcase.h
|
||||||
|
/c-strcasecmp.c
|
||||||
|
/c-strncasecmp.c
|
||||||
|
/charset.alias
|
||||||
|
/config.charset
|
||||||
|
/config.h
|
||||||
|
/config.hin
|
||||||
|
/configmake.h
|
||||||
|
/dirname.c
|
||||||
|
/dirname.h
|
||||||
|
/dup-safer.c
|
||||||
|
/errno.in.h
|
||||||
|
/error.c
|
||||||
|
/error.h
|
||||||
|
/exitfail.c
|
||||||
|
/exitfail.h
|
||||||
|
/fd-safer.c
|
||||||
|
/fopen-safer.c
|
||||||
|
/getopt.c
|
||||||
|
/getopt.h
|
||||||
|
/getopt.in.h
|
||||||
|
/getopt1.c
|
||||||
|
/getopt_.h
|
||||||
|
/getopt_int.h
|
||||||
|
/gettext.h
|
||||||
|
/gnulib.mk
|
||||||
|
/hash.c
|
||||||
|
/hash.h
|
||||||
|
/intprops.h
|
||||||
|
/inttypes.h
|
||||||
|
/inttypes.in.h
|
||||||
|
/inttypes_.h
|
||||||
|
/localcharset.c
|
||||||
|
/localcharset.h
|
||||||
|
/malloc.c
|
||||||
|
/mbswidth.c
|
||||||
|
/mbswidth.h
|
||||||
|
/obstack.c
|
||||||
|
/obstack.h
|
||||||
|
/pipe-safer.c
|
||||||
|
/quote.c
|
||||||
|
/quote.h
|
||||||
|
/quotearg.c
|
||||||
|
/quotearg.h
|
||||||
|
/ref-add.sed
|
||||||
|
/ref-add.sin
|
||||||
|
/ref-del.sed
|
||||||
|
/ref-del.sin
|
||||||
|
/stamp-h1
|
||||||
|
/stdbool.h
|
||||||
|
/stdbool.in.h
|
||||||
|
/stdbool_.h
|
||||||
|
/stdint.h
|
||||||
|
/stdint.in.h
|
||||||
|
/stdint_.h
|
||||||
|
/stdio--.h
|
||||||
|
/stdio-safer.h
|
||||||
|
/stdlib.h
|
||||||
|
/stdlib.in.h
|
||||||
|
/stdlib_.h
|
||||||
|
/stpcpy.c
|
||||||
|
/streq.h
|
||||||
|
/strerror.c
|
||||||
|
/string.h
|
||||||
|
/string.in.h
|
||||||
|
/string_.h
|
||||||
|
/stripslash.c
|
||||||
|
/strndup.c
|
||||||
|
/strnlen.c
|
||||||
|
/strtol.c
|
||||||
|
/strtoul.c
|
||||||
|
/strverscmp.c
|
||||||
|
/strverscmp.h
|
||||||
|
/unistd--.h
|
||||||
|
/unistd-safer.h
|
||||||
|
/unistd.h
|
||||||
|
/unistd.in.h
|
||||||
|
/unistd_.h
|
||||||
|
/unitypes.h
|
||||||
|
/uniwidth
|
||||||
|
/uniwidth.h
|
||||||
|
/unlocked-io.h
|
||||||
|
/unsetenv.c
|
||||||
|
/verify.h
|
||||||
|
/wchar.h
|
||||||
|
/wchar.in.h
|
||||||
|
/wchar_.h
|
||||||
|
/wctype.h
|
||||||
|
/wctype.in.h
|
||||||
|
/wctype_.h
|
||||||
|
/wcwidth.c
|
||||||
|
/wcwidth.h
|
||||||
|
/xalloc-die.c
|
||||||
|
/xalloc.h
|
||||||
|
/xmalloc.c
|
||||||
|
/xstrndup.c
|
||||||
|
/xstrndup.h
|
||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
# Make bison/lib.
|
# Make bison/lib.
|
||||||
|
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
|
|
||||||
include gnulib.mk
|
include gnulib.mk
|
||||||
|
|
||||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
AM_CFLAGS = $(WARN_CFLAGS)
|
||||||
|
|
||||||
# Implementation of bitsets.
|
# Implementation of bitsets.
|
||||||
bitsets_sources = \
|
bitsets_sources = \
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ config-h.m4
|
|||||||
dirname.m4
|
dirname.m4
|
||||||
dos.m4
|
dos.m4
|
||||||
double-slash-root.m4
|
double-slash-root.m4
|
||||||
|
environ.m4
|
||||||
|
errno_h.m4
|
||||||
error.m4
|
error.m4
|
||||||
exitfail.m4
|
exitfail.m4
|
||||||
extensions.m4
|
extensions.m4
|
||||||
@@ -37,6 +39,7 @@ po.m4
|
|||||||
progtest.m4
|
progtest.m4
|
||||||
quote.m4
|
quote.m4
|
||||||
quotearg.m4
|
quotearg.m4
|
||||||
|
setenv.m4
|
||||||
stdbool.m4
|
stdbool.m4
|
||||||
stdint.m4
|
stdint.m4
|
||||||
stdint_h.m4
|
stdint_h.m4
|
||||||
@@ -50,10 +53,12 @@ strnlen.m4
|
|||||||
strtol.m4
|
strtol.m4
|
||||||
strtoul.m4
|
strtoul.m4
|
||||||
strverscmp.m4
|
strverscmp.m4
|
||||||
|
threadlib.m4
|
||||||
unistd-safer.m4
|
unistd-safer.m4
|
||||||
unistd_h.m4
|
unistd_h.m4
|
||||||
unlocked-io.m4
|
unlocked-io.m4
|
||||||
warning.m4
|
warning.m4
|
||||||
|
warnings.m4
|
||||||
wchar.m4
|
wchar.m4
|
||||||
wchar_t.m4
|
wchar_t.m4
|
||||||
wctype.m4
|
wctype.m4
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/absolute-header.m4
|
||||||
|
/argmatch.m4
|
||||||
|
/config-h.m4
|
||||||
|
/dirname.m4
|
||||||
|
/dos.m4
|
||||||
|
/double-slash-root.m4
|
||||||
|
/environ.m4
|
||||||
|
/errno_h.m4
|
||||||
|
/error.m4
|
||||||
|
/exitfail.m4
|
||||||
|
/extensions.m4
|
||||||
|
/getopt.m4
|
||||||
|
/gettext.m4
|
||||||
|
/gnulib-cache.m4
|
||||||
|
/gnulib-common.m4
|
||||||
|
/gnulib-comp.m4
|
||||||
|
/gnulib-tool.m4
|
||||||
|
/hash.m4
|
||||||
|
/iconv.m4
|
||||||
|
/include_next.m4
|
||||||
|
/inline.m4
|
||||||
|
/intlmacosx.m4
|
||||||
|
/inttypes-h.m4
|
||||||
|
/inttypes-pri.m4
|
||||||
|
/inttypes.m4
|
||||||
|
/javacomp.m4
|
||||||
|
/javaexec.m4
|
||||||
|
/lib-ld.m4
|
||||||
|
/lib-link.m4
|
||||||
|
/lib-prefix.m4
|
||||||
|
/localcharset.m4
|
||||||
|
/longlong.m4
|
||||||
|
/malloc.m4
|
||||||
|
/mbrtowc.m4
|
||||||
|
/mbstate_t.m4
|
||||||
|
/mbswidth.m4
|
||||||
|
/nls.m4
|
||||||
|
/po.m4
|
||||||
|
/progtest.m4
|
||||||
|
/quote.m4
|
||||||
|
/quotearg.m4
|
||||||
|
/setenv.m4
|
||||||
|
/stdbool.m4
|
||||||
|
/stdint.m4
|
||||||
|
/stdint_h.m4
|
||||||
|
/stdio-safer.m4
|
||||||
|
/stdlib_h.m4
|
||||||
|
/stpcpy.m4
|
||||||
|
/strerror.m4
|
||||||
|
/string_h.m4
|
||||||
|
/strndup.m4
|
||||||
|
/strnlen.m4
|
||||||
|
/strtol.m4
|
||||||
|
/strtoul.m4
|
||||||
|
/strverscmp.m4
|
||||||
|
/threadlib.m4
|
||||||
|
/unistd-safer.m4
|
||||||
|
/unistd_h.m4
|
||||||
|
/unlocked-io.m4
|
||||||
|
/warning.m4
|
||||||
|
/warnings.m4
|
||||||
|
/wchar.m4
|
||||||
|
/wchar_t.m4
|
||||||
|
/wctype.m4
|
||||||
|
/wcwidth.m4
|
||||||
|
/wint_t.m4
|
||||||
|
/xalloc.m4
|
||||||
|
/xstrndup.m4
|
||||||
@@ -0,0 +1,858 @@
|
|||||||
|
# -*-Makefile-*-
|
||||||
|
# This Makefile fragment tries to be general-purpose enough to be
|
||||||
|
# used by at least coreutils, idutils, CPPI, Bison, and Autoconf.
|
||||||
|
|
||||||
|
## Copyright (C) 2001-2008 Free Software Foundation, Inc.
|
||||||
|
##
|
||||||
|
## 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
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# This is reported not to work with make-3.79.1
|
||||||
|
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||||
|
ME := maint.mk
|
||||||
|
|
||||||
|
# Do not save the original name or timestamp in the .tar.gz file.
|
||||||
|
# Use --rsyncable if available.
|
||||||
|
gzip_rsyncable := \
|
||||||
|
$(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
|
||||||
|
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
|
||||||
|
|
||||||
|
GIT = git
|
||||||
|
VC = $(GIT)
|
||||||
|
VC-tag = git tag -s -m '$(VERSION)'
|
||||||
|
|
||||||
|
VC_LIST = build-aux/vc-list-files
|
||||||
|
|
||||||
|
VC_LIST_EXCEPT = \
|
||||||
|
$(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||||
|
|
||||||
|
ifeq ($(origin prev_version_file), undefined)
|
||||||
|
prev_version_file = $(srcdir)/.prev-version
|
||||||
|
endif
|
||||||
|
|
||||||
|
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||||
|
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||||
|
PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
|
||||||
|
|
||||||
|
ifeq ($(VC),$(GIT))
|
||||||
|
this-vc-tag = v$(VERSION)
|
||||||
|
this-vc-tag-regexp = v$(VERSION_REGEXP)
|
||||||
|
else
|
||||||
|
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||||
|
tag-this-version = $(subst .,_,$(VERSION))
|
||||||
|
this-vc-tag = $(tag-package)-$(tag-this-version)
|
||||||
|
this-vc-tag-regexp = $(this-vc-tag)
|
||||||
|
endif
|
||||||
|
my_distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
|
# Old releases are stored here.
|
||||||
|
release_archive_dir ?= ../release
|
||||||
|
|
||||||
|
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||||
|
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||||
|
export LC_ALL = C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## --------------- ##
|
||||||
|
## Sanity checks. ##
|
||||||
|
## --------------- ##
|
||||||
|
|
||||||
|
# Collect the names of rules starting with `sc_'.
|
||||||
|
syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
|
||||||
|
$(srcdir)/$(ME))
|
||||||
|
.PHONY: $(syntax-check-rules)
|
||||||
|
|
||||||
|
local-checks-available = \
|
||||||
|
po-check copyright-check m4-check author_mark_check \
|
||||||
|
patch-check strftime-check $(syntax-check-rules) \
|
||||||
|
makefile_path_separator_check \
|
||||||
|
makefile-check check-AUTHORS
|
||||||
|
.PHONY: $(local-checks-available)
|
||||||
|
|
||||||
|
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||||
|
|
||||||
|
syntax-check: $(local-check)
|
||||||
|
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||||
|
# $$(find -type f -name '*.[chly]') && \
|
||||||
|
# { echo '$(ME): found conditional include' 1>&2; \
|
||||||
|
# exit 1; } || :
|
||||||
|
|
||||||
|
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||||
|
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||||
|
# { echo '$(ME): FIXME' 1>&2; \
|
||||||
|
# exit 1; } || :
|
||||||
|
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||||
|
|
||||||
|
sc_avoid_if_before_free:
|
||||||
|
@$(srcdir)/build-aux/useless-if-before-free \
|
||||||
|
$(useless_free_options) \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found useless "if" before "free" above' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_cast_of_argument_to_free:
|
||||||
|
@grep -nE '\<free *\( *\(' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_cast_of_x_alloc_return_value:
|
||||||
|
@grep -nE '\*\) *x(m|c|re)alloc\>' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_cast_of_alloca_return_value:
|
||||||
|
@grep -nE '\*\) *alloca\>' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_space_tab:
|
||||||
|
@grep -n '[ ] ' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Don't use *scanf or the old ato* functions in `real' code.
|
||||||
|
# They provide no error checking mechanism.
|
||||||
|
# Instead, use strto* functions.
|
||||||
|
sc_prohibit_atoi_atof:
|
||||||
|
@grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||||
|
sc_prohibit_strcmp:
|
||||||
|
@grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *==' \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): use STREQ in place of the above uses of str''cmp' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||||
|
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||||
|
sc_error_exit_success:
|
||||||
|
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||||
|
$$(find -type f -name '*.[chly]') && \
|
||||||
|
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# `FATAL:' should be fully upper-cased in error messages
|
||||||
|
# `WARNING:' should be fully upper-cased, or fully lower-cased
|
||||||
|
sc_error_message_warn_fatal:
|
||||||
|
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||||
|
| grep -E '"Warning|"Fatal|"fatal' && \
|
||||||
|
{ echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Error messages should not start with a capital letter
|
||||||
|
sc_error_message_uppercase:
|
||||||
|
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||||
|
| grep -E '"[A-Z]' \
|
||||||
|
| grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \
|
||||||
|
{ echo '$(ME): found capitalized error message' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Error messages should not end with a period
|
||||||
|
sc_error_message_period:
|
||||||
|
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||||
|
| grep -E '[^."]\."' && \
|
||||||
|
{ echo '$(ME): found error message ending in period' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_file_system:
|
||||||
|
@grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found use of "file''system";' \
|
||||||
|
'rewrite to use "file system"' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Don't use cpp tests of this symbol. All code assumes config.h is included.
|
||||||
|
sc_no_have_config_h:
|
||||||
|
@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Nearly all .c files must include <config.h>.
|
||||||
|
sc_require_config_h:
|
||||||
|
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||||
|
grep -L '^# *include <config\.h>' \
|
||||||
|
$$($(VC_LIST_EXCEPT) | grep '\.c$$') \
|
||||||
|
| grep . && \
|
||||||
|
{ echo '$(ME): the above files do not include <config.h>' \
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
else :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# To use this "command" macro, you must first define two shell variables:
|
||||||
|
# h: the header, enclosed in <> or ""
|
||||||
|
# re: a regular expression that matches IFF something provided by $h is used.
|
||||||
|
define _header_without_use
|
||||||
|
h_esc=`echo "$$h"|sed 's/\./\\./'`; \
|
||||||
|
if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||||
|
files=$$(grep -l '^# *include '"$$h_esc" \
|
||||||
|
$$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||||
|
grep -LE "$$re" $$files | grep . && \
|
||||||
|
{ echo "$(ME): the above files include $$h but don't use it" \
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
else :; \
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||||
|
sc_prohibit_assert_without_use:
|
||||||
|
@h='<assert.h>' re='\<assert *\(' $(_header_without_use)
|
||||||
|
|
||||||
|
# Prohibit the inclusion of getopt.h without an actual use.
|
||||||
|
sc_prohibit_getopt_without_use:
|
||||||
|
@h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
|
||||||
|
|
||||||
|
# Don't include quotearg.h unless you use one of its functions.
|
||||||
|
sc_prohibit_quotearg_without_use:
|
||||||
|
@h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
|
||||||
|
|
||||||
|
# Don't include quote.h unless you use one of its functions.
|
||||||
|
sc_prohibit_quote_without_use:
|
||||||
|
@h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
|
||||||
|
|
||||||
|
# Don't include this header unless you use one of its functions.
|
||||||
|
sc_prohibit_long_options_without_use:
|
||||||
|
@h='"long-options.h"' re='\<parse_long_options *\(' \
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
# Don't include this header unless you use one of its functions.
|
||||||
|
sc_prohibit_inttostr_without_use:
|
||||||
|
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
# Don't include this header unless you use one of its functions.
|
||||||
|
sc_prohibit_error_without_use:
|
||||||
|
@h='"error.h"' \
|
||||||
|
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
sc_prohibit_safe_read_without_use:
|
||||||
|
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
sc_prohibit_argmatch_without_use:
|
||||||
|
@h='"argmatch.h"' \
|
||||||
|
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
sc_prohibit_root_dev_ino_without_use:
|
||||||
|
@h='"root-dev-ino.h"' \
|
||||||
|
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
|
||||||
|
$(_header_without_use)
|
||||||
|
|
||||||
|
sc_obsolete_symbols:
|
||||||
|
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||||
|
|
||||||
|
# Each nonempty line must start with a year number, or a TAB.
|
||||||
|
sc_changelog:
|
||||||
|
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
||||||
|
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||||
|
# with the strings from the two affected variables.
|
||||||
|
dd_c = $(srcdir)/src/dd.c
|
||||||
|
sc_dd_max_sym_length:
|
||||||
|
ifneq ($(wildcard $(dd_c)),)
|
||||||
|
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||||
|
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||||
|
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||||
|
| wc --max-line-length); \
|
||||||
|
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||||
|
|tr -d '"' | wc --max-line-length); \
|
||||||
|
if test "$$len" = "$$max"; then :; else \
|
||||||
|
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Many m4 macros names once began with `jm_'.
|
||||||
|
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||||
|
# Make sure that none are inadvertently reintroduced.
|
||||||
|
sc_prohibit_jm_in_m4:
|
||||||
|
@grep -nE 'jm_[A-Z]' \
|
||||||
|
$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
|
||||||
|
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Ensure that each root-requiring test is run via the "check-root" rule.
|
||||||
|
sc_root_tests:
|
||||||
|
@if test -d tests \
|
||||||
|
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
|
||||||
|
t1=sc-root.expected; t2=sc-root.actual; \
|
||||||
|
grep -nl '^require_root_$$' \
|
||||||
|
$$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
|
||||||
|
sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
|
||||||
|
$(srcdir)/tests/Makefile.am \
|
||||||
|
| sed 's/^ *//;/^root_tests =/d' \
|
||||||
|
| tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
|
||||||
|
diff -u $$t1 $$t2 || diff=1; \
|
||||||
|
rm -f $$t1 $$t2; \
|
||||||
|
test "$$diff" \
|
||||||
|
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||||
|
exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
headers_with_interesting_macro_defs = \
|
||||||
|
exit.h \
|
||||||
|
fcntl_.h \
|
||||||
|
fnmatch_.h \
|
||||||
|
intprops.h \
|
||||||
|
inttypes_.h \
|
||||||
|
lchown.h \
|
||||||
|
openat.h \
|
||||||
|
stat-macros.h \
|
||||||
|
stdint_.h
|
||||||
|
|
||||||
|
# Create a list of regular expressions matching the names
|
||||||
|
# of macros that are guaranteed by parts of gnulib to be defined.
|
||||||
|
.re-defmac:
|
||||||
|
@(cd $(srcdir)/lib; \
|
||||||
|
for f in $(headers_with_interesting_macro_defs); do \
|
||||||
|
test -f $$f && \
|
||||||
|
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
|
||||||
|
done; \
|
||||||
|
) | sort -u \
|
||||||
|
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
|
||||||
|
| sed 's/^/^# *define /' \
|
||||||
|
> $@-t
|
||||||
|
@mv $@-t $@
|
||||||
|
|
||||||
|
# Don't define macros that we already get from gnulib header files.
|
||||||
|
sc_always_defined_macros: .re-defmac
|
||||||
|
@if test -f $(srcdir)/src/system.h; then \
|
||||||
|
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
|
||||||
|
grep -f .re-defmac $$($(VC_LIST)) \
|
||||||
|
&& { echo '$(ME): define the above via some gnulib .h file' \
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a list of regular expressions matching the names
|
||||||
|
# of files included from system.h. Exclude a couple.
|
||||||
|
.re-list:
|
||||||
|
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
||||||
|
| grep -Ev 'sys/(param|file)\.h' \
|
||||||
|
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
||||||
|
> $@-t
|
||||||
|
@mv $@-t $@
|
||||||
|
|
||||||
|
# Files in src/ should not include directly any of
|
||||||
|
# the headers already included via system.h.
|
||||||
|
sc_system_h_headers: .re-list
|
||||||
|
@if test -f $(srcdir)/src/system.h; then \
|
||||||
|
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||||
|
grep -nE -f .re-list \
|
||||||
|
$$($(VC_LIST) src | \
|
||||||
|
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||||
|
&& { echo '$(ME): the above are already included via system.h'\
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure that each .c file containing a "main" function also
|
||||||
|
# calls set_program_name.
|
||||||
|
sc_program_name:
|
||||||
|
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||||
|
files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
|
||||||
|
grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files \
|
||||||
|
| grep . && \
|
||||||
|
{ echo '$(ME): the above files do not call set_program_name' \
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
else :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Require that the final line of each test-lib.sh-using test be this one:
|
||||||
|
# (exit $fail); exit $fail
|
||||||
|
# Note: this test requires GNU grep's --label= option.
|
||||||
|
sc_require_test_exit_idiom:
|
||||||
|
@if test -f $(srcdir)/tests/test-lib.sh; then \
|
||||||
|
die=0; \
|
||||||
|
for i in $$(grep -l -F /../test-lib.sh $$($(VC_LIST) tests)); do \
|
||||||
|
tail -n1 $$i | grep '^(exit \$$fail); exit \$$fail$$' > /dev/null \
|
||||||
|
&& : || { die=1; echo $$i; } \
|
||||||
|
done; \
|
||||||
|
test $$die = 1 && \
|
||||||
|
{ echo 1>&2 '$(ME): the final line in each of the above is not:'; \
|
||||||
|
echo 1>&2 '(exit $$fail); exit $$fail'; \
|
||||||
|
exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
sc_sun_os_names:
|
||||||
|
@grep -nEi \
|
||||||
|
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_the_the:
|
||||||
|
@grep -ni '\<the ''the\>' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found use of "the ''the";' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_tight_scope:
|
||||||
|
$(MAKE) -C src $@
|
||||||
|
|
||||||
|
sc_trailing_blank:
|
||||||
|
@grep -n '[ ]$$' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found trailing blank(s)' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Match lines like the following, but where there is only one space
|
||||||
|
# between the options and the description:
|
||||||
|
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
|
||||||
|
longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
|
||||||
|
sc_two_space_separator_in_usage:
|
||||||
|
@grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||||
|
echo "$(ME): an option and its description"; \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Look for diagnostics that aren't marked for translation.
|
||||||
|
# This won't find any for which error's format string is on a separate line.
|
||||||
|
sc_unmarked_diagnostics:
|
||||||
|
@grep -nE \
|
||||||
|
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
|
||||||
|
| grep -v '_''(' && \
|
||||||
|
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Avoid useless parentheses like those in this example:
|
||||||
|
# #if defined (SYMBOL) || defined (SYM2)
|
||||||
|
sc_useless_cpp_parens:
|
||||||
|
@grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Require the latest GPL.
|
||||||
|
sc_GPL_version:
|
||||||
|
@grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Perl-based tests used to exec perl from a #!/bin/sh script.
|
||||||
|
# Now they all start with #!/usr/bin/perl and the portability
|
||||||
|
# infrastructure is in tests/Makefile.am. Make sure no old-style
|
||||||
|
# script sneaks back in.
|
||||||
|
sc_no_exec_perl_coreutils:
|
||||||
|
@if test -f $(srcdir)/tests/Coreutils.pm; then \
|
||||||
|
grep '^exec *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) && \
|
||||||
|
{ echo 1>&2 '$(ME): found anachronistic Perl-based tests'; \
|
||||||
|
exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEWS_hash = \
|
||||||
|
$$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
|
||||||
|
$(srcdir)/NEWS | md5sum -)
|
||||||
|
|
||||||
|
# Ensure that we don't accidentally insert an entry into an old NEWS block.
|
||||||
|
sc_immutable_NEWS:
|
||||||
|
@if test -f $(srcdir)/NEWS; then \
|
||||||
|
test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
|
||||||
|
{ echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Each program that uses proper_name_utf8 must link with
|
||||||
|
# one of the ICONV libraries.
|
||||||
|
sc_proper_name_utf8_requires_ICONV:
|
||||||
|
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
|
||||||
|
if test "x$$progs" != x; then \
|
||||||
|
fail=0; \
|
||||||
|
for p in $$progs; do \
|
||||||
|
dir=$$(dirname "$$p"); \
|
||||||
|
base=$$(basename "$$p" .c); \
|
||||||
|
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|
||||||
|
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
|
||||||
|
done; \
|
||||||
|
test $$fail = 1 && \
|
||||||
|
{ echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
|
||||||
|
exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn about "c0nst struct Foo const foo[]",
|
||||||
|
# but not about "char const *const foo" or "#define const const".
|
||||||
|
sc_redundant_const:
|
||||||
|
@grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
|
||||||
|
$$($(VC_LIST_EXCEPT)) && \
|
||||||
|
{ echo 1>&2 '$(ME): redundant "const" in declarations'; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_const_long_option:
|
||||||
|
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
|
||||||
|
| grep -Ev 'const struct option|struct option const' && { \
|
||||||
|
echo 1>&2 '$(ME): add "const" to the above declarations'; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Update the hash stored above. Do this after each release and
|
||||||
|
# for any corrections to old entries.
|
||||||
|
update-NEWS-hash: NEWS
|
||||||
|
perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
|
||||||
|
$(srcdir)/cfg.mk
|
||||||
|
|
||||||
|
epoch_date = 1970-01-01 00:00:00.000000000 +0000
|
||||||
|
# Ensure that the c99-to-c89 patch applies cleanly.
|
||||||
|
patch-check:
|
||||||
|
rm -rf src-c89 $@.1 $@.2
|
||||||
|
cp -a src src-c89
|
||||||
|
(cd src-c89; patch -p1 -V never --fuzz=0) < src/c99-to-c89.diff \
|
||||||
|
> $@.1 2>&1
|
||||||
|
if test "$(REGEN_PATCH)" = yes; then \
|
||||||
|
diff -upr src src-c89 | sed 's,src-c89/,src/,' \
|
||||||
|
| grep -vE '^(Only in|File )' \
|
||||||
|
| perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/;' \
|
||||||
|
-e 's/^ $$//' \
|
||||||
|
> new-diff || : ; fi
|
||||||
|
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||||
|
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||||
|
rm -f src-c89/*.o || msg='rm failed'; \
|
||||||
|
$(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \
|
||||||
|
|| msg='compile failure with extra options'; \
|
||||||
|
test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
|
||||||
|
test "$$msg" = ok
|
||||||
|
|
||||||
|
# Ensure that date's --help output stays in sync with the info
|
||||||
|
# documentation for GNU strftime. The only exception is %N,
|
||||||
|
# which date accepts but GNU strftime does not.
|
||||||
|
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
||||||
|
strftime-check:
|
||||||
|
if test -f $(srcdir)/src/date.c; then \
|
||||||
|
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
||||||
|
| $(extract_char) > $@-src; \
|
||||||
|
{ echo N; \
|
||||||
|
info libc date calendar format | grep '^ `%.'\' \
|
||||||
|
| $(extract_char); } | sort > $@-info; \
|
||||||
|
diff -u $@-src $@-info || exit 1; \
|
||||||
|
rm -f $@-src $@-info; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
check-AUTHORS:
|
||||||
|
$(MAKE) -C src $@
|
||||||
|
|
||||||
|
# Ensure that we use only the standard $(VAR) notation,
|
||||||
|
# not @...@ in Makefile.am, now that we can rely on automake
|
||||||
|
# to emit a definition for each substituted variable.
|
||||||
|
makefile-check:
|
||||||
|
@grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
||||||
|
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
news-date-check: NEWS
|
||||||
|
today=`date +%Y-%m-%d`; \
|
||||||
|
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||||
|
>/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "version or today's date is not in NEWS" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
changelog-check:
|
||||||
|
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||||
|
>/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
m4-check:
|
||||||
|
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
||||||
|
&& { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||||
|
po-check:
|
||||||
|
@if test -f po/POTFILES.in; then \
|
||||||
|
grep -E -v '^(#|$$)' po/POTFILES.in \
|
||||||
|
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||||
|
files=; \
|
||||||
|
for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||||
|
case $$file in \
|
||||||
|
*.?|*.??) ;; \
|
||||||
|
*) continue;; \
|
||||||
|
esac; \
|
||||||
|
case $$file in \
|
||||||
|
*.[ch]) \
|
||||||
|
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||||
|
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||||
|
esac; \
|
||||||
|
files="$$files $$file"; \
|
||||||
|
done; \
|
||||||
|
grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
|
||||||
|
| sort -u > $@-2; \
|
||||||
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
|
rm -f $@-1 $@-2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
||||||
|
# the English word `and', the string must be marked with `N_ (...)' so that
|
||||||
|
# gettext recognizes it as a string requiring translation.
|
||||||
|
author_mark_check:
|
||||||
|
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
||||||
|
{ echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Sometimes it is useful to change the PATH environment variable
|
||||||
|
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||||
|
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||||
|
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||||
|
# and there probably aren't many projects with so many Makefile.am files
|
||||||
|
# that we'd have to worry about limits on command line length.
|
||||||
|
msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||||
|
makefile_path_separator_check:
|
||||||
|
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||||
|
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Check that `make alpha' will not fail at the end of the process.
|
||||||
|
writable-files:
|
||||||
|
if test -d $(release_archive_dir); then :; else \
|
||||||
|
for file in $(distdir).tar.gz \
|
||||||
|
$(release_archive_dir)/$(distdir).tar.gz; do \
|
||||||
|
test -e $$file || continue; \
|
||||||
|
test -w $$file \
|
||||||
|
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||||
|
done; \
|
||||||
|
test "$$fail" && exit 1 || : ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
v_etc_file = lib/version-etc.c
|
||||||
|
sample-test = tests/sample-test
|
||||||
|
texi = doc/$(PACKAGE).texi
|
||||||
|
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||||
|
# Do the same for the $(sample-test) and the main doc/.texi file.
|
||||||
|
copyright-check:
|
||||||
|
@if test -f $(v_etc_file); then \
|
||||||
|
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||||
|
>/dev/null \
|
||||||
|
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||||
|
exit 1; }; \
|
||||||
|
fi
|
||||||
|
@if test -f $(sample-test); then \
|
||||||
|
grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \
|
||||||
|
>/dev/null \
|
||||||
|
|| { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
|
||||||
|
exit 1; }; \
|
||||||
|
fi
|
||||||
|
@if test -f $(texi); then \
|
||||||
|
grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi) \
|
||||||
|
>/dev/null \
|
||||||
|
|| { echo 'out of date copyright in $(texi); update it' 1>&2; \
|
||||||
|
exit 1; }; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
vc-diff-check:
|
||||||
|
$(VC) diff > vc-diffs || :
|
||||||
|
if test -s vc-diffs; then \
|
||||||
|
cat vc-diffs; \
|
||||||
|
echo "Some files are locally modified:" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
else \
|
||||||
|
rm vc-diffs; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
cvs-check: vc-diff-check
|
||||||
|
|
||||||
|
maintainer-distcheck:
|
||||||
|
$(MAKE) distcheck
|
||||||
|
$(MAKE) my-distcheck
|
||||||
|
|
||||||
|
|
||||||
|
# Don't make a distribution if checks fail.
|
||||||
|
# Also, make sure the NEWS file is up-to-date.
|
||||||
|
vc-dist: $(local-check) cvs-check maintainer-distcheck
|
||||||
|
$(MAKE) dist
|
||||||
|
|
||||||
|
# Use this to make sure we don't run these programs when building
|
||||||
|
# from a virgin tgz file, below.
|
||||||
|
null_AM_MAKEFLAGS = \
|
||||||
|
ACLOCAL=false \
|
||||||
|
AUTOCONF=false \
|
||||||
|
AUTOMAKE=false \
|
||||||
|
AUTOHEADER=false \
|
||||||
|
MAKEINFO=false
|
||||||
|
|
||||||
|
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||||
|
|
||||||
|
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||||
|
bin=bin-$$$$
|
||||||
|
|
||||||
|
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||||
|
|
||||||
|
TMPDIR ?= /tmp
|
||||||
|
t=$(TMPDIR)/$(PACKAGE)/test
|
||||||
|
pfx=$(t)/i
|
||||||
|
|
||||||
|
# Verify that a twisted use of --program-transform-name=PROGRAM works.
|
||||||
|
define install-transform-check
|
||||||
|
rm -rf $(pfx); \
|
||||||
|
$(MAKE) program_transform_name='s/.*/zyx/' \
|
||||||
|
prefix=$(pfx) install \
|
||||||
|
&& test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
|
||||||
|
&& test "$$(echo $(pfx)/share/man/man1/*)" = \
|
||||||
|
"$(pfx)/share/man/man1/zyx.1"
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Install, then verify that all binaries and man pages are in place.
|
||||||
|
# Note that neither the binary, ginstall, nor the ].1 man page is installed.
|
||||||
|
define my-instcheck
|
||||||
|
$(MAKE) prefix=$(pfx) install \
|
||||||
|
&& test ! -f $(pfx)/bin/ginstall \
|
||||||
|
&& { fail=0; \
|
||||||
|
for i in $(built_programs); do \
|
||||||
|
test "$$i" = ginstall && i=install; \
|
||||||
|
for j in "$(pfx)/bin/$$i" \
|
||||||
|
"$(pfx)/share/man/man1/$$i.1"; do \
|
||||||
|
case $$j in *'[.1') continue;; esac; \
|
||||||
|
test -f "$$j" && : \
|
||||||
|
|| { echo "$$j not installed"; fail=1; }; \
|
||||||
|
done; \
|
||||||
|
done; \
|
||||||
|
test $$fail = 1 && exit 1 || :; \
|
||||||
|
}
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||||
|
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||||
|
# arithmetic problems with -Wpointer-arith.
|
||||||
|
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||||
|
# have to have a recent version of gcc and glibc headers.
|
||||||
|
# The hard-linking for-loop below ensures that there is a bin/ directory
|
||||||
|
# full of all of the programs under test (except the ones that are required
|
||||||
|
# for basic Makefile rules), all symlinked to the just-built "false" program.
|
||||||
|
# This is to ensure that if ever a test neglects to make PATH include
|
||||||
|
# the build srcdir, these always-failing programs will run.
|
||||||
|
# Otherwise, it is too easy to test the wrong programs.
|
||||||
|
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||||
|
my-distcheck: $(DIST_ARCHIVES) $(local-check)
|
||||||
|
$(MAKE) syntax-check
|
||||||
|
$(MAKE) check
|
||||||
|
-rm -rf $(t)
|
||||||
|
mkdir -p $(t)
|
||||||
|
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||||
|
cd $(t)/$(distdir) \
|
||||||
|
&& ./configure --disable-nls \
|
||||||
|
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||||
|
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||||
|
&& $(MAKE) dvi \
|
||||||
|
&& $(install-transform-check) \
|
||||||
|
&& $(my-instcheck) \
|
||||||
|
&& mkdir $(bin) \
|
||||||
|
&& ($(write_loser)) > $(bin)/loser \
|
||||||
|
&& chmod a+x $(bin)/loser \
|
||||||
|
&& for i in $(built_programs); do \
|
||||||
|
case $$i in \
|
||||||
|
rm|expr|basename|echo|sort|ls|tr);; \
|
||||||
|
cat|dirname|mv|wc);; \
|
||||||
|
*) ln $(bin)/loser $(bin)/$$i;; \
|
||||||
|
esac; \
|
||||||
|
done \
|
||||||
|
&& ln -sf ../src/true $(bin)/false \
|
||||||
|
&& PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
|
||||||
|
&& { test -d gnulib-tests \
|
||||||
|
&& $(MAKE) -C gnulib-tests check \
|
||||||
|
|| :; } \
|
||||||
|
&& rm -rf $(bin) \
|
||||||
|
&& $(MAKE) distclean
|
||||||
|
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||||
|
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||||
|
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||||
|
if test -f $(srcdir)/src/c99-to-c89.diff; then \
|
||||||
|
cd $(t)/$(distdir) \
|
||||||
|
&& (cd src && patch -V never --fuzz=0 <c99-to-c89.diff) \
|
||||||
|
&& ./configure --disable-largefile \
|
||||||
|
CFLAGS='-Werror -ansi -Wno-long-long' \
|
||||||
|
&& $(MAKE); \
|
||||||
|
fi
|
||||||
|
-rm -rf $(t)
|
||||||
|
@echo "========================"; \
|
||||||
|
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||||
|
echo "========================"
|
||||||
|
|
||||||
|
WGET = wget
|
||||||
|
WGETFLAGS = -C off
|
||||||
|
|
||||||
|
rel-check:
|
||||||
|
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||||
|
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||||
|
set -e; \
|
||||||
|
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||||
|
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
||||||
|
echo "$(md5) -" > $$md5_tmp; \
|
||||||
|
md5sum -c $$md5_tmp < $$tarz
|
||||||
|
|
||||||
|
rel-files = $(DIST_ARCHIVES)
|
||||||
|
|
||||||
|
gnulib-version = $$(cd $(gnulib_dir) && git describe)
|
||||||
|
|
||||||
|
announcement: NEWS ChangeLog $(rel-files)
|
||||||
|
@./build-aux/announce-gen \
|
||||||
|
--release-type=$(RELEASE_TYPE) \
|
||||||
|
--package=$(PACKAGE) \
|
||||||
|
--prev=$(PREV_VERSION) \
|
||||||
|
--curr=$(VERSION) \
|
||||||
|
--gpg-key-id=$(gpg_key_ID) \
|
||||||
|
--news=NEWS \
|
||||||
|
--bootstrap-tools=autoconf,automake,flex,gnulib \
|
||||||
|
--gnulib-version=$(gnulib-version) \
|
||||||
|
$(addprefix --url-dir=, $(url_dir_list))
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Updating files. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||||
|
www-gnu = http://www.gnu.org
|
||||||
|
|
||||||
|
# Use mv, if you don't have/want move-if-change.
|
||||||
|
move_if_change ?= move-if-change
|
||||||
|
|
||||||
|
emit_upload_commands:
|
||||||
|
@echo =====================================
|
||||||
|
@echo =====================================
|
||||||
|
@echo "$(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \\"
|
||||||
|
@echo " --to $(gnu_rel_host):$(PACKAGE) \\"
|
||||||
|
@echo " $(rel-files)"
|
||||||
|
@echo '# send the /tmp/announcement e-mail'
|
||||||
|
@echo =====================================
|
||||||
|
@echo =====================================
|
||||||
|
|
||||||
|
noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
define emit-commit-log
|
||||||
|
printf '%s\n' 'post-release administrivia' '' \
|
||||||
|
'* NEWS: Add header line for next release.' \
|
||||||
|
'* .prev-version: Record previous version.' \
|
||||||
|
'* cfg.mk (old_NEWS_hash): Auto-update.'
|
||||||
|
endef
|
||||||
|
|
||||||
|
.PHONY: alpha beta major
|
||||||
|
alpha beta major: $(local-check) writable-files
|
||||||
|
test $@ = major \
|
||||||
|
&& { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
|
||||||
|
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
|
||||||
|
|| :
|
||||||
|
$(MAKE) vc-dist
|
||||||
|
$(MAKE) news-date-check
|
||||||
|
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
||||||
|
if test -d $(release_archive_dir); then \
|
||||||
|
ln $(rel-files) $(release_archive_dir); \
|
||||||
|
chmod a-w $(rel-files); \
|
||||||
|
fi
|
||||||
|
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
||||||
|
echo $(VERSION) > $(prev_version_file)
|
||||||
|
$(MAKE) update-NEWS-hash
|
||||||
|
perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
|
||||||
|
$(emit-commit-log) > .ci-msg
|
||||||
|
$(VC) commit -F .ci-msg
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
*.gmo
|
*.gmo
|
||||||
*.po
|
*.po
|
||||||
|
*.po~
|
||||||
|
.reference
|
||||||
LINGUAS
|
LINGUAS
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*.gmo
|
||||||
|
/*.po
|
||||||
|
/*.po~
|
||||||
|
/.reference
|
||||||
|
/LINGUAS
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/Makefile.in.in
|
||||||
|
/Makevars
|
||||||
|
/Makevars.template
|
||||||
|
/POTFILES
|
||||||
|
/Rules-quot
|
||||||
|
/bison.pot
|
||||||
|
/boldquot.sed
|
||||||
|
/[email protected]
|
||||||
|
/[email protected]
|
||||||
|
/insert-header.sed
|
||||||
|
/insert-header.sin
|
||||||
|
/quot.sed
|
||||||
|
/remove-potcdate.sed
|
||||||
|
/remove-potcdate.sin
|
||||||
|
/stamp-po
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
*.gmo
|
*.gmo
|
||||||
*.po
|
*.po
|
||||||
|
*.po~
|
||||||
|
.reference
|
||||||
LINGUAS
|
LINGUAS
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*.gmo
|
||||||
|
/*.po
|
||||||
|
/*.po~
|
||||||
|
/.reference
|
||||||
|
/LINGUAS
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/Makefile.in.in
|
||||||
|
/Makevars
|
||||||
|
/POTFILES
|
||||||
|
/Rules-quot
|
||||||
|
/bison-runtime.pot
|
||||||
|
/boldquot.sed
|
||||||
|
/[email protected]
|
||||||
|
/[email protected]
|
||||||
|
/insert-header.sin
|
||||||
|
/quot.sed
|
||||||
|
/remove-potcdate.sed
|
||||||
|
/remove-potcdate.sin
|
||||||
|
/stamp-po
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
bison
|
bison
|
||||||
revision.c
|
|
||||||
scan-code.c
|
scan-code.c
|
||||||
scan-gram.c
|
scan-gram.c
|
||||||
scan-skel.c
|
scan-skel.c
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*.flc
|
||||||
|
/*.log
|
||||||
|
/*.o
|
||||||
|
/*.output
|
||||||
|
/.deps
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/bison
|
||||||
|
/bison.exe
|
||||||
|
/scan-code.c
|
||||||
|
/scan-gram.c
|
||||||
|
/scan-skel.c
|
||||||
|
/yacc
|
||||||
+2
-14
@@ -1,6 +1,6 @@
|
|||||||
# Make bison/src.
|
# Make bison/src.
|
||||||
|
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
# Foundation, Inc.
|
# Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
|
AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/lib
|
AM_CPPFLAGS = -I$(top_srcdir)/lib
|
||||||
AM_YFLAGS = "-dv"
|
AM_YFLAGS = "-dv"
|
||||||
|
|
||||||
@@ -53,7 +53,6 @@ bison_SOURCES = \
|
|||||||
print-xml.c print-xml.h \
|
print-xml.c print-xml.h \
|
||||||
reader.c reader.h \
|
reader.c reader.h \
|
||||||
reduce.c reduce.h \
|
reduce.c reduce.h \
|
||||||
revision.c revision.h \
|
|
||||||
relation.c relation.h \
|
relation.c relation.h \
|
||||||
scan-code.h scan-code-c.c \
|
scan-code.h scan-code-c.c \
|
||||||
scan-gram.h scan-gram-c.c \
|
scan-gram.h scan-gram-c.c \
|
||||||
@@ -70,7 +69,6 @@ EXTRA_bison_SOURCES = scan-code.l scan-skel.l scan-gram.l
|
|||||||
|
|
||||||
BUILT_SOURCES = \
|
BUILT_SOURCES = \
|
||||||
parse-gram.c parse-gram.h \
|
parse-gram.c parse-gram.h \
|
||||||
revision.c \
|
|
||||||
scan-code.c \
|
scan-code.c \
|
||||||
scan-skel.c \
|
scan-skel.c \
|
||||||
scan-gram.c
|
scan-gram.c
|
||||||
@@ -85,16 +83,6 @@ yacc:
|
|||||||
echo:
|
echo:
|
||||||
echo $(bison_SOURCES) $(noinst_HEADERS)
|
echo $(bison_SOURCES) $(noinst_HEADERS)
|
||||||
|
|
||||||
revision.c: $(top_srcdir)/configure $(top_srcdir)/ChangeLog
|
|
||||||
case "$(VERSION)" in \
|
|
||||||
*+*) sed -n \
|
|
||||||
's/^\$$\(Id.*\)\$$$$/const char *revision = "\1\\n";/p' \
|
|
||||||
$(top_srcdir)/ChangeLog \
|
|
||||||
;; \
|
|
||||||
*) echo 'const char *revision = "";' \
|
|
||||||
;; \
|
|
||||||
esac >$@
|
|
||||||
|
|
||||||
# The following rule is not designed to be portable,
|
# The following rule is not designed to be portable,
|
||||||
# and relies on tools that not everyone has.
|
# and relies on tools that not everyone has.
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -1,7 +1,7 @@
|
|||||||
/* Open and close files for Bison.
|
/* Open and close files for Bison.
|
||||||
|
|
||||||
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
|
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
|
||||||
2005, 2006, 2007 Free Software Foundation, Inc.
|
2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -267,7 +267,9 @@ compute_file_name_parts (void)
|
|||||||
if (spec_file_prefix)
|
if (spec_file_prefix)
|
||||||
{
|
{
|
||||||
/* If --file-prefix=foo was specified, ALL_BUT_TAB_EXT = `foo'. */
|
/* If --file-prefix=foo was specified, ALL_BUT_TAB_EXT = `foo'. */
|
||||||
dir_prefix = xstrndup (grammar_file, base - grammar_file);
|
dir_prefix =
|
||||||
|
xstrndup (spec_file_prefix,
|
||||||
|
last_component (spec_file_prefix) - spec_file_prefix);
|
||||||
all_but_tab_ext = xstrdup (spec_file_prefix);
|
all_but_tab_ext = xstrdup (spec_file_prefix);
|
||||||
}
|
}
|
||||||
else if (yacc_flag)
|
else if (yacc_flag)
|
||||||
@@ -351,6 +353,8 @@ compute_output_file_names (void)
|
|||||||
void
|
void
|
||||||
output_file_name_check (char const *file_name)
|
output_file_name_check (char const *file_name)
|
||||||
{
|
{
|
||||||
|
if (0 == strcmp (file_name, grammar_file))
|
||||||
|
fatal (_("refusing to overwrite the input file %s"), quote (file_name));
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < file_names_count; i++)
|
for (i = 0; i < file_names_count; i++)
|
||||||
|
|||||||
+5
-6
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "revision.h"
|
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
|
||||||
#include <argmatch.h>
|
#include <argmatch.h>
|
||||||
@@ -71,9 +70,9 @@ static struct bison_language const valid_languages[] = {
|
|||||||
{ "", "", "", "", false }
|
{ "", "", "", "", false }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int skeleton_prio = 2;
|
int skeleton_prio = default_prio;
|
||||||
const char *skeleton = NULL;
|
const char *skeleton = NULL;
|
||||||
static int language_prio = 2;
|
int language_prio = default_prio;
|
||||||
struct bison_language const *language = &valid_languages[0];
|
struct bison_language const *language = &valid_languages[0];
|
||||||
const char *include = NULL;
|
const char *include = NULL;
|
||||||
|
|
||||||
@@ -273,6 +272,7 @@ Operation modes:\n\
|
|||||||
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\
|
||||||
-S, --skeleton=FILE specify the skeleton to use\n\
|
-S, --skeleton=FILE specify the skeleton to use\n\
|
||||||
-t, --debug instrument the parser for debugging\n\
|
-t, --debug instrument the parser for debugging\n\
|
||||||
--locations enable locations computation\n\
|
--locations enable locations computation\n\
|
||||||
@@ -338,7 +338,6 @@ version (void)
|
|||||||
continue. */
|
continue. */
|
||||||
printf (_("bison (GNU Bison) %s"), VERSION);
|
printf (_("bison (GNU Bison) %s"), VERSION);
|
||||||
putc ('\n', stdout);
|
putc ('\n', stdout);
|
||||||
printf ("%s", revision);
|
|
||||||
fputs (_("Written by Robert Corbett and Richard Stallman.\n"), stdout);
|
fputs (_("Written by Robert Corbett and Richard Stallman.\n"), stdout);
|
||||||
putc ('\n', stdout);
|
putc ('\n', stdout);
|
||||||
|
|
||||||
@@ -521,11 +520,11 @@ getargs (int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'L':
|
case 'L':
|
||||||
language_argmatch (optarg, 0, NULL);
|
language_argmatch (optarg, command_line_prio, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
skeleton_arg (AS_FILE_NAME (optarg), 0, NULL);
|
skeleton_arg (AS_FILE_NAME (optarg), command_line_prio, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
|
|||||||
+4
-1
@@ -1,7 +1,7 @@
|
|||||||
/* Parse command line arguments for bison.
|
/* Parse command line arguments for bison.
|
||||||
|
|
||||||
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
|
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
|
||||||
2005, 2006, 2007 Free Software Foundation, Inc.
|
2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -24,11 +24,13 @@
|
|||||||
#include "location.h"
|
#include "location.h"
|
||||||
|
|
||||||
extern char *program_name;
|
extern char *program_name;
|
||||||
|
enum { command_line_prio, grammar_prio, default_prio };
|
||||||
|
|
||||||
/* flags set by % directives */
|
/* flags set by % directives */
|
||||||
|
|
||||||
/* for -S */
|
/* for -S */
|
||||||
extern char const *skeleton;
|
extern char const *skeleton;
|
||||||
|
extern int skeleton_prio;
|
||||||
|
|
||||||
/* for -I */
|
/* for -I */
|
||||||
extern char const *include;
|
extern char const *include;
|
||||||
@@ -68,6 +70,7 @@ struct bison_language
|
|||||||
bool add_tab;
|
bool add_tab;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int language_prio;
|
||||||
extern struct bison_language const *language;
|
extern struct bison_language const *language;
|
||||||
|
|
||||||
/*-----------.
|
/*-----------.
|
||||||
|
|||||||
+46
-14
@@ -473,13 +473,10 @@ output_skeleton (void)
|
|||||||
FILE *in;
|
FILE *in;
|
||||||
FILE *out;
|
FILE *out;
|
||||||
int filter_fd[2];
|
int filter_fd[2];
|
||||||
char const *argv[7];
|
char const *argv[9];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
/* Compute the names of the package data dir and skeleton file.
|
/* Compute the names of the package data dir and skeleton files. */
|
||||||
Test whether m4sugar.m4 is readable, to check for proper
|
|
||||||
installation. A faulty installation can cause deadlock, so a
|
|
||||||
cheap sanity check is worthwhile. */
|
|
||||||
char const m4sugar[] = "m4sugar/m4sugar.m4";
|
char const m4sugar[] = "m4sugar/m4sugar.m4";
|
||||||
char const m4bison[] = "bison.m4";
|
char const m4bison[] = "bison.m4";
|
||||||
char *full_m4sugar;
|
char *full_m4sugar;
|
||||||
@@ -505,26 +502,61 @@ output_skeleton (void)
|
|||||||
strcpy (full_skeleton, skeleton);
|
strcpy (full_skeleton, skeleton);
|
||||||
else
|
else
|
||||||
strcpy (full_skeleton + pkgdatadirlen + 1, skeleton);
|
strcpy (full_skeleton + pkgdatadirlen + 1, skeleton);
|
||||||
|
|
||||||
|
/* Test whether m4sugar.m4 is readable, to check for proper
|
||||||
|
installation. A faulty installation can cause deadlock, so a
|
||||||
|
cheap sanity check is worthwhile. */
|
||||||
xfclose (xfopen (full_m4sugar, "r"));
|
xfclose (xfopen (full_m4sugar, "r"));
|
||||||
|
|
||||||
/* Create an m4 subprocess connected to us via two pipes. */
|
/* Create an m4 subprocess connected to us via two pipes. */
|
||||||
|
|
||||||
if (trace_flag & trace_tools)
|
if (trace_flag & trace_tools)
|
||||||
fprintf (stderr, "running: %s %s - %s %s\n",
|
fprintf (stderr, "running: %s %s - %s %s\n",
|
||||||
m4, full_m4sugar, full_m4bison, full_skeleton);
|
m4, full_m4sugar, full_m4bison, full_skeleton);
|
||||||
|
|
||||||
argv[0] = m4;
|
/* Some future version of GNU M4 (most likely 1.6) may treat the -dV in a
|
||||||
argv[1] = full_m4sugar;
|
position-dependent manner. Keep it as the first argument so that all
|
||||||
argv[2] = "-";
|
files are traced.
|
||||||
argv[3] = full_m4bison;
|
|
||||||
argv[4] = full_skeleton;
|
|
||||||
argv[5] = trace_flag & trace_m4 ? "-dV" : NULL;
|
|
||||||
argv[6] = NULL;
|
|
||||||
|
|
||||||
|
See the thread starting at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
|
||||||
|
for details. */
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
argv[i++] = m4;
|
||||||
|
argv[i++] = "-I";
|
||||||
|
argv[i++] = pkgdatadir;
|
||||||
|
if (trace_flag & trace_m4)
|
||||||
|
argv[i++] = "-dV";
|
||||||
|
argv[i++] = full_m4sugar;
|
||||||
|
argv[i++] = "-";
|
||||||
|
argv[i++] = full_m4bison;
|
||||||
|
argv[i++] = full_skeleton;
|
||||||
|
argv[i++] = NULL;
|
||||||
|
}
|
||||||
|
/* When POSIXLY_CORRECT is set, some future versions of GNU M4 (most likely
|
||||||
|
2.0) may drop some of the GNU extensions that Bison's skeletons depend
|
||||||
|
upon. So that the next release of Bison is forward compatible with those
|
||||||
|
future versions of GNU M4, we unset POSIXLY_CORRECT here.
|
||||||
|
|
||||||
|
FIXME: A user might set POSIXLY_CORRECT to affect processes run from
|
||||||
|
macros like m4_syscmd in a custom skeleton. For now, Bison makes no
|
||||||
|
promises about the behavior of custom skeletons, so this scenario is not a
|
||||||
|
concern. However, we eventually want to eliminate this shortcoming. The
|
||||||
|
next release of GNU M4 (1.4.12 or 1.6) will accept the -g command-line
|
||||||
|
option as a no-op, and later releases will accept it to indicate that
|
||||||
|
POSIXLY_CORRECT should be ignored. Once the GNU M4 versions that accept
|
||||||
|
-g are pervasive, Bison should use -g instead of unsetting
|
||||||
|
POSIXLY_CORRECT.
|
||||||
|
|
||||||
|
See the thread starting at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
|
||||||
|
for details. */
|
||||||
|
unsetenv ("POSIXLY_CORRECT");
|
||||||
init_subpipe ();
|
init_subpipe ();
|
||||||
pid = create_subpipe (argv, filter_fd);
|
pid = create_subpipe (argv, filter_fd);
|
||||||
free (full_m4bison);
|
|
||||||
free (full_m4sugar);
|
free (full_m4sugar);
|
||||||
|
free (full_m4bison);
|
||||||
free (full_skeleton);
|
free (full_skeleton);
|
||||||
|
|
||||||
out = fdopen (filter_fd[0], "w");
|
out = fdopen (filter_fd[0], "w");
|
||||||
|
|||||||
+143
-145
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
/* A Bison parser, made by GNU Bison 2.3a+. */
|
/* A Bison parser, made by GNU Bison 2.4.4-738cd. */
|
||||||
|
|
||||||
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
#define YYBISON 1
|
#define YYBISON 1
|
||||||
|
|
||||||
/* Bison version. */
|
/* Bison version. */
|
||||||
#define YYBISON_VERSION "2.3a+"
|
#define YYBISON_VERSION "2.4.4-738cd"
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
#define YYSKELETON_NAME "yacc.c"
|
#define YYSKELETON_NAME "yacc.c"
|
||||||
@@ -100,8 +100,6 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include <strverscmp.h>
|
|
||||||
|
|
||||||
#include "complain.h"
|
#include "complain.h"
|
||||||
#include "conflicts.h"
|
#include "conflicts.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
@@ -153,7 +151,7 @@ static int current_prec = 0;
|
|||||||
|
|
||||||
|
|
||||||
/* Line 189 of yacc.c */
|
/* Line 189 of yacc.c */
|
||||||
#line 157 "parse-gram.c"
|
#line 155 "parse-gram.c"
|
||||||
|
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
@@ -301,8 +299,8 @@ static int current_prec = 0;
|
|||||||
typedef union YYSTYPE
|
typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Line 214 of yacc.c */
|
/* Line 222 of yacc.c */
|
||||||
#line 94 "parse-gram.y"
|
#line 92 "parse-gram.y"
|
||||||
|
|
||||||
symbol *symbol;
|
symbol *symbol;
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
@@ -315,8 +313,8 @@ typedef union YYSTYPE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Line 214 of yacc.c */
|
/* Line 222 of yacc.c */
|
||||||
#line 320 "parse-gram.c"
|
#line 318 "parse-gram.c"
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
@@ -341,7 +339,7 @@ typedef struct YYLTYPE
|
|||||||
|
|
||||||
|
|
||||||
/* Line 264 of yacc.c */
|
/* Line 264 of yacc.c */
|
||||||
#line 345 "parse-gram.c"
|
#line 343 "parse-gram.c"
|
||||||
|
|
||||||
#ifdef short
|
#ifdef short
|
||||||
# undef short
|
# undef short
|
||||||
@@ -666,17 +664,17 @@ static const yytype_int8 yyrhs[] =
|
|||||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||||
static const yytype_uint16 yyrline[] =
|
static const yytype_uint16 yyrline[] =
|
||||||
{
|
{
|
||||||
0, 204, 204, 212, 214, 218, 219, 229, 230, 234,
|
0, 202, 202, 210, 212, 216, 217, 227, 228, 232,
|
||||||
235, 240, 241, 242, 243, 244, 245, 250, 259, 260,
|
233, 238, 239, 240, 241, 242, 243, 248, 257, 258,
|
||||||
261, 262, 263, 264, 265, 266, 267, 268, 269, 282,
|
259, 260, 261, 262, 263, 264, 265, 266, 267, 280,
|
||||||
283, 307, 308, 309, 310, 314, 315, 316, 320, 327,
|
281, 305, 306, 307, 308, 312, 313, 314, 318, 325,
|
||||||
334, 338, 342, 349, 364, 365, 369, 381, 381, 386,
|
332, 336, 340, 347, 362, 363, 367, 379, 379, 384,
|
||||||
386, 391, 402, 417, 418, 419, 423, 424, 429, 431,
|
384, 389, 400, 415, 416, 417, 421, 422, 427, 429,
|
||||||
436, 437, 442, 444, 449, 450, 454, 455, 456, 457,
|
434, 435, 440, 442, 447, 448, 452, 453, 454, 455,
|
||||||
462, 467, 472, 478, 484, 495, 496, 505, 506, 512,
|
460, 465, 470, 476, 482, 493, 494, 503, 504, 510,
|
||||||
513, 514, 521, 521, 525, 526, 527, 532, 533, 535,
|
511, 512, 519, 519, 523, 524, 525, 530, 531, 533,
|
||||||
537, 539, 541, 551, 552, 558, 561, 570, 590, 592,
|
535, 537, 539, 549, 550, 556, 559, 568, 588, 590,
|
||||||
601, 606, 607, 612, 619, 621
|
599, 604, 605, 610, 617, 619
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1032,146 +1030,146 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
|
|||||||
case 3: /* "\"string\"" */
|
case 3: /* "\"string\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 182 "parse-gram.y"
|
#line 180 "parse-gram.y"
|
||||||
{ fputs (quotearg_style (c_quoting_style, (yyvaluep->chars)), stderr); };
|
{ fputs (quotearg_style (c_quoting_style, (yyvaluep->chars)), stderr); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1040 "parse-gram.c"
|
#line 1038 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 4: /* "\"integer\"" */
|
case 4: /* "\"integer\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 193 "parse-gram.y"
|
#line 191 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%d", (yyvaluep->integer)); };
|
{ fprintf (stderr, "%d", (yyvaluep->integer)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1049 "parse-gram.c"
|
#line 1047 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 43: /* "\"{...}\"" */
|
case 43: /* "\"{...}\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 184 "parse-gram.y"
|
#line 182 "parse-gram.y"
|
||||||
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->code)); };
|
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->code)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1058 "parse-gram.c"
|
#line 1056 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 44: /* "\"char\"" */
|
case 44: /* "\"char\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 176 "parse-gram.y"
|
#line 174 "parse-gram.y"
|
||||||
{ fputs (char_name ((yyvaluep->character)), stderr); };
|
{ fputs (char_name ((yyvaluep->character)), stderr); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1067 "parse-gram.c"
|
#line 1065 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 45: /* "\"epilogue\"" */
|
case 45: /* "\"epilogue\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 184 "parse-gram.y"
|
#line 182 "parse-gram.y"
|
||||||
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1076 "parse-gram.c"
|
#line 1074 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 47: /* "\"identifier\"" */
|
case 47: /* "\"identifier\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 189 "parse-gram.y"
|
#line 187 "parse-gram.y"
|
||||||
{ fputs ((yyvaluep->uniqstr), stderr); };
|
{ fputs ((yyvaluep->uniqstr), stderr); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1085 "parse-gram.c"
|
#line 1083 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 48: /* "\"identifier:\"" */
|
case 48: /* "\"identifier:\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 190 "parse-gram.y"
|
#line 188 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%s:", (yyvaluep->uniqstr)); };
|
{ fprintf (stderr, "%s:", (yyvaluep->uniqstr)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1094 "parse-gram.c"
|
#line 1092 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 51: /* "\"%{...%}\"" */
|
case 51: /* "\"%{...%}\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 184 "parse-gram.y"
|
#line 182 "parse-gram.y"
|
||||||
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1103 "parse-gram.c"
|
#line 1101 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 53: /* "\"type\"" */
|
case 53: /* "\"type\"" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 188 "parse-gram.y"
|
#line 186 "parse-gram.y"
|
||||||
{ fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); };
|
{ fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1112 "parse-gram.c"
|
#line 1110 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 82: /* "variable" */
|
case 82: /* "variable" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 189 "parse-gram.y"
|
#line 187 "parse-gram.y"
|
||||||
{ fputs ((yyvaluep->uniqstr), stderr); };
|
{ fputs ((yyvaluep->uniqstr), stderr); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1121 "parse-gram.c"
|
#line 1119 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 83: /* "content.opt" */
|
case 83: /* "content.opt" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 184 "parse-gram.y"
|
#line 182 "parse-gram.y"
|
||||||
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1130 "parse-gram.c"
|
#line 1128 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 84: /* "braceless" */
|
case 84: /* "braceless" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 184 "parse-gram.y"
|
#line 182 "parse-gram.y"
|
||||||
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
{ fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1139 "parse-gram.c"
|
#line 1137 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 85: /* "id" */
|
case 85: /* "id" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 196 "parse-gram.y"
|
#line 194 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1148 "parse-gram.c"
|
#line 1146 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 86: /* "id_colon" */
|
case 86: /* "id_colon" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 197 "parse-gram.y"
|
#line 195 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); };
|
{ fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1157 "parse-gram.c"
|
#line 1155 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 87: /* "symbol" */
|
case 87: /* "symbol" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 196 "parse-gram.y"
|
#line 194 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1166 "parse-gram.c"
|
#line 1164 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
case 88: /* "string_as_id" */
|
case 88: /* "string_as_id" */
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 196 "parse-gram.y"
|
#line 194 "parse-gram.y"
|
||||||
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
{ fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
|
||||||
|
|
||||||
/* Line 715 of yacc.c */
|
/* Line 715 of yacc.c */
|
||||||
#line 1175 "parse-gram.c"
|
#line 1173 "parse-gram.c"
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1690,8 +1688,8 @@ YYLTYPE yylloc;
|
|||||||
|
|
||||||
/* User initialization code. */
|
/* User initialization code. */
|
||||||
|
|
||||||
/* Line 1242 of yacc.c */
|
/* Line 1248 of yacc.c */
|
||||||
#line 86 "parse-gram.y"
|
#line 84 "parse-gram.y"
|
||||||
{
|
{
|
||||||
/* Bison's grammar can initial empty locations, hence a default
|
/* Bison's grammar can initial empty locations, hence a default
|
||||||
location is needed. */
|
location is needed. */
|
||||||
@@ -1699,8 +1697,8 @@ YYLTYPE yylloc;
|
|||||||
boundary_set (&yylloc.end, current_file, 1, 1);
|
boundary_set (&yylloc.end, current_file, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Line 1242 of yacc.c */
|
/* Line 1248 of yacc.c */
|
||||||
#line 1704 "parse-gram.c"
|
#line 1702 "parse-gram.c"
|
||||||
yylsp[0] = yylloc;
|
yylsp[0] = yylloc;
|
||||||
|
|
||||||
goto yysetstate;
|
goto yysetstate;
|
||||||
@@ -1888,7 +1886,7 @@ yyreduce:
|
|||||||
case 6:
|
case 6:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 220 "parse-gram.y"
|
#line 218 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props plain_code;
|
code_props plain_code;
|
||||||
code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)]));
|
code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)]));
|
||||||
@@ -1903,14 +1901,14 @@ yyreduce:
|
|||||||
case 7:
|
case 7:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 229 "parse-gram.y"
|
#line 227 "parse-gram.y"
|
||||||
{ debug_flag = true; }
|
{ debug_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 231 "parse-gram.y"
|
#line 229 "parse-gram.y"
|
||||||
{
|
{
|
||||||
muscle_percent_define_insert ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars));
|
muscle_percent_define_insert ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars));
|
||||||
}
|
}
|
||||||
@@ -1919,14 +1917,14 @@ yyreduce:
|
|||||||
case 9:
|
case 9:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 234 "parse-gram.y"
|
#line 232 "parse-gram.y"
|
||||||
{ defines_flag = true; }
|
{ defines_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 236 "parse-gram.y"
|
#line 234 "parse-gram.y"
|
||||||
{
|
{
|
||||||
defines_flag = true;
|
defines_flag = true;
|
||||||
spec_defines_file = xstrdup ((yyvsp[(2) - (2)].chars));
|
spec_defines_file = xstrdup ((yyvsp[(2) - (2)].chars));
|
||||||
@@ -1936,42 +1934,42 @@ yyreduce:
|
|||||||
case 11:
|
case 11:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 240 "parse-gram.y"
|
#line 238 "parse-gram.y"
|
||||||
{ error_verbose = true; }
|
{ error_verbose = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 241 "parse-gram.y"
|
#line 239 "parse-gram.y"
|
||||||
{ expected_sr_conflicts = (yyvsp[(2) - (2)].integer); }
|
{ expected_sr_conflicts = (yyvsp[(2) - (2)].integer); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 242 "parse-gram.y"
|
#line 240 "parse-gram.y"
|
||||||
{ expected_rr_conflicts = (yyvsp[(2) - (2)].integer); }
|
{ expected_rr_conflicts = (yyvsp[(2) - (2)].integer); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 243 "parse-gram.y"
|
#line 241 "parse-gram.y"
|
||||||
{ spec_file_prefix = (yyvsp[(2) - (2)].chars); }
|
{ spec_file_prefix = (yyvsp[(2) - (2)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 15:
|
case 15:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 244 "parse-gram.y"
|
#line 242 "parse-gram.y"
|
||||||
{ spec_file_prefix = (yyvsp[(3) - (3)].chars); }
|
{ spec_file_prefix = (yyvsp[(3) - (3)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 246 "parse-gram.y"
|
#line 244 "parse-gram.y"
|
||||||
{
|
{
|
||||||
nondeterministic_parser = true;
|
nondeterministic_parser = true;
|
||||||
glr_parser = true;
|
glr_parser = true;
|
||||||
@@ -1981,7 +1979,7 @@ yyreduce:
|
|||||||
case 17:
|
case 17:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 251 "parse-gram.y"
|
#line 249 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props action;
|
code_props action;
|
||||||
code_props_symbol_action_init (&action, (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)]));
|
code_props_symbol_action_init (&action, (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)]));
|
||||||
@@ -1995,77 +1993,77 @@ yyreduce:
|
|||||||
case 18:
|
case 18:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 259 "parse-gram.y"
|
#line 257 "parse-gram.y"
|
||||||
{ language_argmatch ((yyvsp[(2) - (2)].chars), 1, &(yylsp[(1) - (2)])); }
|
{ language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, &(yylsp[(1) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 19:
|
case 19:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 260 "parse-gram.y"
|
#line 258 "parse-gram.y"
|
||||||
{ add_param ("lex_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
{ add_param ("lex_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 20:
|
case 20:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 261 "parse-gram.y"
|
#line 259 "parse-gram.y"
|
||||||
{ locations_flag = true; }
|
{ locations_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 21:
|
case 21:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 262 "parse-gram.y"
|
#line 260 "parse-gram.y"
|
||||||
{ spec_name_prefix = (yyvsp[(2) - (2)].chars); }
|
{ spec_name_prefix = (yyvsp[(2) - (2)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 22:
|
case 22:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 263 "parse-gram.y"
|
#line 261 "parse-gram.y"
|
||||||
{ spec_name_prefix = (yyvsp[(3) - (3)].chars); }
|
{ spec_name_prefix = (yyvsp[(3) - (3)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 23:
|
case 23:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 264 "parse-gram.y"
|
#line 262 "parse-gram.y"
|
||||||
{ no_lines_flag = true; }
|
{ no_lines_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:
|
case 24:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 265 "parse-gram.y"
|
#line 263 "parse-gram.y"
|
||||||
{ nondeterministic_parser = true; }
|
{ nondeterministic_parser = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 25:
|
case 25:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 266 "parse-gram.y"
|
#line 264 "parse-gram.y"
|
||||||
{ spec_outfile = (yyvsp[(2) - (2)].chars); }
|
{ spec_outfile = (yyvsp[(2) - (2)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 26:
|
case 26:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 267 "parse-gram.y"
|
#line 265 "parse-gram.y"
|
||||||
{ spec_outfile = (yyvsp[(3) - (3)].chars); }
|
{ spec_outfile = (yyvsp[(3) - (3)].chars); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 27:
|
case 27:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 268 "parse-gram.y"
|
#line 266 "parse-gram.y"
|
||||||
{ add_param ("parse_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
{ add_param ("parse_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 28:
|
case 28:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 270 "parse-gram.y"
|
#line 268 "parse-gram.y"
|
||||||
{
|
{
|
||||||
/* %pure-parser is deprecated in favor of `%define api.pure', so use
|
/* %pure-parser is deprecated in favor of `%define api.pure', so use
|
||||||
`%define api.pure' in a backward-compatible manner here. First, don't
|
`%define api.pure' in a backward-compatible manner here. First, don't
|
||||||
@@ -2083,14 +2081,14 @@ yyreduce:
|
|||||||
case 29:
|
case 29:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 282 "parse-gram.y"
|
#line 280 "parse-gram.y"
|
||||||
{ version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); }
|
{ version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 30:
|
case 30:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 284 "parse-gram.y"
|
#line 282 "parse-gram.y"
|
||||||
{
|
{
|
||||||
char const *skeleton_user = (yyvsp[(2) - (2)].chars);
|
char const *skeleton_user = (yyvsp[(2) - (2)].chars);
|
||||||
if (strchr (skeleton_user, '/'))
|
if (strchr (skeleton_user, '/'))
|
||||||
@@ -2112,35 +2110,35 @@ yyreduce:
|
|||||||
skeleton_user = uniqstr_new (skeleton_build);
|
skeleton_user = uniqstr_new (skeleton_build);
|
||||||
free (skeleton_build);
|
free (skeleton_build);
|
||||||
}
|
}
|
||||||
skeleton_arg (skeleton_user, 1, &(yylsp[(1) - (2)]));
|
skeleton_arg (skeleton_user, grammar_prio, &(yylsp[(1) - (2)]));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 31:
|
case 31:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 307 "parse-gram.y"
|
#line 305 "parse-gram.y"
|
||||||
{ token_table_flag = true; }
|
{ token_table_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 308 "parse-gram.y"
|
#line 306 "parse-gram.y"
|
||||||
{ report_flag |= report_states; }
|
{ report_flag |= report_states; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 33:
|
case 33:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 309 "parse-gram.y"
|
#line 307 "parse-gram.y"
|
||||||
{ yacc_flag = true; }
|
{ yacc_flag = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 37:
|
case 37:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 317 "parse-gram.y"
|
#line 315 "parse-gram.y"
|
||||||
{
|
{
|
||||||
grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]));
|
grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]));
|
||||||
}
|
}
|
||||||
@@ -2149,7 +2147,7 @@ yyreduce:
|
|||||||
case 38:
|
case 38:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 321 "parse-gram.y"
|
#line 319 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
|
for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
|
||||||
@@ -2161,7 +2159,7 @@ yyreduce:
|
|||||||
case 39:
|
case 39:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 328 "parse-gram.y"
|
#line 326 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
|
for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
|
||||||
@@ -2173,7 +2171,7 @@ yyreduce:
|
|||||||
case 40:
|
case 40:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 335 "parse-gram.y"
|
#line 333 "parse-gram.y"
|
||||||
{
|
{
|
||||||
default_prec = true;
|
default_prec = true;
|
||||||
}
|
}
|
||||||
@@ -2182,7 +2180,7 @@ yyreduce:
|
|||||||
case 41:
|
case 41:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 339 "parse-gram.y"
|
#line 337 "parse-gram.y"
|
||||||
{
|
{
|
||||||
default_prec = false;
|
default_prec = false;
|
||||||
}
|
}
|
||||||
@@ -2191,7 +2189,7 @@ yyreduce:
|
|||||||
case 42:
|
case 42:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 343 "parse-gram.y"
|
#line 341 "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. */
|
||||||
@@ -2203,7 +2201,7 @@ yyreduce:
|
|||||||
case 43:
|
case 43:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 350 "parse-gram.y"
|
#line 348 "parse-gram.y"
|
||||||
{
|
{
|
||||||
muscle_percent_code_grow ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
|
muscle_percent_code_grow ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
|
||||||
code_scanner_last_string_free ();
|
code_scanner_last_string_free ();
|
||||||
@@ -2213,21 +2211,21 @@ yyreduce:
|
|||||||
case 44:
|
case 44:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 364 "parse-gram.y"
|
#line 362 "parse-gram.y"
|
||||||
{}
|
{}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 45:
|
case 45:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 365 "parse-gram.y"
|
#line 363 "parse-gram.y"
|
||||||
{ muscle_code_grow ("union_name", (yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
{ muscle_code_grow ("union_name", (yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 46:
|
case 46:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 370 "parse-gram.y"
|
#line 368 "parse-gram.y"
|
||||||
{
|
{
|
||||||
union_seen = true;
|
union_seen = true;
|
||||||
muscle_code_grow ("stype", (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
|
muscle_code_grow ("stype", (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
|
||||||
@@ -2238,14 +2236,14 @@ yyreduce:
|
|||||||
case 47:
|
case 47:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 381 "parse-gram.y"
|
#line 379 "parse-gram.y"
|
||||||
{ current_class = nterm_sym; }
|
{ current_class = nterm_sym; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 48:
|
case 48:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 382 "parse-gram.y"
|
#line 380 "parse-gram.y"
|
||||||
{
|
{
|
||||||
current_class = unknown_sym;
|
current_class = unknown_sym;
|
||||||
current_type = NULL;
|
current_type = NULL;
|
||||||
@@ -2255,14 +2253,14 @@ yyreduce:
|
|||||||
case 49:
|
case 49:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 386 "parse-gram.y"
|
#line 384 "parse-gram.y"
|
||||||
{ current_class = token_sym; }
|
{ current_class = token_sym; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 50:
|
case 50:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 387 "parse-gram.y"
|
#line 385 "parse-gram.y"
|
||||||
{
|
{
|
||||||
current_class = unknown_sym;
|
current_class = unknown_sym;
|
||||||
current_type = NULL;
|
current_type = NULL;
|
||||||
@@ -2272,7 +2270,7 @@ yyreduce:
|
|||||||
case 51:
|
case 51:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 392 "parse-gram.y"
|
#line 390 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
tag_seen = true;
|
tag_seen = true;
|
||||||
@@ -2285,7 +2283,7 @@ yyreduce:
|
|||||||
case 52:
|
case 52:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 403 "parse-gram.y"
|
#line 401 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
++current_prec;
|
++current_prec;
|
||||||
@@ -2302,126 +2300,126 @@ yyreduce:
|
|||||||
case 53:
|
case 53:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 417 "parse-gram.y"
|
#line 415 "parse-gram.y"
|
||||||
{ (yyval.assoc) = left_assoc; }
|
{ (yyval.assoc) = left_assoc; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 54:
|
case 54:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 418 "parse-gram.y"
|
#line 416 "parse-gram.y"
|
||||||
{ (yyval.assoc) = right_assoc; }
|
{ (yyval.assoc) = right_assoc; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 55:
|
case 55:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 419 "parse-gram.y"
|
#line 417 "parse-gram.y"
|
||||||
{ (yyval.assoc) = non_assoc; }
|
{ (yyval.assoc) = non_assoc; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 56:
|
case 56:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 423 "parse-gram.y"
|
#line 421 "parse-gram.y"
|
||||||
{ current_type = NULL; }
|
{ current_type = NULL; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 57:
|
case 57:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 424 "parse-gram.y"
|
#line 422 "parse-gram.y"
|
||||||
{ current_type = (yyvsp[(1) - (1)].uniqstr); tag_seen = true; }
|
{ current_type = (yyvsp[(1) - (1)].uniqstr); tag_seen = true; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 58:
|
case 58:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 430 "parse-gram.y"
|
#line 428 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 59:
|
case 59:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 432 "parse-gram.y"
|
#line 430 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
|
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 60:
|
case 60:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 436 "parse-gram.y"
|
#line 434 "parse-gram.y"
|
||||||
{ (yyval.symbol) = (yyvsp[(1) - (1)].symbol); }
|
{ (yyval.symbol) = (yyvsp[(1) - (1)].symbol); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 61:
|
case 61:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 437 "parse-gram.y"
|
#line 435 "parse-gram.y"
|
||||||
{ (yyval.symbol) = (yyvsp[(1) - (2)].symbol); symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); }
|
{ (yyval.symbol) = (yyvsp[(1) - (2)].symbol); symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 62:
|
case 62:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 443 "parse-gram.y"
|
#line 441 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 63:
|
case 63:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 445 "parse-gram.y"
|
#line 443 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
|
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 449 "parse-gram.y"
|
#line 447 "parse-gram.y"
|
||||||
{ (yyval.list) = (yyvsp[(1) - (1)].list); }
|
{ (yyval.list) = (yyvsp[(1) - (1)].list); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 65:
|
case 65:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 450 "parse-gram.y"
|
#line 448 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); }
|
{ (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 66:
|
case 66:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 454 "parse-gram.y"
|
#line 452 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 67:
|
case 67:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 455 "parse-gram.y"
|
#line 453 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_type_new ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_type_new ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 68:
|
case 68:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 456 "parse-gram.y"
|
#line 454 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_default_tagged_new ((yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_default_tagged_new ((yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 69:
|
case 69:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 457 "parse-gram.y"
|
#line 455 "parse-gram.y"
|
||||||
{ (yyval.list) = symbol_list_default_tagless_new ((yylsp[(1) - (1)])); }
|
{ (yyval.list) = symbol_list_default_tagless_new ((yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 70:
|
case 70:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 463 "parse-gram.y"
|
#line 461 "parse-gram.y"
|
||||||
{
|
{
|
||||||
current_type = (yyvsp[(1) - (1)].uniqstr);
|
current_type = (yyvsp[(1) - (1)].uniqstr);
|
||||||
tag_seen = true;
|
tag_seen = true;
|
||||||
@@ -2431,7 +2429,7 @@ yyreduce:
|
|||||||
case 71:
|
case 71:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 468 "parse-gram.y"
|
#line 466 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]), true);
|
symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]), true);
|
||||||
symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)]));
|
symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)]));
|
||||||
@@ -2441,7 +2439,7 @@ yyreduce:
|
|||||||
case 72:
|
case 72:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 473 "parse-gram.y"
|
#line 471 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
|
symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
|
||||||
symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
|
symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
|
||||||
@@ -2452,7 +2450,7 @@ yyreduce:
|
|||||||
case 73:
|
case 73:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 479 "parse-gram.y"
|
#line 477 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
|
symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
|
||||||
symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
|
symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
|
||||||
@@ -2463,7 +2461,7 @@ yyreduce:
|
|||||||
case 74:
|
case 74:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 485 "parse-gram.y"
|
#line 483 "parse-gram.y"
|
||||||
{
|
{
|
||||||
symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]), true);
|
symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]), true);
|
||||||
symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)]));
|
symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)]));
|
||||||
@@ -2475,7 +2473,7 @@ yyreduce:
|
|||||||
case 81:
|
case 81:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 515 "parse-gram.y"
|
#line 513 "parse-gram.y"
|
||||||
{
|
{
|
||||||
yyerrok;
|
yyerrok;
|
||||||
}
|
}
|
||||||
@@ -2484,77 +2482,77 @@ yyreduce:
|
|||||||
case 82:
|
case 82:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 521 "parse-gram.y"
|
#line 519 "parse-gram.y"
|
||||||
{ current_lhs = (yyvsp[(1) - (1)].symbol); current_lhs_location = (yylsp[(1) - (1)]); }
|
{ current_lhs = (yyvsp[(1) - (1)].symbol); current_lhs_location = (yylsp[(1) - (1)]); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 84:
|
case 84:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 525 "parse-gram.y"
|
#line 523 "parse-gram.y"
|
||||||
{ grammar_current_rule_end ((yylsp[(1) - (1)])); }
|
{ grammar_current_rule_end ((yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 85:
|
case 85:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 526 "parse-gram.y"
|
#line 524 "parse-gram.y"
|
||||||
{ grammar_current_rule_end ((yylsp[(3) - (3)])); }
|
{ grammar_current_rule_end ((yylsp[(3) - (3)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 87:
|
case 87:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 532 "parse-gram.y"
|
#line 530 "parse-gram.y"
|
||||||
{ grammar_current_rule_begin (current_lhs, current_lhs_location); }
|
{ grammar_current_rule_begin (current_lhs, current_lhs_location); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 88:
|
case 88:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 534 "parse-gram.y"
|
#line 532 "parse-gram.y"
|
||||||
{ grammar_current_rule_symbol_append ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); }
|
{ grammar_current_rule_symbol_append ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 89:
|
case 89:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 536 "parse-gram.y"
|
#line 534 "parse-gram.y"
|
||||||
{ grammar_current_rule_action_append ((yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
{ grammar_current_rule_action_append ((yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 90:
|
case 90:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 538 "parse-gram.y"
|
#line 536 "parse-gram.y"
|
||||||
{ grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); }
|
{ grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 91:
|
case 91:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 540 "parse-gram.y"
|
#line 538 "parse-gram.y"
|
||||||
{ grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); }
|
{ grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 92:
|
case 92:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 542 "parse-gram.y"
|
#line 540 "parse-gram.y"
|
||||||
{ grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); }
|
{ grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 94:
|
case 94:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 552 "parse-gram.y"
|
#line 550 "parse-gram.y"
|
||||||
{ (yyval.uniqstr) = uniqstr_new ((yyvsp[(1) - (1)].chars)); }
|
{ (yyval.uniqstr) = uniqstr_new ((yyvsp[(1) - (1)].chars)); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 95:
|
case 95:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 558 "parse-gram.y"
|
#line 556 "parse-gram.y"
|
||||||
{
|
{
|
||||||
(yyval.chars) = "";
|
(yyval.chars) = "";
|
||||||
}
|
}
|
||||||
@@ -2563,7 +2561,7 @@ yyreduce:
|
|||||||
case 97:
|
case 97:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 571 "parse-gram.y"
|
#line 569 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props plain_code;
|
code_props plain_code;
|
||||||
(yyvsp[(1) - (1)].code)[strlen ((yyvsp[(1) - (1)].code)) - 1] = '\n';
|
(yyvsp[(1) - (1)].code)[strlen ((yyvsp[(1) - (1)].code)) - 1] = '\n';
|
||||||
@@ -2577,14 +2575,14 @@ yyreduce:
|
|||||||
case 98:
|
case 98:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 591 "parse-gram.y"
|
#line 589 "parse-gram.y"
|
||||||
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 99:
|
case 99:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 593 "parse-gram.y"
|
#line 591 "parse-gram.y"
|
||||||
{
|
{
|
||||||
(yyval.symbol) = symbol_get (char_name ((yyvsp[(1) - (1)].character)), (yylsp[(1) - (1)]));
|
(yyval.symbol) = symbol_get (char_name ((yyvsp[(1) - (1)].character)), (yylsp[(1) - (1)]));
|
||||||
symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
|
symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
|
||||||
@@ -2595,14 +2593,14 @@ yyreduce:
|
|||||||
case 100:
|
case 100:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 601 "parse-gram.y"
|
#line 599 "parse-gram.y"
|
||||||
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 103:
|
case 103:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 613 "parse-gram.y"
|
#line 611 "parse-gram.y"
|
||||||
{
|
{
|
||||||
(yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)]));
|
(yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)]));
|
||||||
symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
|
symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
|
||||||
@@ -2612,7 +2610,7 @@ yyreduce:
|
|||||||
case 105:
|
case 105:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 622 "parse-gram.y"
|
#line 620 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props plain_code;
|
code_props plain_code;
|
||||||
code_props_plain_init (&plain_code, (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)]));
|
code_props_plain_init (&plain_code, (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)]));
|
||||||
@@ -2626,7 +2624,7 @@ yyreduce:
|
|||||||
|
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 2630 "parse-gram.c"
|
#line 2628 "parse-gram.c"
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||||||
@@ -2845,7 +2843,7 @@ yyreturn:
|
|||||||
|
|
||||||
|
|
||||||
/* Line 1675 of yacc.c */
|
/* Line 1675 of yacc.c */
|
||||||
#line 632 "parse-gram.y"
|
#line 630 "parse-gram.y"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
/* A Bison parser, made by GNU Bison 2.3a+. */
|
/* A Bison parser, made by GNU Bison 2.4.4-738cd. */
|
||||||
|
|
||||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -160,8 +160,8 @@
|
|||||||
typedef union YYSTYPE
|
typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Line 1676 of yacc.c */
|
/* Line 1740 of yacc.c */
|
||||||
#line 94 "parse-gram.y"
|
#line 92 "parse-gram.y"
|
||||||
|
|
||||||
symbol *symbol;
|
symbol *symbol;
|
||||||
symbol_list *list;
|
symbol_list *list;
|
||||||
@@ -174,7 +174,7 @@ typedef union YYSTYPE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Line 1676 of yacc.c */
|
/* Line 1740 of yacc.c */
|
||||||
#line 179 "parse-gram.h"
|
#line 179 "parse-gram.h"
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
|||||||
+2
-4
@@ -21,8 +21,6 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include <strverscmp.h>
|
|
||||||
|
|
||||||
#include "complain.h"
|
#include "complain.h"
|
||||||
#include "conflicts.h"
|
#include "conflicts.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
@@ -256,7 +254,7 @@ prologue_declaration:
|
|||||||
muscle_code_grow ("initial_action", action.code, @2);
|
muscle_code_grow ("initial_action", action.code, @2);
|
||||||
code_scanner_last_string_free ();
|
code_scanner_last_string_free ();
|
||||||
}
|
}
|
||||||
| "%language" STRING { language_argmatch ($2, 1, &@1); }
|
| "%language" STRING { language_argmatch ($2, grammar_prio, &@1); }
|
||||||
| "%lex-param" "{...}" { add_param ("lex_param", $2, @2); }
|
| "%lex-param" "{...}" { add_param ("lex_param", $2, @2); }
|
||||||
| "%locations" { locations_flag = true; }
|
| "%locations" { locations_flag = true; }
|
||||||
| "%name-prefix" STRING { spec_name_prefix = $2; }
|
| "%name-prefix" STRING { spec_name_prefix = $2; }
|
||||||
@@ -302,7 +300,7 @@ prologue_declaration:
|
|||||||
skeleton_user = uniqstr_new (skeleton_build);
|
skeleton_user = uniqstr_new (skeleton_build);
|
||||||
free (skeleton_build);
|
free (skeleton_build);
|
||||||
}
|
}
|
||||||
skeleton_arg (skeleton_user, 1, &@1);
|
skeleton_arg (skeleton_user, grammar_prio, &@1);
|
||||||
}
|
}
|
||||||
| "%token-table" { token_table_flag = true; }
|
| "%token-table" { token_table_flag = true; }
|
||||||
| "%verbose" { report_flag |= report_states; }
|
| "%verbose" { report_flag |= report_states; }
|
||||||
|
|||||||
+17
-19
@@ -1,7 +1,7 @@
|
|||||||
/* Grammar reduction for Bison.
|
/* Grammar reduction for Bison.
|
||||||
|
|
||||||
Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003, 2005, 2006,
|
Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003, 2005, 2006,
|
||||||
2007 Free Software Foundation, Inc.
|
2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -382,26 +382,24 @@ reduce_output (FILE *out)
|
|||||||
static void
|
static void
|
||||||
reduce_print (void)
|
reduce_print (void)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
|
||||||
|
|
||||||
if (nuseless_nonterminals > 0)
|
if (nuseless_nonterminals > 0)
|
||||||
fprintf (stderr, ngettext ("%d nonterminal",
|
{
|
||||||
"%d nonterminals",
|
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
||||||
nuseless_nonterminals),
|
fprintf (stderr, ngettext ("%d nonterminal useless in grammar",
|
||||||
nuseless_nonterminals);
|
"%d nonterminals useless in grammar",
|
||||||
|
nuseless_nonterminals),
|
||||||
if (nuseless_nonterminals > 0 && nuseless_productions > 0)
|
nuseless_nonterminals);
|
||||||
fprintf (stderr, _(" and "));
|
fprintf (stderr, "\n");
|
||||||
|
}
|
||||||
if (nuseless_productions > 0)
|
if (nuseless_productions > 0)
|
||||||
fprintf (stderr, ngettext ("%d rule",
|
{
|
||||||
"%d rules",
|
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
||||||
nuseless_productions),
|
fprintf (stderr, ngettext ("%d rule useless in grammar",
|
||||||
nuseless_productions);
|
"%d rules useless in grammar",
|
||||||
|
nuseless_productions),
|
||||||
if (nuseless_nonterminals > 0 || nuseless_productions > 0)
|
nuseless_productions);
|
||||||
fprintf (stderr, _(" useless in grammar"));
|
fprintf (stderr, "\n");
|
||||||
fprintf (stderr, "\n");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/* Between Bison releases, define a precise revision string.
|
|
||||||
|
|
||||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
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
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#ifndef REVISION_H_
|
|
||||||
# define REVISION_H_
|
|
||||||
|
|
||||||
extern const char *revision;
|
|
||||||
|
|
||||||
#endif /* !REVISION_H_ */
|
|
||||||
+7
-4
@@ -1,6 +1,6 @@
|
|||||||
/* Bison Action Scanner -*- C -*-
|
/* Bison Action Scanner -*- C -*-
|
||||||
|
|
||||||
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -170,12 +170,14 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
|
|
||||||
"{" STRING_GROW; ++braces_level;
|
"{" STRING_GROW; ++braces_level;
|
||||||
"}" {
|
"}" {
|
||||||
bool outer_brace = --braces_level < 0;
|
bool outer_brace = --braces_level == 0;
|
||||||
|
|
||||||
/* As an undocumented Bison extension, append `;' before the last
|
/* As an undocumented Bison extension, append `;' before the last
|
||||||
brace in braced code, so that the user code can omit trailing
|
brace in braced code, so that the user code can omit trailing
|
||||||
`;'. But do not append `;' if emulating Yacc, since Yacc does
|
`;'. But do not append `;' if emulating Yacc, since Yacc does
|
||||||
not append one.
|
not append one. Also, some output languages (like Java) do not
|
||||||
|
accept an extra semicolon, so don't append if the user specified
|
||||||
|
a skeleton or language.
|
||||||
|
|
||||||
FIXME: Bison should warn if a semicolon seems to be necessary
|
FIXME: Bison should warn if a semicolon seems to be necessary
|
||||||
here, and should omit the semicolon if it seems unnecessary
|
here, and should omit the semicolon if it seems unnecessary
|
||||||
@@ -186,7 +188,8 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
should also diagnose other Bison extensions like %yacc.
|
should also diagnose other Bison extensions like %yacc.
|
||||||
Perhaps there should also be a GCC-style --pedantic-errors
|
Perhaps there should also be a GCC-style --pedantic-errors
|
||||||
option, so that such warnings are diagnosed as errors. */
|
option, so that such warnings are diagnosed as errors. */
|
||||||
if (outer_brace && ! yacc_flag)
|
if (outer_brace && !yacc_flag && language_prio == default_prio
|
||||||
|
&& skeleton_prio == default_prio)
|
||||||
obstack_1grow (&obstack_for_string, ';');
|
obstack_1grow (&obstack_for_string, ';');
|
||||||
|
|
||||||
STRING_GROW;
|
STRING_GROW;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/*.dot
|
||||||
|
/*.output
|
||||||
|
/atconfig
|
||||||
|
/atlocal
|
||||||
|
/autom4te.cache
|
||||||
|
/bison
|
||||||
|
/calc
|
||||||
|
/calc.[chy]
|
||||||
|
/calc.tab.*
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/Makefile.in
|
||||||
|
/package.m4
|
||||||
|
/testsuite
|
||||||
|
/testsuite.dir
|
||||||
|
/testsuite.log
|
||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
## Makefile for Bison testsuite.
|
## Makefile for Bison testsuite.
|
||||||
|
|
||||||
## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
|
||||||
## Foundation, Inc.
|
## Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
|
|||||||
## package.m4. ##
|
## package.m4. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
|
$(srcdir)/package.m4: $(top_srcdir)/configure
|
||||||
{ \
|
{ \
|
||||||
echo '# Signature of the current package.'; \
|
echo '# Signature of the current package.'; \
|
||||||
echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
|
echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
|
||||||
|
|||||||
+4
-4
@@ -1,14 +1,14 @@
|
|||||||
# @configure_input@ -*- shell-script -*-
|
# @configure_input@ -*- shell-script -*-
|
||||||
# Configurable variable values for Bison test suite.
|
# Configurable variable values for Bison test suite.
|
||||||
|
|
||||||
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
|
||||||
# Foundation, Inc.
|
# Software Foundation, Inc.
|
||||||
|
|
||||||
# We need a C compiler.
|
# We need a C compiler.
|
||||||
CC='@CC@'
|
CC='@CC@'
|
||||||
|
|
||||||
# We want no optimization.
|
# We want no optimization.
|
||||||
CFLAGS='@O0CFLAGS@ @WARNING_CFLAGS@ @WERROR_CFLAGS@'
|
CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@ @WERROR_CFLAGS@'
|
||||||
|
|
||||||
# We need `config.h'.
|
# We need `config.h'.
|
||||||
CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
|
CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
|
||||||
@@ -23,7 +23,7 @@ CXX='@CXX@'
|
|||||||
BISON_CXX_WORKS='@BISON_CXX_WORKS@'
|
BISON_CXX_WORKS='@BISON_CXX_WORKS@'
|
||||||
|
|
||||||
# We want no optimization with C++, too.
|
# We want no optimization with C++, too.
|
||||||
CXXFLAGS='@O0CXXFLAGS@ @WARNING_CXXFLAGS@ @WERROR_CFLAGS@'
|
CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS@ @WERROR_CFLAGS@'
|
||||||
|
|
||||||
# Are special link options needed?
|
# Are special link options needed?
|
||||||
LDFLAGS='@LDFLAGS@'
|
LDFLAGS='@LDFLAGS@'
|
||||||
|
|||||||
+171
-155
@@ -1,7 +1,7 @@
|
|||||||
# Simple calculator. -*- Autotest -*-
|
# Simple calculator. -*- Autotest -*-
|
||||||
|
|
||||||
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
|
||||||
# Foundation, Inc.
|
# Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,21 +28,162 @@
|
|||||||
|
|
||||||
# _AT_DATA_CALC_Y($1, $2, $3, [BISON-DIRECTIVES])
|
# _AT_DATA_CALC_Y($1, $2, $3, [BISON-DIRECTIVES])
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
# Produce `calc.y'. Don't call this macro directly, because it contains
|
# Produce `calc.y' and, if %defines was specified, `calc-lex.c' or
|
||||||
# some occurrences of `$1' etc. which will be interpreted by m4. So
|
# `calc-lex.cc'.
|
||||||
# you should call it with $1, $2, and $3 as arguments, which is what
|
#
|
||||||
# AT_DATA_CALC_Y does.
|
# Don't call this macro directly, because it contains some occurrences
|
||||||
|
# of `$1' etc. which will be interpreted by m4. So you should call it
|
||||||
|
# with $1, $2, and $3 as arguments, which is what AT_DATA_CALC_Y does.
|
||||||
m4_define([_AT_DATA_CALC_Y],
|
m4_define([_AT_DATA_CALC_Y],
|
||||||
[m4_if([$1$2$3], $[1]$[2]$[3], [],
|
[m4_if([$1$2$3], $[1]$[2]$[3], [],
|
||||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||||
|
m4_pushdef([AT_CALC_LEX],
|
||||||
|
[[#include <ctype.h>
|
||||||
|
|
||||||
|
int ]AT_NAME_PREFIX[lex (]AT_LEX_FORMALS[);
|
||||||
|
static int get_char (]AT_LEX_FORMALS[);
|
||||||
|
static void unget_char (]AT_LEX_PRE_FORMALS[ int c);
|
||||||
|
|
||||||
|
]AT_LOCATION_IF([
|
||||||
|
static YYLTYPE last_yylloc;
|
||||||
|
])[
|
||||||
|
static int
|
||||||
|
get_char (]AT_LEX_FORMALS[)
|
||||||
|
{
|
||||||
|
int res = getc (input);
|
||||||
|
]AT_USE_LEX_ARGS[;
|
||||||
|
]AT_LOCATION_IF([
|
||||||
|
last_yylloc = AT_LOC;
|
||||||
|
if (res == '\n')
|
||||||
|
{
|
||||||
|
AT_LOC.last_line++;
|
||||||
|
AT_LOC.last_column = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
AT_LOC.last_column++;
|
||||||
|
])[
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
unget_char (]AT_LEX_PRE_FORMALS[ int c)
|
||||||
|
{
|
||||||
|
]AT_USE_LEX_ARGS[;
|
||||||
|
]AT_LOCATION_IF([
|
||||||
|
/* Wrong when C == `\n'. */
|
||||||
|
AT_LOC = last_yylloc;
|
||||||
|
])[
|
||||||
|
ungetc (c, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
read_signed_integer (]AT_LEX_FORMALS[)
|
||||||
|
{
|
||||||
|
int c = get_char (]AT_LEX_ARGS[);
|
||||||
|
int sign = 1;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
]AT_USE_LEX_ARGS[;
|
||||||
|
if (c == '-')
|
||||||
|
{
|
||||||
|
c = get_char (]AT_LEX_ARGS[);
|
||||||
|
sign = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (isdigit (c))
|
||||||
|
{
|
||||||
|
n = 10 * n + (c - '0');
|
||||||
|
c = get_char (]AT_LEX_ARGS[);
|
||||||
|
}
|
||||||
|
|
||||||
|
unget_char (]AT_LEX_PRE_ARGS[ c);
|
||||||
|
|
||||||
|
return sign * n;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------.
|
||||||
|
| Lexical analyzer returns an integer on the stack and the token |
|
||||||
|
| NUM, or the ASCII character read if not a number. Skips all |
|
||||||
|
| blanks and tabs, returns 0 for EOF. |
|
||||||
|
`---------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int
|
||||||
|
]AT_NAME_PREFIX[lex (]AT_LEX_FORMALS[)
|
||||||
|
{
|
||||||
|
static int init = 1;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
if (init)
|
||||||
|
{
|
||||||
|
init = 0;
|
||||||
|
]AT_LOCATION_IF([
|
||||||
|
AT_LOC.last_column = 1;
|
||||||
|
AT_LOC.last_line = 1;
|
||||||
|
])[
|
||||||
|
}
|
||||||
|
|
||||||
|
]AT_LOCATION_IF([
|
||||||
|
AT_LOC.first_column = AT_LOC.last_column;
|
||||||
|
AT_LOC.first_line = AT_LOC.last_line;
|
||||||
|
])[
|
||||||
|
|
||||||
|
/* Skip white space. */
|
||||||
|
while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t')
|
||||||
|
{
|
||||||
|
]AT_LOCATION_IF(
|
||||||
|
[ AT_LOC.first_column = AT_LOC.last_column;
|
||||||
|
AT_LOC.first_line = AT_LOC.last_line;
|
||||||
|
])[
|
||||||
|
}
|
||||||
|
|
||||||
|
/* process numbers */
|
||||||
|
if (c == '.' || isdigit (c))
|
||||||
|
{
|
||||||
|
unget_char (]AT_LEX_PRE_ARGS[ c);
|
||||||
|
]AT_VAL[.ival = read_signed_integer (]AT_LEX_ARGS[);
|
||||||
|
return NUM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return end-of-file. */
|
||||||
|
if (c == EOF)
|
||||||
|
return CALC_EOF;
|
||||||
|
|
||||||
|
/* Return single chars. */
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
]])
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([calc.y],
|
AT_DATA_GRAMMAR([calc.y],
|
||||||
[[/* Infix notation calculator--calc */
|
[[/* Infix notation calculator--calc */
|
||||||
]$4
|
]$4
|
||||||
AT_SKEL_CC_IF(
|
AT_SKEL_CC_IF(
|
||||||
[%define global_tokens_and_yystype])[
|
[%define global_tokens_and_yystype])[
|
||||||
%{
|
%code requires {
|
||||||
#include <stdio.h>
|
/* Exercise pre-prologue dependency to %union. */
|
||||||
|
typedef int semantic_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Exercise %union. */
|
||||||
|
%union
|
||||||
|
{
|
||||||
|
semantic_value ival;
|
||||||
|
};
|
||||||
|
|
||||||
|
%code provides {
|
||||||
|
#include <stdio.h>
|
||||||
|
/* The input. */
|
||||||
|
extern FILE *input;]AT_SKEL_CC_IF([[
|
||||||
|
#ifndef YYLTYPE
|
||||||
|
# define YYLTYPE ]AT_NAME_PREFIX[::location
|
||||||
|
#endif
|
||||||
|
#define first_line begin.line
|
||||||
|
#define first_column begin.column
|
||||||
|
#define last_line end.line
|
||||||
|
#define last_column end.column]])[
|
||||||
|
}
|
||||||
|
|
||||||
|
%code {
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
@@ -51,33 +192,13 @@ AT_SKEL_CC_IF(
|
|||||||
# undef alarm
|
# undef alarm
|
||||||
# define alarm(seconds) /* empty */
|
# define alarm(seconds) /* empty */
|
||||||
#endif
|
#endif
|
||||||
#include <ctype.h>
|
|
||||||
#define USE(Var)
|
#define USE(Var)
|
||||||
|
|
||||||
/* Exercise pre-prologue dependency to %union. */
|
FILE *input;
|
||||||
typedef int semantic_value;
|
|
||||||
|
|
||||||
static semantic_value global_result = 0;
|
static semantic_value global_result = 0;
|
||||||
static int global_count = 0;
|
static int global_count = 0;
|
||||||
%}
|
|
||||||
|
|
||||||
/* Exercise %union. */
|
|
||||||
%union
|
|
||||||
{
|
|
||||||
semantic_value ival;
|
|
||||||
};
|
|
||||||
|
|
||||||
%{
|
|
||||||
static int power (int base, int exponent);
|
static int power (int base, int exponent);
|
||||||
]AT_SKEL_CC_IF(
|
]AT_SKEL_CC_IF(,
|
||||||
[#ifndef YYLTYPE
|
|
||||||
[#] define YYLTYPE AT_NAME_PREFIX::location
|
|
||||||
#endif
|
|
||||||
#define first_line begin.line
|
|
||||||
#define first_column begin.column
|
|
||||||
#define last_line end.line
|
|
||||||
#define last_column end.column
|
|
||||||
],
|
|
||||||
[/* yyerror receives the location if:
|
[/* yyerror receives the location if:
|
||||||
- %location & %pure & %glr
|
- %location & %pure & %glr
|
||||||
- %location & %pure & %yacc & %parse-param. */
|
- %location & %pure & %yacc & %parse-param. */
|
||||||
@@ -85,10 +206,8 @@ static void yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
|
|||||||
AT_PARAM_IF([semantic_value *result, int *count, ])
|
AT_PARAM_IF([semantic_value *result, int *count, ])
|
||||||
const char *s
|
const char *s
|
||||||
);])[
|
);])[
|
||||||
static int yylex (]AT_LEX_FORMALS[);
|
int yylex (]AT_LEX_FORMALS[);
|
||||||
static int get_char (]AT_LEX_FORMALS[);
|
}
|
||||||
static void unget_char (]AT_LEX_PRE_FORMALS[ int c);
|
|
||||||
%}
|
|
||||||
|
|
||||||
]AT_SKEL_CC_IF(
|
]AT_SKEL_CC_IF(
|
||||||
[/* The lalr1.cc skeleton, for backward compatibility, defines
|
[/* The lalr1.cc skeleton, for backward compatibility, defines
|
||||||
@@ -139,13 +258,11 @@ exp:
|
|||||||
| '-' exp %prec NEG { $$ = -$2; }
|
| '-' exp %prec NEG { $$ = -$2; }
|
||||||
| exp '^' exp { $$ = power ($1, $3); }
|
| exp '^' exp { $$ = power ($1, $3); }
|
||||||
| '(' exp ')' { $$ = $2; }
|
| '(' exp ')' { $$ = $2; }
|
||||||
| '(' error ')' { $$ = 1111; }
|
| '(' error ')' { $$ = 1111; yyerrok; }
|
||||||
| '!' { $$ = 0; YYERROR; }
|
| '!' { $$ = 0; YYERROR; }
|
||||||
| '-' error { $$ = 0; YYERROR; }
|
| '-' error { $$ = 0; YYERROR; }
|
||||||
;
|
;
|
||||||
%%
|
%%
|
||||||
/* The input. */
|
|
||||||
static FILE *input;
|
|
||||||
|
|
||||||
]AT_SKEL_CC_IF(
|
]AT_SKEL_CC_IF(
|
||||||
[/* A C++ error reporting function. */
|
[/* A C++ error reporting function. */
|
||||||
@@ -185,117 +302,7 @@ AT_YYERROR_SEES_LOC_IF([
|
|||||||
fprintf (stderr, "%s\n", s);
|
fprintf (stderr, "%s\n", s);
|
||||||
}])[
|
}])[
|
||||||
|
|
||||||
|
]AT_DEFINES_IF(, [AT_CALC_LEX])[
|
||||||
]AT_LOCATION_IF([
|
|
||||||
static YYLTYPE last_yylloc;
|
|
||||||
])[
|
|
||||||
static int
|
|
||||||
get_char (]AT_LEX_FORMALS[)
|
|
||||||
{
|
|
||||||
int res = getc (input);
|
|
||||||
]AT_USE_LEX_ARGS[;
|
|
||||||
]AT_LOCATION_IF([
|
|
||||||
last_yylloc = AT_LOC;
|
|
||||||
if (res == '\n')
|
|
||||||
{
|
|
||||||
AT_LOC.last_line++;
|
|
||||||
AT_LOC.last_column = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
AT_LOC.last_column++;
|
|
||||||
])[
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
unget_char (]AT_LEX_PRE_FORMALS[ int c)
|
|
||||||
{
|
|
||||||
]AT_USE_LEX_ARGS[;
|
|
||||||
]AT_LOCATION_IF([
|
|
||||||
/* Wrong when C == `\n'. */
|
|
||||||
AT_LOC = last_yylloc;
|
|
||||||
])[
|
|
||||||
ungetc (c, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
read_signed_integer (]AT_LEX_FORMALS[)
|
|
||||||
{
|
|
||||||
int c = get_char (]AT_LEX_ARGS[);
|
|
||||||
int sign = 1;
|
|
||||||
int n = 0;
|
|
||||||
|
|
||||||
]AT_USE_LEX_ARGS[;
|
|
||||||
if (c == '-')
|
|
||||||
{
|
|
||||||
c = get_char (]AT_LEX_ARGS[);
|
|
||||||
sign = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (isdigit (c))
|
|
||||||
{
|
|
||||||
n = 10 * n + (c - '0');
|
|
||||||
c = get_char (]AT_LEX_ARGS[);
|
|
||||||
}
|
|
||||||
|
|
||||||
unget_char (]AT_LEX_PRE_ARGS[ c);
|
|
||||||
|
|
||||||
return sign * n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------.
|
|
||||||
| Lexical analyzer returns an integer on the stack and the token |
|
|
||||||
| NUM, or the ASCII character read if not a number. Skips all |
|
|
||||||
| blanks and tabs, returns 0 for EOF. |
|
|
||||||
`---------------------------------------------------------------*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
yylex (]AT_LEX_FORMALS[)
|
|
||||||
{
|
|
||||||
static int init = 1;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
if (init)
|
|
||||||
{
|
|
||||||
init = 0;
|
|
||||||
]AT_LOCATION_IF([
|
|
||||||
AT_LOC.last_column = 1;
|
|
||||||
AT_LOC.last_line = 1;
|
|
||||||
])[
|
|
||||||
}
|
|
||||||
|
|
||||||
]AT_LOCATION_IF([
|
|
||||||
AT_LOC.first_column = AT_LOC.last_column;
|
|
||||||
AT_LOC.first_line = AT_LOC.last_line;
|
|
||||||
])[
|
|
||||||
|
|
||||||
/* Skip white space. */
|
|
||||||
while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t')
|
|
||||||
{
|
|
||||||
]AT_LOCATION_IF(
|
|
||||||
[ AT_LOC.first_column = AT_LOC.last_column;
|
|
||||||
AT_LOC.first_line = AT_LOC.last_line;
|
|
||||||
])[
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process numbers */
|
|
||||||
if (c == '.' || isdigit (c))
|
|
||||||
{
|
|
||||||
unget_char (]AT_LEX_PRE_ARGS[ c);
|
|
||||||
]AT_VAL[.ival = read_signed_integer (]AT_LEX_ARGS[);
|
|
||||||
return NUM;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return end-of-file. */
|
|
||||||
if (c == EOF)
|
|
||||||
return CALC_EOF;
|
|
||||||
|
|
||||||
/* Return single chars. */
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
power (int base, int exponent)
|
power (int base, int exponent)
|
||||||
@@ -343,12 +350,18 @@ main (int argc, const char **argv)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
|
AT_DEFINES_IF([AT_DATA_SOURCE([[calc-lex.c]AT_SKEL_CC_IF([[c]])],
|
||||||
|
[[#include "calc.h]AT_SKEL_CC_IF([[h]])["
|
||||||
|
|
||||||
|
]AT_CALC_LEX])])
|
||||||
|
m4_popdef([AT_CALC_LEX])
|
||||||
])# _AT_DATA_CALC_Y
|
])# _AT_DATA_CALC_Y
|
||||||
|
|
||||||
|
|
||||||
# AT_DATA_CALC_Y([BISON-OPTIONS])
|
# AT_DATA_CALC_Y([BISON-OPTIONS])
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
# Produce `calc.y'.
|
# Produce `calc.y' and, if %defines was specified, `calc-lex.c' or
|
||||||
|
# `calc-lex.cc'.
|
||||||
m4_define([AT_DATA_CALC_Y],
|
m4_define([AT_DATA_CALC_Y],
|
||||||
[_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
|
[_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
|
||||||
])
|
])
|
||||||
@@ -453,12 +466,7 @@ m4_ifval([$2], [AT_CHECK([exit 77])])
|
|||||||
AT_BISON_OPTION_PUSHDEFS([$1])
|
AT_BISON_OPTION_PUSHDEFS([$1])
|
||||||
|
|
||||||
AT_DATA_CALC_Y([$1])
|
AT_DATA_CALC_Y([$1])
|
||||||
|
AT_FULL_COMPILE([calc], [AT_DEFINES_IF([[lex]])])
|
||||||
AT_SKEL_CC_IF(
|
|
||||||
[AT_BISON_CHECK([-o calc.cc calc.y])
|
|
||||||
AT_COMPILE_CXX([calc])],
|
|
||||||
[AT_BISON_CHECK([-o calc.c calc.y])
|
|
||||||
AT_COMPILE([calc])])
|
|
||||||
|
|
||||||
# Test the priorities.
|
# Test the priorities.
|
||||||
_AT_CHECK_CALC([$1],
|
_AT_CHECK_CALC([$1],
|
||||||
@@ -529,6 +537,14 @@ _AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [113],
|
|||||||
[1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
[1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
||||||
1.12: syntax error, unexpected number
|
1.12: syntax error, unexpected number
|
||||||
calc: error: 2222 != 1])
|
calc: error: 2222 != 1])
|
||||||
|
|
||||||
|
# Check that yyerrok works properly: second error is not reported,
|
||||||
|
# third and fourth are. Parse status is succesfull.
|
||||||
|
_AT_CHECK_CALC_ERROR([$1], [0], [(* *) + (*) + (*)], [113],
|
||||||
|
[1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
||||||
|
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
||||||
|
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'])
|
||||||
|
|
||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
# Checking GLR Parsing. -*- Autotest -*-
|
# Checking GLR Parsing. -*- Autotest -*-
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -351,7 +351,7 @@ AT_BISON_OPTION_POPDEFS
|
|||||||
])
|
])
|
||||||
|
|
||||||
m4_define([_AT_RESOLVED_GLR_OUTPUT],
|
m4_define([_AT_RESOLVED_GLR_OUTPUT],
|
||||||
[[+(z,q)
|
[[[+(z,q)
|
||||||
<declare>(T,x)
|
<declare>(T,x)
|
||||||
<init-declare>(T,x,y)
|
<init-declare>(T,x,y)
|
||||||
=(x,y)
|
=(x,y)
|
||||||
@@ -360,10 +360,10 @@ m4_define([_AT_RESOLVED_GLR_OUTPUT],
|
|||||||
<init-declare>(T,y,+(z,q))
|
<init-declare>(T,y,+(z,q))
|
||||||
<error>
|
<error>
|
||||||
+(z,q)
|
+(z,q)
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
m4_define([_AT_RESOLVED_GLR_OUTPUT_WITH_LOC],
|
m4_define([_AT_RESOLVED_GLR_OUTPUT_WITH_LOC],
|
||||||
[[3.0-3.5: +(z,q)
|
[[[3.0-3.5: +(z,q)
|
||||||
5.0-5.3: <declare>(T,x)
|
5.0-5.3: <declare>(T,x)
|
||||||
7.0-7.7: <init-declare>(T,x,y)
|
7.0-7.7: <init-declare>(T,x,y)
|
||||||
9.0-9.5: =(x,y)
|
9.0-9.5: =(x,y)
|
||||||
@@ -372,10 +372,10 @@ m4_define([_AT_RESOLVED_GLR_OUTPUT_WITH_LOC],
|
|||||||
15.0-15.13: <init-declare>(T,y,+(z,q))
|
15.0-15.13: <init-declare>(T,y,+(z,q))
|
||||||
17.0-17.15: <error>
|
17.0-17.15: <error>
|
||||||
19.0-19.5: +(z,q)
|
19.0-19.5: +(z,q)
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
m4_define([_AT_AMBIG_GLR_OUTPUT],
|
m4_define([_AT_AMBIG_GLR_OUTPUT],
|
||||||
[[+(z,q)
|
[[[+(z,q)
|
||||||
<declare>(T,x)
|
<declare>(T,x)
|
||||||
<init-declare>(T,x,y)
|
<init-declare>(T,x,y)
|
||||||
=(x,y)
|
=(x,y)
|
||||||
@@ -384,10 +384,10 @@ m4_define([_AT_AMBIG_GLR_OUTPUT],
|
|||||||
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
|
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
|
||||||
<error>
|
<error>
|
||||||
+(z,q)
|
+(z,q)
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
m4_define([_AT_AMBIG_GLR_OUTPUT_WITH_LOC],
|
m4_define([_AT_AMBIG_GLR_OUTPUT_WITH_LOC],
|
||||||
[[3.0-3.5: +(z,q)
|
[[[3.0-3.5: +(z,q)
|
||||||
5.0-5.3: <declare>(T,x)
|
5.0-5.3: <declare>(T,x)
|
||||||
7.0-7.7: <init-declare>(T,x,y)
|
7.0-7.7: <init-declare>(T,x,y)
|
||||||
9.0-9.5: =(x,y)
|
9.0-9.5: =(x,y)
|
||||||
@@ -396,15 +396,15 @@ m4_define([_AT_AMBIG_GLR_OUTPUT_WITH_LOC],
|
|||||||
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
|
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
|
||||||
17.0-17.15: <error>
|
17.0-17.15: <error>
|
||||||
19.0-19.5: +(z,q)
|
19.0-19.5: +(z,q)
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
m4_define([_AT_GLR_STDERR],
|
m4_define([_AT_GLR_STDERR],
|
||||||
[[syntax error
|
[[[syntax error
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
m4_define([_AT_VERBOSE_GLR_STDERR],
|
m4_define([_AT_VERBOSE_GLR_STDERR],
|
||||||
[[syntax error, unexpected ID, expecting '=' or '+' or ')'
|
[[[syntax error, unexpected ID, expecting '=' or '+' or ')'
|
||||||
]])
|
]]])
|
||||||
|
|
||||||
## ---------------------------------------------------- ##
|
## ---------------------------------------------------- ##
|
||||||
## Compile the grammar described in the documentation. ##
|
## Compile the grammar described in the documentation. ##
|
||||||
|
|||||||
+368
-1
@@ -1,6 +1,6 @@
|
|||||||
# Java tests for simple calculator. -*- Autotest -*-
|
# Java tests for simple calculator. -*- Autotest -*-
|
||||||
|
|
||||||
# Copyright (C) 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -397,3 +397,370 @@ AT_CHECK_JAVA_CALC([%lex-param { InputStream is } ], [[
|
|||||||
new Calc (System.in).parse ();
|
new Calc (System.in).parse ();
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------#
|
||||||
|
# Java Directives. #
|
||||||
|
# -----------------#
|
||||||
|
|
||||||
|
AT_BANNER([Java Parameters.])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_CHECK_JAVA_MINIMAL([DIRECTIVES], [PARSER_ACTION], [POSITION_CLASS])
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# Check that a mininal parser with DIRECTIVES compiles in Java.
|
||||||
|
# Put the Java code in YYParser.java.
|
||||||
|
m4_define([AT_CHECK_JAVA_MINIMAL],
|
||||||
|
[
|
||||||
|
AT_DATA([[YYParser.y]], [
|
||||||
|
%language "Java"
|
||||||
|
%locations
|
||||||
|
%debug
|
||||||
|
%error-verbose
|
||||||
|
%token-table
|
||||||
|
$1
|
||||||
|
%%
|
||||||
|
start: "end" {$2};
|
||||||
|
%%
|
||||||
|
class m4_default([$3], [Position]) {}
|
||||||
|
])
|
||||||
|
AT_BISON_CHECK([[YYParser.y]])
|
||||||
|
AT_CHECK([[grep -q '[mb]4_' YYParser.y]], [1])
|
||||||
|
AT_JAVA_COMPILE([[YYParser.java]])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_CHECK_JAVA_MINIMAL_W_LEXER([1:DIRECTIVES], [2:LEX_THROWS],
|
||||||
|
# [3:YYLEX_ACTION], [4:LEXER_BODY], [5:PARSER_ACTION], [6:STYPE],
|
||||||
|
# [7:POSITION_TYPE], [8:LOCATION_TYPE])
|
||||||
|
# ---------------------------------------------------------------------
|
||||||
|
# Check that a mininal parser with DIRECTIVES and a "%code lexer".
|
||||||
|
# YYLEX is the body of yylex () which throws LEX_THROW.
|
||||||
|
# compiles in Java.
|
||||||
|
m4_define([AT_CHECK_JAVA_MINIMAL_W_LEXER],
|
||||||
|
[AT_CHECK_JAVA_MINIMAL([$1
|
||||||
|
|
||||||
|
%code lexer
|
||||||
|
{
|
||||||
|
m4_default([$6], [Object]) yylval;
|
||||||
|
public m4_default([$6], [Object]) getLVal() { return yylval; }
|
||||||
|
|
||||||
|
public m4_default([$7], [Position]) getStartPos() { return null; }
|
||||||
|
public m4_default([$7], [Position]) getEndPos() { return null; }
|
||||||
|
|
||||||
|
public void yyerror (m4_default([$8], [Location]) loc, String s)
|
||||||
|
{
|
||||||
|
System.err.println (loc + ": " + s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int yylex ()$2
|
||||||
|
{
|
||||||
|
$3
|
||||||
|
}
|
||||||
|
|
||||||
|
$4
|
||||||
|
}], [$5], [$7])])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_CHECK_JAVA_GREP([LINE], [COUNT=1])
|
||||||
|
# -------------------------------------
|
||||||
|
# Check that YYParser.java contains exactly COUNT lines matching ^LINE$
|
||||||
|
# with grep.
|
||||||
|
m4_define([AT_CHECK_JAVA_GREP],
|
||||||
|
[AT_CHECK([grep -c '^$1$' YYParser.java], [], [m4_default([$2], [1])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------- #
|
||||||
|
# Java parser class and package names #
|
||||||
|
# ----------------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java parser class and package names])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([])
|
||||||
|
AT_CHECK_JAVA_GREP([[class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%name-prefix "Prefix"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[class PrefixParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define parser_class_name "ParserClassName"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[class ParserClassName]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define package "user_java_package"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[package user_java_package;]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------- #
|
||||||
|
# Java parser class modifiers #
|
||||||
|
# --------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java parser class modifiers])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define abstract]])
|
||||||
|
AT_CHECK_JAVA_GREP([[abstract class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define final]])
|
||||||
|
AT_CHECK_JAVA_GREP([[final class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define abstract
|
||||||
|
%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[abstract strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define final
|
||||||
|
%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[final strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define public]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define public
|
||||||
|
%define abstract]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public abstract class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define public
|
||||||
|
%define final]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public final class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define public
|
||||||
|
%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define public
|
||||||
|
%define abstract
|
||||||
|
%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public abstract strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define public
|
||||||
|
%define final
|
||||||
|
%define strictfp]])
|
||||||
|
AT_CHECK_JAVA_GREP([[public final strictfp class YYParser]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------- #
|
||||||
|
# Java parser class extends and implements #
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java parser class extends and implements])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define extends "Thread"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[class YYParser extends Thread]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%define implements "Cloneable"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[class YYParser implements Cloneable]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define extends "Thread"
|
||||||
|
%define implements "Cloneable"]])
|
||||||
|
AT_CHECK_JAVA_GREP([[class YYParser extends Thread implements Cloneable]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------- #
|
||||||
|
# Java %parse-param and %lex-param #
|
||||||
|
# -------------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java %parse-param and %lex-param])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer) {]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[%parse-param {int parse_param1}]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%parse-param {int parse_param1}
|
||||||
|
%parse-param {long parse_param2}]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([], [], [[return EOF;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser () {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer) {]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[%parse-param {int parse_param1}]],
|
||||||
|
[], [[return EOF;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
||||||
|
%parse-param {int parse_param1}
|
||||||
|
%parse-param {long parse_param2}]],
|
||||||
|
[], [[return EOF;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1, *long parse_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]], [2])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[%lex-param {char lex_param1}]],
|
||||||
|
[], [[return EOF;]], [[YYLexer (char lex_param1) {}]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (char lex_param1) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[.* = new YYLexer *(lex_param1);]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
||||||
|
%lex-param {char lex_param1}
|
||||||
|
%lex-param {short lex_param2}]],
|
||||||
|
[], [[return EOF;]], [[YYLexer (char lex_param1, short lex_param2) {}]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (char lex_param1, *short lex_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[.* = new YYLexer *(lex_param1, *lex_param2);]])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
||||||
|
%parse-param {int parse_param1}
|
||||||
|
%parse-param {long parse_param2}
|
||||||
|
%lex-param {char lex_param1}
|
||||||
|
%lex-param {short lex_param2}]],
|
||||||
|
[], [[return EOF;]], [[YYLexer (char lex_param1, short lex_param2) {}]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[.* = new YYLexer *(lex_param1, *lex_param2);]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {]])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
||||||
|
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]], [2])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------- #
|
||||||
|
# Java throw specifications #
|
||||||
|
# ------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java throws specifications])
|
||||||
|
|
||||||
|
# %define throws - 0 1 2
|
||||||
|
# %define lex-throws - 0 1 2
|
||||||
|
# %code lexer 0 1
|
||||||
|
|
||||||
|
m4_define([AT_JT_lex_throws_define], [m4_case(AT_JT_lex_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [[%define lex_throws ""]],
|
||||||
|
1, [[%define lex_throws "InterruptedException"]],
|
||||||
|
2, [[%define lex_throws "InterruptedException, IllegalAccessException"]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_yylex_throws], [m4_case(AT_JT_lex_throws,
|
||||||
|
-1, [[ throws java.io.IOException]],
|
||||||
|
0, [],
|
||||||
|
1, [[ throws InterruptedException]],
|
||||||
|
2, [[ throws InterruptedException, IllegalAccessException]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_yylex_action], [m4_case(AT_JT_lex_throws,
|
||||||
|
-1, [[throw new java.io.IOException();]],
|
||||||
|
0, [[return EOF;]],
|
||||||
|
1, [[throw new InterruptedException();]],
|
||||||
|
2, [[throw new IllegalAccessException();]])])
|
||||||
|
|
||||||
|
|
||||||
|
m4_define([AT_JT_throws_define], [m4_case(AT_JT_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [[%define throws ""]],
|
||||||
|
1, [[%define throws "ClassNotFoundException"]],
|
||||||
|
2, [[%define throws "ClassNotFoundException, InstantiationException"]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_yyaction_throws], [m4_case(AT_JT_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [],
|
||||||
|
1, [[ throws ClassNotFoundException]],
|
||||||
|
2, [[ throws ClassNotFoundException, InstantiationException]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_parse_throws_2], [m4_case(AT_JT_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [],
|
||||||
|
1, [[, ClassNotFoundException]],
|
||||||
|
2, [[, ClassNotFoundException, InstantiationException]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_parse_throws],
|
||||||
|
[m4_if(m4_quote(AT_JT_yylex_throws), [],
|
||||||
|
[AT_JT_yyaction_throws],
|
||||||
|
[AT_JT_yylex_throws[]AT_JT_parse_throws_2])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_initial_action], [m4_case(AT_JT_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [],
|
||||||
|
1, [[%initial-action {if (true) throw new ClassNotFoundException();}]],
|
||||||
|
2, [[%initial-action {if (true) throw new InstantiationException();}]])])
|
||||||
|
|
||||||
|
m4_define([AT_JT_parse_action], [m4_case(AT_JT_throws,
|
||||||
|
-1, [],
|
||||||
|
0, [],
|
||||||
|
1, [[throw new ClassNotFoundException();]],
|
||||||
|
2, [[throw new ClassNotFoundException();]])])
|
||||||
|
|
||||||
|
m4_for([AT_JT_lexer], 0, 1, 1,
|
||||||
|
[m4_for([AT_JT_lex_throws], -1, 2, 1,
|
||||||
|
[m4_for([AT_JT_throws], -1, 2, 1,
|
||||||
|
[m4_if(AT_JT_lexer, 0,
|
||||||
|
[AT_CHECK_JAVA_MINIMAL([
|
||||||
|
AT_JT_throws_define
|
||||||
|
AT_JT_lex_throws_define
|
||||||
|
AT_JT_initial_action],
|
||||||
|
[AT_JT_parse_action])],
|
||||||
|
[AT_CHECK_JAVA_MINIMAL_W_LEXER([
|
||||||
|
AT_JT_throws_define
|
||||||
|
AT_JT_lex_throws_define
|
||||||
|
AT_JT_initial_action],
|
||||||
|
[AT_JT_yylex_throws],
|
||||||
|
[AT_JT_yylex_action],
|
||||||
|
[],
|
||||||
|
[AT_JT_parse_action])])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *int yylex ()]AT_JT_yylex_throws *[;]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *private int yyaction ([^)]*)]AT_JT_yyaction_throws[ *]])
|
||||||
|
AT_CHECK_JAVA_GREP([[ *public boolean parse ()]AT_JT_parse_throws[ *]])
|
||||||
|
])])])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------- #
|
||||||
|
# Java stype, position_class and location_class #
|
||||||
|
# --------------------------------------------- #
|
||||||
|
|
||||||
|
AT_SETUP([Java stype, position_class and location_class])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
|
%define stype "java.awt.Color"
|
||||||
|
%type<java.awt.Color> start;
|
||||||
|
%define location_type "MyLoc"
|
||||||
|
%define position_type "MyPos"
|
||||||
|
%code { class MyPos {} }]], [[$$ = $<java.awt.Color>1;]], [[MyPos]])
|
||||||
|
AT_CHECK([[grep -q 'java.awt.Color' YYParser.java]])
|
||||||
|
AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Position']], [1])
|
||||||
|
AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Location']], [1])
|
||||||
|
|
||||||
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
||||||
|
%define stype "java.awt.Color"
|
||||||
|
%type<java.awt.Color> start;
|
||||||
|
%define location_type "MyLoc"
|
||||||
|
%define position_type "MyPos"
|
||||||
|
%code { class MyPos {} }]], [], [[return EOF;]], [],
|
||||||
|
[[$$ = $<java.awt.Color>1;]],
|
||||||
|
[[java.awt.Color]], [[MyPos]], [[MyLoc]])
|
||||||
|
AT_CHECK([[grep -q 'java.awt.Color' YYParser.java]])
|
||||||
|
AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Position']], [1])
|
||||||
|
AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Location']], [1])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|||||||
+45
-11
@@ -1,7 +1,8 @@
|
|||||||
# Process this -*- Autotest -*- file with autom4te.
|
# Process this -*- Autotest -*- file with autom4te.
|
||||||
|
|
||||||
# Macros for the GNU Bison Test suite.
|
# Macros for the GNU Bison Test suite.
|
||||||
# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -39,6 +40,8 @@ m4_define([AT_BISON_OPTION_PUSHDEFS],
|
|||||||
m4_define([_AT_BISON_OPTION_PUSHDEFS],
|
m4_define([_AT_BISON_OPTION_PUSHDEFS],
|
||||||
[m4_if([$1$2], $[1]$[2], [],
|
[m4_if([$1$2], $[1]$[2], [],
|
||||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||||
|
m4_pushdef([AT_DEFINES_IF],
|
||||||
|
[m4_bmatch([$3], [%defines], [$1], [$2])])
|
||||||
m4_pushdef([AT_SKEL_CC_IF],
|
m4_pushdef([AT_SKEL_CC_IF],
|
||||||
[m4_bmatch([$3], [%language "[Cc]\+\+"\|%skeleton "[a-z0-9]+\.cc"], [$1], [$2])])
|
[m4_bmatch([$3], [%language "[Cc]\+\+"\|%skeleton "[a-z0-9]+\.cc"], [$1], [$2])])
|
||||||
m4_pushdef([AT_GLR_IF],
|
m4_pushdef([AT_GLR_IF],
|
||||||
@@ -100,8 +103,8 @@ AT_PURE_LEX_IF(
|
|||||||
m4_pushdef([AT_LEX_PRE_ARGS],
|
m4_pushdef([AT_LEX_PRE_ARGS],
|
||||||
[AT_LEX_ARGS, ])
|
[AT_LEX_ARGS, ])
|
||||||
],
|
],
|
||||||
[m4_pushdef([AT_LOC], [(yylloc)])
|
[m4_pushdef([AT_LOC], [[(]AT_NAME_PREFIX[lloc)]])
|
||||||
m4_pushdef([AT_VAL], [(yylval)])
|
m4_pushdef([AT_VAL], [[(]AT_NAME_PREFIX[lval)]])
|
||||||
m4_pushdef([AT_LEX_FORMALS], [void])
|
m4_pushdef([AT_LEX_FORMALS], [void])
|
||||||
m4_pushdef([AT_LEX_ARGS], [])
|
m4_pushdef([AT_LEX_ARGS], [])
|
||||||
m4_pushdef([AT_USE_LEX_ARGS], [])
|
m4_pushdef([AT_USE_LEX_ARGS], [])
|
||||||
@@ -135,6 +138,7 @@ m4_popdef([AT_GLR_IF])
|
|||||||
m4_popdef([AT_SKEL_CC_IF])
|
m4_popdef([AT_SKEL_CC_IF])
|
||||||
m4_popdef([AT_GLR_CC_IF])
|
m4_popdef([AT_GLR_CC_IF])
|
||||||
m4_popdef([AT_LALR1_CC_IF])
|
m4_popdef([AT_LALR1_CC_IF])
|
||||||
|
m4_popdef([AT_DEFINES_IF])
|
||||||
])# AT_BISON_OPTION_POPDEFS
|
])# AT_BISON_OPTION_POPDEFS
|
||||||
|
|
||||||
|
|
||||||
@@ -143,21 +147,37 @@ m4_popdef([AT_LALR1_CC_IF])
|
|||||||
## Generating Grammar Files. ##
|
## Generating Grammar Files. ##
|
||||||
## -------------------------- ##
|
## -------------------------- ##
|
||||||
|
|
||||||
|
# AT_DATA_SOURCE_PROLOGUE
|
||||||
|
# ------------------------
|
||||||
|
# The prologue that should be included in any source code that is
|
||||||
|
# meant to be compiled.
|
||||||
|
m4_define([AT_DATA_SOURCE_PROLOGUE],
|
||||||
|
[[#include <config.h>
|
||||||
|
/* We don't need perfect functions for these tests. */
|
||||||
|
#undef malloc
|
||||||
|
#undef memcmp
|
||||||
|
#undef realloc
|
||||||
|
]])
|
||||||
|
|
||||||
# AT_DATA_GRAMMAR_PROLOGUE
|
# AT_DATA_GRAMMAR_PROLOGUE
|
||||||
# ------------------------
|
# ------------------------
|
||||||
# The prologue that should be included in any grammar which parser is
|
# The prologue that should be included in any grammar which parser is
|
||||||
# meant to be compiled.
|
# meant to be compiled.
|
||||||
m4_define([AT_DATA_GRAMMAR_PROLOGUE],
|
m4_define([AT_DATA_GRAMMAR_PROLOGUE],
|
||||||
[[%{
|
[[%code top {
|
||||||
#include <config.h>
|
]AT_DATA_SOURCE_PROLOGUE[]dnl
|
||||||
/* We don't need perfect functions for these tests. */
|
[}
|
||||||
#undef malloc
|
]])
|
||||||
#undef memcmp
|
|
||||||
#undef realloc
|
|
||||||
%}]
|
|
||||||
])
|
|
||||||
|
|
||||||
|
# AT_DATA_SOURCE(NAME, CONTENT)
|
||||||
|
# -----------------------------
|
||||||
|
# Generate the file NAME, which CONTENT is preceded by
|
||||||
|
# AT_DATA_SOURCE_PROLOGUE.
|
||||||
|
m4_define([AT_DATA_SOURCE],
|
||||||
|
[AT_DATA([$1],
|
||||||
|
[AT_DATA_SOURCE_PROLOGUE
|
||||||
|
$2])
|
||||||
|
])
|
||||||
|
|
||||||
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
@@ -268,6 +288,20 @@ AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1
|
|||||||
0, [ignore], [ignore])])
|
0, [ignore], [ignore])])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_FULL_COMPILE(OUTPUT, [OTHER])
|
||||||
|
# --------------------------------
|
||||||
|
# Compile OUTPUT.y to OUTPUT.c or OUTPUT.cc, and compile it to OUTPUT.
|
||||||
|
# If OTHER is specified, compile OUTPUT-OTHER.c or OUTPUT-OTHER.cc to OUTPUT
|
||||||
|
# along with it.
|
||||||
|
# Relies on AT_SKEL_CC_IF.
|
||||||
|
m4_define([AT_FULL_COMPILE],
|
||||||
|
[AT_SKEL_CC_IF(
|
||||||
|
[AT_BISON_CHECK([-o $1.cc $1.y])
|
||||||
|
AT_COMPILE_CXX([$1]m4_ifval($2, [, [$1.cc $1-$2.cc]]))],
|
||||||
|
[AT_BISON_CHECK([-o $1.c $1.y])
|
||||||
|
AT_COMPILE([$1]m4_ifval($2, [, [$1.c $1-$2.c]]))])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## ---------------------------- ##
|
## ---------------------------- ##
|
||||||
## Running a generated parser. ##
|
## Running a generated parser. ##
|
||||||
|
|||||||
+21
-8
@@ -23,9 +23,11 @@ AT_BANNER([[Output file names.]])
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
m4_define([AT_CHECK_OUTPUT],
|
m4_define([AT_CHECK_OUTPUT],
|
||||||
[AT_SETUP([[Output files: $2 $3 $5]])
|
[AT_SETUP([[Output files: $2 $3 $5]])
|
||||||
case "$1" in
|
for file in $1 $4; do
|
||||||
*/*) mkdir `echo "$1" | sed 's,/.*,,'`;;
|
case "$file" in
|
||||||
esac
|
*/*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
AT_DATA([$1],
|
AT_DATA([$1],
|
||||||
[[$2
|
[[$2
|
||||||
%%
|
%%
|
||||||
@@ -116,9 +118,15 @@ AT_CHECK_OUTPUT([subdir/foo.yy], [%skeleton "lalr1.cc" %defines %verbose],
|
|||||||
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
|
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
|
||||||
[], [AT_CHECK_NO_SUBDIR_PART([subdir/foo])])
|
[], [AT_CHECK_NO_SUBDIR_PART([subdir/foo])])
|
||||||
|
|
||||||
|
AT_CHECK_OUTPUT([gram_dir/foo.yy],
|
||||||
|
[%skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"],
|
||||||
|
[],
|
||||||
|
[output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh])
|
||||||
|
|
||||||
# AT_CHECK_CONFLICTING_OUTPUT(INPUT-FILE, DIRECTIVES, FLAGS, STDERR)
|
|
||||||
# -----------------------------------------------------------------------------
|
# AT_CHECK_CONFLICTING_OUTPUT(INPUT-FILE, DIRECTIVES, FLAGS, STDERR,
|
||||||
|
# [EXIT-STATUS])
|
||||||
|
# ------------------------------------------------------------------
|
||||||
m4_define([AT_CHECK_CONFLICTING_OUTPUT],
|
m4_define([AT_CHECK_CONFLICTING_OUTPUT],
|
||||||
[AT_SETUP([Conflicting output files: $2 $3])
|
[AT_SETUP([Conflicting output files: $2 $3])
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -130,7 +138,7 @@ AT_DATA([$1],
|
|||||||
foo: {};
|
foo: {};
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([$3 $1], 0, [], [$4])
|
AT_BISON_CHECK([$3 $1], $5, [], [$4])
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -149,6 +157,10 @@ AT_CHECK_CONFLICTING_OUTPUT([foo.y],
|
|||||||
[foo.y: warning: conflicting outputs to file `location.hh'
|
[foo.y: warning: conflicting outputs to file `location.hh'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AT_CHECK_CONFLICTING_OUTPUT([foo.y], [], [-o foo.y],
|
||||||
|
[foo.y: fatal error: refusing to overwrite the input file `foo.y'
|
||||||
|
], 1)
|
||||||
|
|
||||||
|
|
||||||
# AT_CHECK_OUTPUT_FILE_NAME(FILE-NAME-PREFIX, [ADDITIONAL-TESTS])
|
# AT_CHECK_OUTPUT_FILE_NAME(FILE-NAME-PREFIX, [ADDITIONAL-TESTS])
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@@ -188,9 +200,10 @@ AT_CLEANUP
|
|||||||
AT_CHECK_OUTPUT_FILE_NAME([[`~!@#$%^&*()-=_+{}[]|\:;<>, .']])
|
AT_CHECK_OUTPUT_FILE_NAME([[`~!@#$%^&*()-=_+{}[]|\:;<>, .']])
|
||||||
dnl Work around a bug in m4_expand that broke AT_SETUP in autoconf 2.62,
|
dnl Work around a bug in m4_expand that broke AT_SETUP in autoconf 2.62,
|
||||||
dnl by using the definition from 2.63.
|
dnl by using the definition from 2.63.
|
||||||
m4_define([m4_expand], [_$0(-=<{($1)}>=-)])
|
m4_version_prereq([2.63], [],
|
||||||
|
[m4_define([m4_expand], [_$0(-=<{($1)}>=-)])
|
||||||
m4_define([_m4_expand],
|
m4_define([_m4_expand],
|
||||||
[m4_changequote([-=<{(], [)}>=-])$1m4_changequote([, ])])
|
[m4_changequote([-=<{(], [)}>=-])$1m4_changequote([, ])])])
|
||||||
AT_CHECK_OUTPUT_FILE_NAME([[(]])
|
AT_CHECK_OUTPUT_FILE_NAME([[(]])
|
||||||
AT_CHECK_OUTPUT_FILE_NAME([[)]])
|
AT_CHECK_OUTPUT_FILE_NAME([[)]])
|
||||||
AT_CHECK_OUTPUT_FILE_NAME([[#]])
|
AT_CHECK_OUTPUT_FILE_NAME([[#]])
|
||||||
|
|||||||
+9
-5
@@ -1,5 +1,5 @@
|
|||||||
# Exercising Bison Grammar Reduction. -*- Autotest -*-
|
# Exercising Bison Grammar Reduction. -*- Autotest -*-
|
||||||
# Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -142,7 +142,8 @@ useless9: '9';
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 0, [],
|
AT_BISON_CHECK([[input.y]], 0, [],
|
||||||
[[input.y: warning: 9 nonterminals and 9 rules useless in grammar
|
[[input.y: warning: 9 nonterminals useless in grammar
|
||||||
|
input.y: warning: 9 rules useless in grammar
|
||||||
input.y:6.1-8: warning: nonterminal useless in grammar: useless1
|
input.y:6.1-8: warning: nonterminal useless in grammar: useless1
|
||||||
input.y:7.1-8: warning: nonterminal useless in grammar: useless2
|
input.y:7.1-8: warning: nonterminal useless in grammar: useless2
|
||||||
input.y:8.1-8: warning: nonterminal useless in grammar: useless3
|
input.y:8.1-8: warning: nonterminal useless in grammar: useless3
|
||||||
@@ -237,7 +238,8 @@ non_productive: non_productive useless_token
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[not-reduced.y]], 0, [],
|
AT_BISON_CHECK([[not-reduced.y]], 0, [],
|
||||||
[[not-reduced.y: warning: 2 nonterminals and 3 rules useless in grammar
|
[[not-reduced.y: warning: 2 nonterminals useless in grammar
|
||||||
|
not-reduced.y: warning: 3 rules useless in grammar
|
||||||
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
|
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
|
||||||
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
|
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
|
||||||
not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
|
not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
|
||||||
@@ -311,7 +313,8 @@ indirection: underivable;
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 0, [],
|
AT_BISON_CHECK([[input.y]], 0, [],
|
||||||
[[input.y: warning: 2 nonterminals and 3 rules useless in grammar
|
[[input.y: warning: 2 nonterminals useless in grammar
|
||||||
|
input.y: warning: 3 rules useless in grammar
|
||||||
input.y:5.15-25: warning: nonterminal useless in grammar: underivable
|
input.y:5.15-25: warning: nonterminal useless in grammar: underivable
|
||||||
input.y:6.14-24: warning: nonterminal useless in grammar: indirection
|
input.y:6.14-24: warning: nonterminal useless in grammar: indirection
|
||||||
input.y:5.15-25: warning: rule useless in grammar: exp: underivable
|
input.y:5.15-25: warning: rule useless in grammar: exp: underivable
|
||||||
@@ -346,7 +349,8 @@ exp: exp;
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 1, [],
|
AT_BISON_CHECK([[input.y]], 1, [],
|
||||||
[[input.y: warning: 2 nonterminals and 2 rules useless in grammar
|
[[input.y: warning: 2 nonterminals useless in grammar
|
||||||
|
input.y: warning: 2 rules useless in grammar
|
||||||
input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
|
input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|||||||
+25
-1
@@ -1201,7 +1201,7 @@ AT_CLEANUP
|
|||||||
## Token number in precedence declaration. ##
|
## Token number in precedence declaration. ##
|
||||||
## ---------------------------------------- ##
|
## ---------------------------------------- ##
|
||||||
|
|
||||||
AT_SETUP([[Token number in precedence declaration.]])
|
AT_SETUP([[Token number in precedence declaration]])
|
||||||
|
|
||||||
# POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
|
# POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
|
||||||
# we lost this in Bison 1.50.
|
# we lost this in Bison 1.50.
|
||||||
@@ -1255,3 +1255,27 @@ AT_COMPILE([[input]])
|
|||||||
AT_PARSER_CHECK([[./input]])
|
AT_PARSER_CHECK([[./input]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## ----------------------------------------------- ##
|
||||||
|
## Fix user actions without a trailing semicolon. ##
|
||||||
|
## ----------------------------------------------- ##
|
||||||
|
|
||||||
|
AT_SETUP([[Fix user actions without a trailing semicolon]])
|
||||||
|
|
||||||
|
# This feature is undocumented, but we accidentally broke it in 2.3a, and there
|
||||||
|
# was a complaint at:
|
||||||
|
# <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
|
||||||
|
|
||||||
|
AT_DATA([input.y],
|
||||||
|
[[%%
|
||||||
|
start: {asdffdsa} ;
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_BISON_CHECK([[-o input.c input.y]])
|
||||||
|
AT_CHECK([[sed -n '/asdffdsa/s/^ *//p' input.c]], [[0]],
|
||||||
|
[[{asdffdsa;}
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|||||||
Reference in New Issue
Block a user