Commit Graph

4446 Commits

Author SHA1 Message Date
Akim Demaille
c93f22fcf7 doc: use only @example, not @smallexample.
* doc/bison.texinfo: Convert all @smallexamples into @examples.
Adjust layout where needed.
2012-03-19 10:43:53 +01:00
Akim Demaille
aaaa2aaef4 doc: style changes.
* doc/bison.texinfo: Avoid line width issues with TeX.
Upgrade ancient messages.
Move some comments to better looking places.
Add more @group.
(Mfcalc Symbol Table): Reduce variable scopes.
Prefer size_t for sizes.
Prefer declarations with an initial value.
Fix a @group environment.
2012-03-19 10:36:22 +01:00
Akim Demaille
1e5d654019 c.m4: better newline control with b4_parse_param_use.
* data/c.m4: Use m4_ifvaln instead of m4_ifval where
applicable.
(b4_parse_param_use): Switch order between two nested
"if"s to avoid useless empty lines.
Adjust callers to avoid useless lines.
2012-03-19 10:05:15 +01:00
Akim Demaille
fc25770394 glr.c: remove (broken) support for YYPRINT.
YYPRINT uses yytoknum which glr does not define.  Since YYPRINT
is considered obsolete, and did not work, don't fix its support,
remove it from glr.c.

* data/c.m4 (yy_symbol_value_print): Use YYPRINT only for yacc.c.
* TODO: Done.
2012-03-19 10:05:14 +01:00
Paul Eggert
35880c82dc doc: minor fixes to "Understanding" section
* doc/bison.texinfo (Understanding): Minor wording fixes and
improvements.  Fixes problems reported in
<https://savannah.gnu.org/patch/?4306>.
2012-03-17 12:53:16 -07:00
Akim Demaille
67218723a0 TODO: update. 2012-03-15 13:56:07 +01:00
Akim Demaille
260cee2ded gnulib: update. 2012-03-15 13:47:19 +01:00
Akim Demaille
05061eca7c tests: minor fixes/simplifications
* tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs,
quotation, and default value assignments.
Ensure a proper value to the numeric variables.
Reported by Lie Yan.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html
2012-03-13 12:01:45 +01:00
Akim Demaille
fca5693b76 maint: fix distcheck.
* examples/local.mk (MAINTAINERCLEANFILES): Complete, and rename as...
(CLEANFILES): this,
* examples/calc++/local.mk, examples/mfcalc/local.mk,
* examples/rpcalc/local.mk (CLEANFILES): Add the generated files.
2012-03-13 11:58:46 +01:00
Akim Demaille
dd31e17d7e tests: minor fixes/simplifications
* tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs,
quotation, and default value assignments.
Ensure a proper value to the numeric variables.
Reported by Lie Yan.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html
2012-03-13 10:19:14 +01:00
Akim Demaille
16d94f45c9 tests: be robust to POSIXLY_CORRECT being defined.
* tests/local.at (AT_BISON_CHECK_NO_XML): Check if
POSIXLY_CORRECT is defined, not if it is defined to 1.
Reported by Lie Yan.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html
2012-03-09 08:41:32 +01:00
Akim Demaille
06e0e52ca4 tests: be robust to quote style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.

	* src/main.c (main): Define the quoting style we use.
	* tests/atlocal.in: Use ASCII style quotes during the tests.
(cherry picked from commit 39ac121457)
2012-03-09 08:28:31 +01:00
Akim Demaille
f0f62c8c4d maint: update gnulib.
* gnulib: update.
	* src/scan-gram.l: Don't use the (former version of) STREQ.
2012-03-09 08:28:31 +01:00
Akim Demaille
a17187e563 tests: remove quote magic from the bison test wrapper.
Basically, revert 4c4d35394d.

	* tests/bison.in: Leave bison's stderr as is.
2012-03-09 08:04:31 +01:00
Akim Demaille
39ac121457 tests: be robust to quote style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.

	* src/main.c (main): Define the quoting style we use.
	* tests/atlocal.in: Use ASCII style quotes during the tests.
