Commit Graph

2125 Commits

Author SHA1 Message Date
Akim Demaille
72e727f2ec Formatting change. 2009-04-20 23:52:25 +02:00
Akim Demaille
90462b8dd9 bison: factoring.
* src/output.c (token_definitions_output): Use symbol_id_get
	instead of duplicating its logic.
	* TODO (YYERRCODE): Extend.
2009-04-20 23:52:15 +02:00
Akim Demaille
71b00ed874 variables: prefer error-verbose to error_verbose.
* data/bison.m4 (b4_error_verbose_if): Based on error-verbose
	instead of error_verbose.
	* src/scan-gram.l (%error-verbose): Map the error-verbose
	variable.
	* doc/bison.texinfo: Promote %define error-verbose instead of
	%error-verbose.
	* tests/actions.at: Prefer %define error-verbose to %error-verbose.
2009-04-20 23:17:54 +02:00
Akim Demaille
4f646c3794 variables: accept dashes.
* data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
	underscores.
	* src/scan-gram.l ({id}): Also accept dashes after the initial
	letter.
	({directive}): Use {id}.
	* src/parse-gram.y: Comment and formatting changes.
	* doc/bison.texinfo (Symbols): Adjust the lexical definitions of
	symbols.
	* src/complain.h, src/complain.c (yacc_at): New.
	* src/symtab.c (symbol_new): Use yacc_at to report inappropriate
	symbol names.
	* src/output.c (token_definitions_output): Do not #define token
	names with dashes.
2009-04-20 23:17:51 +02:00
Akim Demaille
184e317956 Consistently refer to Yacc, not YACC.
* src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2009-04-20 13:23:49 +02:00
Joel E. Denny
41253c3a9d Pacify make maintainer-check-posix.
* tests/input.at (%define, --define): Move bison command-line
options before grammar file name.
2009-04-17 16:14:17 -04:00
Joel E. Denny
197b82ba54 Document semicolon warnings.
* NEWS (2.5): Here.
(cherry picked from commit a2d0567444)
2009-04-17 00:25:13 -04:00
Akim Demaille
16dc0d9025 Fix ChangeLog. 2009-04-14 08:18:24 +02:00
Akim Demaille
0c90a1f5e9 variables: use parse.assert' instead of assert'.
* TODO (assert): Remove.
	* data/bison.m4 (b4_assert_if): Replace with...
	(b4_parse_assert_if): this.
	* data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
	* doc/bison.texinfo (Decl Summary): Document parse.assert.
2009-04-14 08:11:19 +02:00
Akim Demaille
fa81950916 variables: use parse.assert' instead of debug'.
* src/getargs.c (getargs): Map -t to %define trace.parse.
	* src/scan-gram.l (%debug): Map to %define trace.parse.
	* data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
	names to `_' in macro names.
	(b4_debug_if): Replace with...
	(b4_parse_trace_if): this.
	* data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
	* data/yacc.c: Adjust.
	* doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
	Use @code to label the variable list.
	Document the variable parse.trace.
	(Tracing): Promote the parse.trace variable.
	* TODO: %printer is not documented.
2009-04-14 08:11:16 +02:00
Akim Demaille
f7dae1ea51 doc: minor fixes.
* doc/bison.texinfo (Decl Summary): Fix entry about %debug.
	(Table of Symbols): Remove duplicate entry for %debug.
2009-04-14 08:11:11 +02:00
Eric Blake
3535c0714e submodules: update to latest
* submodules/autoconf: Use latest upstream Autoconf.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 7ba0d59da0)
2009-04-10 07:37:47 -06:00
Eric Blake
cf48f6755c Work around autoconf 2.63b bug in testsuite.
* tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
autoconf bug related to # in test.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit ab3a683f05)
2009-04-10 07:15:43 -06:00
Joel E. Denny
50cca36825 * NEWS (2.5): New section. Describe new -D/--define feature. 2009-04-06 17:36:08 -04:00
Akim Demaille
3583d96b77 Regen.
* src/parse-gram.h, src/parse-gram.c: Regen.
2009-04-06 13:24:58 +02:00
Akim Demaille
00f5d57533 rename muscle_tab.* as muscle-tab.* for consistency.
* src/muscle_tab.h, src/muscle_tab.c: Rename as...
	* src/muscle-tab.h, src/muscle-tab.c: these.
	* src/getargs.c, src/local.mk, src/main.c, src/output.c,
	* src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2009-04-06 13:24:54 +02:00
Akim Demaille
76bf510242 Makefile: introduce $(BISON).
* src/local.mk (BISON): New.
	(YACC): Use it.
2009-04-06 13:24:50 +02:00
Akim Demaille
bc0f573730 parser: handle %locations as %define locations.
* src/getargs.h, src/getargs.c (locations_flag): Remove.
	* src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
	to set "locations" to true.
	* src/output.c (prepare): Don't output "locations".
	* src/scan-gram.l (%locations): Handle it as a %<flag>.
	* src/parse-gram.y: It's no longer a token.
	Don't handle it.
	* data/bison.m4 (b4_locations_if): Define it with
	b4_percent_define_if_define.
	* data/c.m4, data/glr.cc: Adjust.
2009-04-06 13:24:47 +02:00
Akim Demaille
697c912fa4 Regen.
* src/parse-gram.c: Regen.
2009-04-06 13:24:43 +02:00
Akim Demaille
4920ae8b66 muscle: factor the handling of obsolete of obsolete directives.
Suggested by Joel E. Denny.

	* src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
	New, extracted from...
	* src/parse-gram.y (prologue_declaration: pure-parser): here.
	Remove it.
	(prologue_declaration: "%<flag>"): Use
	muscle_percent_define_ensure.
	(%error-verbose, %pure-parser): No longer tokens.
	* src/scan-gram.l (pure-parser): Return as a %<flag>.
2009-04-06 13:24:32 +02:00
Joel E. Denny
1d5b3c08fe Fix options documentation.
* build-aux/cross-options.pl: As in --help output, write optional
arguments as [=ARG] not =[ARG].
* doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2009-04-06 02:56:13 -04:00
Joel E. Denny
62c99cf4ea Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
If the first m4 in $PATH is wrong, it keeps looking.  Moreover, its
requirements for a correct m4 are stricter.
* m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
* configure.ac: Update to use AC_PROG_GNU_M4.
Reported by Eric Blake.
2009-04-04 20:58:46 -04:00
Joel E. Denny
1c93f35bfa Help with updating web manual.
* HACKING: Incorporate instructions from gnulib/doc/README.
* bootstrap.conf (gnulib_modules): Add gendocs.
2009-04-03 18:54:41 -04:00
Akim Demaille
86cfae0a48 Regen.
* src/parse-gram.h, src/parse-gram.c: Regen.
2009-04-03 10:34:15 +02:00
Akim Demaille
ba061fa6f2 Factor %FLAG at scan level.
* src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
	definitions and associated rules, replaced by....
	(PERCENT_FLAG): this new token type, and rule.
	* src/scan-gram.l (RETURN_PERCENT_FLAG): New.
	Use it for %debug and %error-verbose.
2009-04-03 10:32:10 +02:00
Akim Demaille
b19ebeb335 Regen.
* src/parse-gram.h, src/parse-gram.c: Regen.
2009-04-03 10:31:42 +02:00
Akim Demaille
001a16a9cd Update ChangeLog. 2009-04-03 10:30:30 +02:00
Joel E. Denny
92822affc5 Fix strange %define locations for default values.
Reported by Akim Demaille at
<http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
and discussed again starting at
<http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
* data/bison.m4 (b4_percent_define_default): Leave syncline blank
because location information is bogus.
Use angle brackets to delimit fake file name because square brackets
look like over-quoted m4.  Choose a better fake file name.
Use negative line numbers.
* src/muscle_tab.c (muscle_percent_define_default): Likewise.
* src/location.c (location_print): If line for a boundary is negative,
only print that boundary's file name.
* src/location.h: Document that.
* tests/skeletons.at (%define Boolean variables: invalid skeleton
defaults): Update output.
2009-04-03 03:55:08 -04:00
Joel E. Denny
e021191bcf Pacify ./configure --enable-gcc-warnings.
* Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
in lib won't compile with it.
* src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2009-04-03 00:32:27 -04:00
Akim Demaille
78f654185a bootstrap: --help to stdout.
* bootstrap (usage): Don't send --help to stderr.
	Use a here doc instead of a long string.
2009-03-31 11:11:26 +02:00
Akim Demaille
f7e241f4af bootstrap: README-hacking no longer exists
* bootstrap (checkout_only_file): Set to HACKING.
2009-03-31 11:11:16 +02:00
Akim Demaille
1f9d82480e ChangeLog: formatting changes. 2009-03-27 07:28:26 +01:00
Akim Demaille
31d3e51094 doc: merge HACKING and README-hacking.
Two files is confusing.
Reported by Alexandre Duret-Lutz.

	* README-hacking: Merge into...
	* HACKING (Working from the repository): here.
2009-03-27 07:27:21 +01:00
Akim Demaille
81535bfa35 doc: update README-hacking.
* README-hacking: We now use git and git submodules.
	Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2009-03-27 07:27:07 +01:00
Akim Demaille
56f772e95e lalr1.cc: avoid GCC 4.3 warnings.
GCC 4.3 now warns about "a || b && c" and asks for explicit
parentheses.
Reported by Alexandre Duret-Lutz.
	* data/location.cc: Update copyright years.
	(Position::operator==): Use parens to make precedence explicit.
	Compare lines and columns first, as they are more likely to be
	different, and they are faster to compare.
2009-03-27 07:26:24 +01:00
Akim Demaille
11c073b7e5 gnulib: update.
* gnulib: Update to latest.
	* src/local.mk (AM_CFLAGS): Move to...
	* Makefile.am: here.
	* etc/prefix-gnulib-mk (prefix_assignment): Also transform
	AM_CFLAGS.
2009-03-27 07:23:53 +01:00
Akim Demaille
91be6b283e Comment changes. 2009-03-02 17:06:55 +01:00
Akim Demaille
cbf25ce74f Share b4_yytranslate_define.
* data/lalr1.cc (b4_yytranslate_define): Move to...
	* data/c++.m4: here.
2009-03-02 16:34:09 +01:00
Akim Demaille
882f02ed83 Use locations in the variant example.
Yes, this obfuscates the point of this example, variants only.  But glr.cc
cannot work (yet?) without locations.  This change makes it easier to use
this example with glr.cc.

	* examples/variant.yy (assert): %define it.
	(locations): Request them.
	(yylex): Bind the location to the stage.
2009-03-02 16:30:57 +01:00
Akim Demaille
0623bacc05 Dub make_TOKEN as a public type interface.
* data/c++.m4 (b4_symbol_constructor_declare)
	(b4_symbol_constructor_define): New empty stubs.
	(b4_public_types_declare, b4_public_types_define): Use them.
	* data/lalr1.cc (b4_symbol_constructor_declare)
	(b4_symbol_constructor_declare_)
	(b4_symbol_constructor_define_, b4_symbol_constructor_define):
	Move to...
	* data/variant.hh: here.
	Remove the "b4_variant_if" parts, as variant.hh is loaded only if
	needed.
	* data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
	b4_symbol_constructor_declare, as it is now done by
	b4_public_types_define and b4_public_types_declare.
2009-03-02 16:27:48 +01:00
Akim Demaille
5f5a90dff6 Coding style changes.
* data/lalr1.cc (b4_symbol_constructor_declaration_)
	(b4_symbol_constructor_declarations)
	(b4_symbol_constructor_definition_)
	(b4_symbol_constructor_definitions)
	(b4_yytranslate_definition): Rename as...
	(b4_symbol_constructor_declare_)
	(b4_symbol_constructor_declare)
	(b4_symbol_constructor_define_)
	(b4_symbol_constructor_define)
	(b4_yytranslate_define): these.
	* data/variant.hh (b4_variant_definition): Rename as...
	(b4_variant_define): this.
2009-03-02 16:24:21 +01:00
Akim Demaille
b47b6ff7fd Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
* data/bison.m4 (b4_percent_define_if_define): New.
	* data/c++.m4 (b4_variant_if): Move to...
	* data/bison.m4: Here, using b4_percent_define_if_define.
	* data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
	* data/bison.m4: Here, using b4_percent_define_if_define.
2009-03-02 16:20:26 +01:00
Akim Demaille
1d6b689b26 Dub symbol_type_base as a public type.
* data/c++.m4 (b4_public_types_declare): Now define
	symbol_type_base and symbol_type.
	(b4_public_types_define): New.
	In both cases, the definitions are taken verbatim from lalr1.cc.
	* data/lalr1.cc: Adjust.
2009-03-02 16:15:28 +01:00
Akim Demaille
4f84717d23 b4_public_types_declare.
* data/c++.m4 (b4_public_types_declare): New.
	* data/glr.cc, data/lalr1.cc: Use it.
2009-03-02 16:12:11 +01:00
Akim Demaille
b9e4eb5b72 b4_semantic_type_declare.
* data/c++.m4 (b4_semantic_type_declare): New.
	Factors and generalizes what was in glr.cc and lalr1.cc.
	* data/variant.hh (b4_semantic_type_declare): Redefine it for
	variants.
	* data/lalr1.cc, data/glr.cc: Use it.
2009-03-02 16:08:07 +01:00
Akim Demaille
6a6e7f0c65 Upgrade gnulib.
* gnulib: Upgrade from master.
	* lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
	Regen.
2009-02-26 00:12:14 +01:00
Akim Demaille
e9e61b0002 Remove useless arguments.
* data/glr.c (yy_reduce_print): $$ and @$ are not used and not
	relevant.
2009-02-25 23:45:46 +01:00
Akim Demaille
3eead995a4 Comment changes.
* data/lalr1.cc: here.
2009-02-25 23:41:40 +01:00
Akim Demaille
87f28efe7e Fix glr.cc's debug level handling.
* data/glr.cc (yydebug_): Remove, as it is actually yydebug from
	glr.c which is used.
	(debug_level, set_debug_level): Adjust.
2009-02-25 23:38:27 +01:00
Akim Demaille
9be2a009c4 Copyright years.
* data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2009-02-25 23:34:45 +01:00