2012-03-09 08:04:31 +01:00
Akim Demaille
4663cb4d0c avoid direct strncmp calls.
Before this change, bison would accept either .tab and _tab equivalently,
whatever the current platform.  Besides, it was not obeying everywhere
to the possible definition of TAB_EXT to something else than .tab.

For consistency, handle only TAB_EXT (".tab" on non DJGPP platforms).
Support for "_tab" is neither documented, nor tested.

	* src/system.h (STRNCMP_LIT): New.
	From Jim Meyering.
	(STRPREFIX_LIT): New.
	* src/files.c, src/getargs.c: Use it.
2012-03-09 07:33:23 +01:00
Akim Demaille
c14ceb55b9 tests: be robust to POSIXLY_CORRECT being defined.
* tests/local.at (AT_BISON_CHECK_NO_XML): Check if
POSIXLY_CORRECT is defined, not if it is defined to 1.
Reported by Lie Yan.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html
2012-03-06 09:16:38 +01:00
Akim Demaille
2a55930762 build: comment changes.
* Makefile.am, examples/calc++/local.mk, examples/local.mk,
	* examples/mfcalc/local.mk, examples/rpcalc/local.mk,
	* lib/local.mk, src/local.mk, tests/local.mk:
	Make the copyright licenses more uniform.
2012-02-24 14:01:13 +01:00
Akim Demaille
59fba180a5 build: fix more example extraction issues.
* Makefile.am (dist_TESTS): New.
	(TESTS, EXTRA_DIST): Run and ship them.
	* examples/calc++/local.mk: examples/calc++/calc++.stamp no longer
        exists, don't try to ship it.
	(.yy.stamp): New recipe.
	Use it.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/rpcalc/local.mk:
	Don't ship the sources.
	Adjust the CPPFLAGS: there is nothing left in srcdir.
	(MAINTAINERCLEANFILES): Remove, now we are in builddir.
	(TESTS): Rename as...
	(dist_TESTS): this.
2012-02-24 13:32:17 +01:00
Akim Demaille
2191bb749b maint: fix example extraction issues.
calc++: don't rely on Automake to compile a C++ parser.

Basically, revert commit 609b3d8096,
Automake 1.11.3 is not safe enough for C++ parser.

	* examples/calc++/calc++-parser.hh: Remove.
	* examples/calc++/local.mk (examples/calc++/calc++-parser.stamp):
	New.

examples: factor the extractions into a single step

extexi had to be run in the extraction directory.  Now, it can be
given the files with expected output directory.  This allows to
use $(*_extracted) variables (before we had to list again their
members, but limited to their base names).  In turn, this also
allows fusing the extraction recipes into a single one.

Also, it is currently too hard (or requires too much duplication,
since Make wants all the occurrences of the files to be prefixed with
$(srcdir)/, which is something Automake cannot support for *_SOURCES)
to work in the source tree.  So extract, and compile scanners and parsers
in the build tree.

	* examples/extexi (basename): New.
	(BEGIN): Now "file_wanted" maps base name to extracted file name.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/rpcalc/local.mk: Fuse extraction rules into...
	* examples/local.mk: Here.
	(extract, extracted): New.
2012-02-24 11:04:45 +01:00
Akim Demaille
f518dbaf46 maint: use STREQ/STRNEQ.
* doc/bison.texinfo: Space change.
	* src/system.h (STREQ, STRNEQ): New.
	* src/files.c, src/ielr.c, src/lalr.c, src/muscle-tab.c,
	* src/output.c, src/print.c, src/print_graph.c,
	* src/reader.c, src/scan-skel.l, src/tables.c,
	* src/uniqstr.c:
	Use them.
	* src/scan-gram.l: Do not use streq.h, use system.h's STREQ.
	* cfg.mk: The documentation is an exception.
2012-02-23 19:13:45 +01:00
Akim Demaille
ab8932bfd9 doc: fix environment issues.
* doc/bison.texinfo: Do not use @verbatim, in particular when
	we use @group inside.
	Use @quotation instead of @display for frequently asked questions,
	it looks much nicer.
(cherry picked from commit 71b52b1342)

Conflicts:

	doc/bison.texinfo
2012-02-23 17:57:31 +01:00
Akim Demaille
71b52b1342 doc: fix environment issues.
* doc/bison.texinfo: Do not use @verbatim, in particular when
	we use @group inside.
	Use @quotation instead of @display for frequently asked questions,
	it looks much nicer.
2012-02-23 17:53:08 +01:00
Akim Demaille
6c6f6f4b23 regen.
* src/parse-gram.h, src/parse-gram.c: regen.
2012-02-23 16:10:12 +01:00
Akim Demaille
da209f943b tests: fix regressions.
Exit status 63 is documented for version-mismatch.
	* bootstrap.conf (gnulib_modules): Remove sysexits.
	* src/system.h (EX_MISMATCH): Define.
	* src/parse-gram.y (version_check): Use it instead of EX_CONFIG.

Missing includes.
	* tests/calc.at, tests/named-refs.at: Include assert.h.
(cherry picked from commit 459a57a90f)
2012-02-23 16:10:08 +01:00
Akim Demaille
baf22389ef maint: gitignore.
* examples/mfcalc/.gitignore, examples/rpcalc/.gitignore: Fix.
2012-02-22 14:55:32 +01:00
Akim Demaille
6f8f253b15 regen.
* src/parse-gram.c, src/parse-gram.h: regen.
2012-02-21 16:32:01 +01:00
Akim Demaille
459a57a90f tests: fix regressions.
Exit status 63 is documented for version-mismatch.
	* bootstrap.conf (gnulib_modules): Remove sysexits.
	* src/system.h (EX_MISMATCH): Define.
	* src/parse-gram.y (version_check): Use it instead of EX_CONFIG.

Missing includes.
	* tests/calc.at, tests/named-refs.at: Include assert.h.
2012-02-21 15:42:13 +01:00
Akim Demaille
4c4d35394d tests: post-process stderr to normalize quotes.
* tests/bison.in: Save bison's stderr, and convert gettextized
	quotes to plain ASCII.
2012-02-21 15:42:13 +01:00
Akim Demaille
71cbc1ac1a glr: fix ambiguity reports.
* tests/glr-regression.at (Ambiguity reports): New.
(cherry picked from commit a6b2f4fc02)
2012-02-21 14:44:15 +01:00
Akim Demaille
a6b2f4fc02 glr: fix ambiguity reports.
Fix a regression introduced in commit
783aa653f4.

	* tests/glr-regression.at (Ambiguity reports): New.
	* data/glr.c (yyreportTree): Fix an offset error.
2012-02-21 14:41:31 +01:00
Akim Demaille
98842516e1 doc: stylistic improvements.
* doc/bison.texinfo: Prefer "continue" to empty loop bodies.
	Add some @group/@end group to avoid poor page breaks.
(cherry picked from commit d4fca42763)

Conflicts:

	doc/bison.texinfo
2012-02-19 18:29:05 +01:00
Akim Demaille
14f4455e43 maint: address sc_prohibit_doubled_word.
* data/yacc.c, doc/bison.texinfo: Reword to avoid having to
	disable that check.
	* cfg.mk: No longer skip this test.
(cherry picked from commit 762caaf639)

Conflicts:

	data/yacc.c
2012-02-19 18:26:01 +01:00
Akim Demaille
43e9e2a113 maint: address sc_prohibit_always-defined_macros.
* cfg.mk: No longer skip it, except where EXIT_SUCCESS is used
	as a witness for stdlib.h.
	Skip this test when appropriate.
	* data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here.

Conflicts:

	cfg.mk
2012-02-19 18:25:24 +01:00
Akim Demaille
a055b2f07d maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC.
* bootstrap.conf (gnulib_modules): Require progname.
	* src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it.
	* cfg.mk (exclude): New.
	Use it.
	Skip lib/main.c for bindtextdomain and set_program_name.
(cherry picked from commit 4d699f44e6)

Conflicts:

	cfg.mk
2012-02-19 18:24:17 +01:00
Akim Demaille
95f14eb228 maint: remove stray file.
* config.hin: Remove.
(cherry picked from commit 222342aa67)
2012-02-19 18:21:56 +01:00
Akim Demaille
d4fca42763 doc: stylistic improvements.
* doc/bison.texinfo: Prefer "continue" to empty loop bodies.
	Add some @group/@end group to avoid poor page breaks.
2012-02-19 18:17:19 +01:00
Akim Demaille
24ec083743 doc: check the rpcalc.
* doc/bison.texinfo: Tag rpcalc.y snippets.
	Add missing includes.
	(Rpcalc Rules): Don't issue leading tabs.
	Complete an Info menu.
	Use @result.
	* examples/rpcalc/local.mk: New.
	* examples/rpcalc/rpcalc.test: New.
	* examples/local.mk: Use them.
	* examples/mfcalc/mfcalc.test: Remove dup test.
	* examples/test: Disable debug traces.
2012-02-19 13:16:15 +01:00
Akim Demaille
e7b94cc360 regen.
* src/parse-gram.c, src/parse-gram.h: Regen.
2012-02-19 12:56:14 +01:00
Akim Demaille
762caaf639 maint: address sc_prohibit_doubled_word.
* data/yacc.c, doc/bison.texinfo: Reword to avoid having to
	disable that check.
	* cfg.mk: No longer skip this test.
2012-02-19 12:54:09 +01:00
Akim Demaille
db3458d6ea maint: address sc_prohibit_always-defined_macros.
* cfg.mk: No longer skip it, except where EXIT_SUCCESS is used
	as a witness for stdlib.h.
	Skip this test when appropriate.
	* data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here.
2012-02-19 12:54:06 +01:00
Akim Demaille
4d699f44e6 maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC.
* bootstrap.conf (gnulib_modules): Require progname.
	* src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it.
	* cfg.mk (exclude): New.
	Use it.
	Skip lib/main.c for bindtextdomain and set_program_name.
2012-02-19 12:31:10 +01:00
Akim Demaille
222342aa67 maint: remove stray file.
* config.hin: Remove.
2012-02-19 12:30:52 +01:00
Akim Demaille
a7497ca6b6 bitset: fix an incorrect error message.
* lib/bitset_stats.c: here.
	Reported by Stefano Lattarini.
2012-02-19 10:31:20 +01:00
Akim Demaille
e0e2b93355 maint: address some syntax-issues remaining after cherry-picking from master.
* cfg.mk: Skip bison generated files, 2.5 is generating trailing
	blanks.  This is already fixed in master.
	* tests/conflicts.at, tests/java.at: Fix white space issues.
2012-02-19 10:29:24 +01:00
Akim Demaille
f95faa25ae regen.
* src/parse-gram.c, src/parse-gram.h: Regen.
2012-02-19 10:22:51 +01:00
Akim Demaille
bd65f25570 bitset: fix an incorrect error message.
* lib/bitset_stats.c: here.
	Reported by Stefano Lattarini.
2012-02-19 10:21:32 +01:00
Jim Meyering
7880130e3e maint: reenable sc_m4_quote_check
* cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check.
* m4/dmalloc.m4: Add quotes.

Conflicts:

	cfg.mk
2012-02-19 10:21:32 +01:00
Akim Demaille
fe40b679d7 maint: remove trailing empty lines.
* cfg.mk: No longer skip sc_prohibit_empty_lines_at_EOF, except
	for parse-gram.h (generated).
	* examples/mfcalc/.gitignore, lib/.gitignore, m4/.gitignore,
	* po/.gitignore, runtime-po/.gitignore: Remove trailing/leading
	empty lines.

Conflicts:

	examples/mfcalc/.gitignore
2012-02-19 10:21:29 +01:00
Akim Demaille
dd5611579b maint: avoid "magic number exit".
* cfg.mk (local-checks-to-skip): No longer skip it.
	* bootstrap.conf (gnulib_modules): Add sysexits.
	* doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y,
	* src/system.h, tests/calc.at, tests/named-refs.at: Use assert
	where appropriate instead of "if (...) exit".
	Use symbolic exit status elsewhere.

Conflicts:

	doc/bison.texinfo
	src/parse-gram.y
2012-02-19 10:21:06 +01:00