Commit Graph

3956 Commits

Author SHA1 Message Date
Akim Demaille
f9c75dd016 doc: fix mfcalc code.
* doc/bison.texinfo (Multi-function Calc): Add missing includes.
	Fix the rendering of the result: use @result and remove the
	initial tabulation in the actual code.
	Fix stylistic issues: avoid the , operator.
	Add extexi mark-up.
	* examples/extexi: Also support @smallexample.
2012-02-16 15:52:13 +01:00
Akim Demaille
0bb5783b38 tests: c++: stylistic changes.
* tests/c++.at: Don't use void for incoming arguments.
	Prefer cstdlib to stdlib.h.
2012-02-16 15:52:13 +01:00
Jim Meyering
292402a9b2 tests: avoid c++ failure due to lack of getenv decl
* tests/c++.at (Syntax error as exception): Avoid spurious failure
at least when compiling with g++-4.7.x due to lack of declaration
of getenv.  Include <stdlib.h>.
2012-02-16 11:03:31 +01:00
Akim Demaille
3d6ca33908 maint: trust Automake for parser headers.
* examples/calc++/local.mk, src/local.mk: Now that automake
	can see `-d' in AM_YFLAGS, we can rely on it to compile
	and ship the parser header files.
2012-02-15 13:33:42 +01:00
Akim Demaille
737406a32c maint: help Automake reading Yacc flags.
* Makefile.am (AM_YFLAGS): Automake looks for "-d" alone.
2012-02-15 12:55:36 +01:00
Akim Demaille
609b3d8096 calc++: rely on Automake.
Rely on $(YACC) being the bison being built, and let Automake do the
rest.  It turned out to be much more difficult than anticipated, for
various reasons, including some bad behavior from Automake 1.11.2
which (i) generates calc++-parser.h instead of calc++-parser.hh, and
(ii) leaves an #include "y.tab.h" in the generated parser instead
of #include "calc++-parser.h".

The authors of Automake appear to be aware of the problem,
http://lists.gnu.org/archive/html/automake/2011-05/msg00008.html
so a simple work around will suffice for the time being.

	* examples/calc++/y.tab.h, examples/calc++/calc++-parser.hh: New.
	To work around Automake 1.11.2 issues.
	* examples/calc++/local.mk: Remove all the rules for compilation
	with bison, leave them to Automake.
	So provide it with "calc++-parse.yy" as a source file.
	(calc_sources_generated, calc_sources_extracted): Rename as.
	(calc_generated, calc_extracted): these.
	(calc_sources): New.
	Fix them.
2012-02-15 11:31:49 +01:00
Akim Demaille
7726724a70 maint: tidy the Makefile a bit.
* src/local.mk: Put yacc related variables together.
	(AUTOMAKE_OPTIONS): Move to...
	* Makefile.am: here.
	Remove an old Emacs mode request which disables Automake support.
	* src/local.mk (YACC, AM_YFLAGS): Move to...
	* Makefile.am: here, as they will be used by other local.mks.
2012-02-14 21:27:43 +01:00
Akim Demaille
360ae94ebc maint: de-recurse the handling of examples
The directory was still using a local Makefile.am because it provides
"scoped" Make variables: these examples are not meant to use the same
CPPFLAGS etc.  If we were to use the same -I set, we'd pick up
gnulib's stdio.h for instance, which we do not want for these simple
examples.

Yet, as a result, the dependencies are less accurate, there is code
duplication, etc.  This is especially perceptible when trying to
extract more examples from the documentation, as will be done in
forthcoming changes.

In order to make the tuning of CPPFLAGS easier, discard the predefined
-I from Automake.

	* examples/calc++/Makefile.am: Rename as...
	* examples/calc++/local.mk: this.
	Adjust the paths which are now rooted in top_srcdir/top_builddir.
	Handle BISON_CXX_WORKS here, instead of the too crude previous
	approach that completely discarded the whole directory.
	($(BISON)): Remove now useless bouncing recipe.
	(calc___CPPFLAGS): New.
	Stay away from -Ilib.
	* Makefile.am, configure.ac, examples/local.mk,
	* examples/calc++/test: Adjust.

	* configure.ac: Pass nostdinc to Automake.
	* src/local.mk, lib/local.mk (AM_CPPFLAGS): Move to...
	* Makefile.am: here.

	* src/local.mk, examples/calc++/Makefile.am (BISON, BISON_IN): Factor
	to...
	* Makefile.am: here.
	* tests/local.mk: Use it.
2012-02-14 21:00:59 +01:00
Akim Demaille
72c12bfa1b variant: fix the example.
* examples/variant.yy: Adjust to "assert" being now
	"parse.assert".
2012-02-14 20:14:55 +01:00
Akim Demaille
bdf66d1db4 maint: more authors.
* AUTHORS: here.
	Suggested by Tys Lefering.
2012-02-14 20:08:25 +01:00
Akim Demaille
3272a7256f maint: add license headers.
* examples/calc++/test, examples/variant.yy, AUTHORS, THANKS,
	* tests/atlocal.in, tests/bison.in: Add license headers.
	Reported by Tys Lefering.
2012-02-14 20:08:20 +01:00
Akim Demaille
3b4d62d526 maint: remove obsolete file.
* etc/make-ChangeLogs: Remove (used for rcs to cvs migration!).
	Reported by Tys Lefering.
2012-02-14 20:08:11 +01:00
Akim Demaille
a6552c5d2a lalr1.cc: also handle syntax_error when calling yylex.
* data/lalr1.cc (parse): Catch syntax_error around yylex and
	forward them to errlab1.
	* tests/c++.at (Syntax error as exception): Check support for
	syntax exceptions raised by the scanner.
	* NEWS, doc/bison.texinfo: Document it.
2012-02-10 09:17:45 +01:00
Akim Demaille
199a2d6d72 tests: lalr1.cc: check syntax_error.
* tests/c++.at (Syntax error as exception): New.
2012-02-10 09:17:45 +01:00
Akim Demaille
a8c5aaa53e tests: don't require locations uselessly.
* tests/c++.at (Syntax error discarding no lookahead): Contrary to
	2.5, C++ parsers can work without locations.
2012-02-10 09:17:45 +01:00
Akim Demaille
9bfbf75bdf maint: more silent rules.
* tests/local.mk (TESTSUITE_AT): Include plackage.m4.
	Adjust dependencies.
	Make testsuite.at its first argument.
	(package.m4): Be silent.
	(testsuite): Be silent.
	Use $<.
2012-02-10 09:17:45 +01:00
Akim Demaille
beadb220d5 skeletons: simplify the protections against "unused" warnings.
* data/c.m4 (b4_parse_param_use): Also accept optional arguments
	to "use".
	Simplify callers.
	* data/glr.c (yyuserAction): Simplify use of b4_parse_param_use.
	(yy_reduce_print): Don't use b4_parse_param_use, as all the arguments
	_are_ used.
	* data/lalr1.cc (YY_SYMBOL_PRINT): Even when disabled, "use" the
	symbol argument.
	This neutralizes a warning in yypush_ when there are no symbols
	with a semantic values.
	(yy_destroy_): Remove useless "use" of yymsg.
2012-02-10 09:17:44 +01:00
Akim Demaille
f86a780785 glr: formatting changes.
* data/glr.c: Split long strings.
2012-02-10 09:17:38 +01:00
Akim Demaille
4a9cd8f24a use a more consistent quoting style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.
Use quotearg as often as possible instead of leaving the choice of
the quotes to the translators.  Use shorter messages.  Factor similar
messages to a single format, to make localization easier.

	* src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c
	* src/scan-code.l, src/scan-gram.l, src/symtab.c:
	Use quote() or quotearg_colon() on printf arguments instead of
	quotes in the format string.
	* data/bison.m4: Keep sync with the changes in muscle-tab.c.

	* tests/skeletons.at, tests/input.at, tests/regression.at: Adjust
	expected messages.
2012-02-08 11:32:36 +01:00
Jim Meyering
62a87154b3 maint: reenable sc_m4_quote_check
* cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check.
* m4/dmalloc.m4: Add quotes.
2012-01-31 10:22:12 +01:00
Jim Meyering
01d25b42dc maint: force "make syntax-check" to pass by skipping failing tests
* cfg.mk (local-checks-to-skip): Skip all currently-failing tests.
Remove changelog-check; it's long gone.
2012-01-31 10:22:12 +01:00
Akim Demaille
f67c0a1c35 maint: more silent-rules.
* doc/local.mk, src/local.mk, examples/calc++/Makefile.am: Use
	$(AM_V_GEN) and $(AM_V_at) where appropriate.
2012-01-31 09:20:50 +01:00
Jim Meyering
acb5895680 do not ignore errors like ENOSPC,EIO when writing to stdout
Standard output was never explicitly closed, so we could not
detect failure.  Thus, bison would ignore the errors of writing
to a full file system and getting an I/O error on write, but only
for standard output, e.g., for --print-localedir, --print-datadir,
--help and some verbose output.
Now, "bison --print-datadir > /dev/full" reports the write failure:
bison: write error: No space left on device
Before, it would exit 0 with no diagnostic, implying success.
This is not an issue for "--output=-" or the other FILE-accepting
command-line options, because unlike most other GNU programs,
an output file argument of "-" is treated as the literal "./-",
rather than standard output.
* bootstrap.conf (gnulib_modules): Add closeout.
* src/main.c: Include "closeout.h".
Use atexit to ensure we close stdout.
* .gitignore: Ignore new files pulled in via gnulib-tool.
2012-01-29 21:19:20 +01:00
Akim Demaille
888b6ddfe4 tests: fix expected output.
* tests/actions.at (YYBACKUP): here.
2012-01-26 21:52:44 +01:00
Akim Demaille
36021b239d maint: fix configure.ac
Fix commit 1890a2a816.

	* configure.ac: Fix variable assignment.
2012-01-26 21:37:15 +01:00
Akim Demaille
d115aad911 yacc: fix YYBACKUP.
Reported by David Kastrup:
https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html.

	* data/yacc.c (YYBACKUP): Accept rhs size.
	Restore the proper state value.
	* TODO (YYBACKUP): Make it...
	* tests/actions.at: a new test case.
	* NEWS, THANKS: Update.
2012-01-26 21:18:24 +01:00
Akim Demaille
2c7f50be62 maint: update TODO.
* TODO (Labeling the symbols): Remove, it's done ("Name references").
2012-01-25 16:36:03 +01:00
Akim Demaille
93ebddb11f maint: update THANKS.
* THANKS: Update Tys's address, on his request.
2012-01-25 13:25:22 +01:00
Akim Demaille
1890a2a816 maint: fix --gcc-warnings support.
* configure.ac: Use enable_gcc_warnings instead of enableval,
	which is valid only with AC_ARG_ENABLE.
2012-01-25 13:04:43 +01:00
Akim Demaille
da1eb15bc9 maint: silent-rules.
* configure.ac: Ask for silent-rules support.
	Enable it by default.
2012-01-25 12:59:02 +01:00
Paul Eggert
071ca141ec tests: port to Solaris 10 'diff -u'
* tests/regression.at (parse-gram.y: LALR = IELR): Port to Solaris 10,
where "diff -u X X" outputs "No differences encountered"
instead of outputting nothing.  Reported by Tomohiro Suzuki in
<http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00101.html>.
2012-01-24 13:54:40 -08:00
Jim Meyering
fb9eea8885 build: avoid possibly-replaced fprintf in liby-source, yyerror.c
* lib/yyerror.c (yyerror): Use fputs and fputc rather than fprintf
with a mere "%s\n" format.  Always return 0 now, on the assumption
that the return value was never used anyway.
Don't include <config.h> after all.  This avoids a problem
reported by Thiru Ramakrishnan in
http://lists.gnu.org/archive/html/help-bison/2011-11/msg00000.html
* cfg.mk: Exempt lib/yyerror.c from the sc_require_config_h_first test.
* THANKS: Update.
2012-01-23 13:52:21 +01:00
Jim Meyering
219139f521 build: generalize etc/prefix-gnulib-mk
This script hard-coded "libbison" and lib/gnulib.mk.
Adjust the script to require a --lib-name=$gnulib_name option
and a FILE argument like lib/$gnulib_mk.
Also add support for --help and --version.
* etc/prefix-gnulib-mk: Generalize.
* bootstrap.conf (bootstrap_post_import_hook): Update its invocation.
2012-01-23 09:43:19 +01:00
Akim Demaille
8bd2f687b6 maint: be more robust to gnulib's FOO_H variables.
* configure.ac: Instead of listing gnulib's variables, look for
	them among AC_SUBST variables.
2012-01-20 14:48:53 +01:00
Jim Meyering
5ef4a3c71c maint: generate ChangeLog from git log
* Makefile.am (gen-ChangeLog): New rule.
(dist-hook): Depend on it.
(EXTRA_DIST): Distribute the two ChangeLog-* files.
* bootstrap.conf (gnulib_modules): Add gitlog-to-changelog.
(bootstrap_post_import_hook): Ensure that ChangeLog exists.
* build-aux/git-log-fix: New file.
* ChangeLog-2012: Renamed ...
* ChangeLog: ... from this.
* ChangeLog-1998: Renamed ...
* OChangeLog: ...from this
* .gitignore: Add ChangeLog.
2012-01-20 09:33:14 +01:00
Jim Meyering
4aa9d1ff9c change more quotes in source, and adjust tests to match
Run this command to change each `%s' to '%s' in source directories:
  git grep -l '`%s'\' src djgpp data \
    |xargs perl -pi -e '$q="'\''";s/`%s$q/$q%s$q/g'
* data/bison.m4: Affected per the above.
* djgpp/subpipe.c: Likewise.
* src/files.c: Likewise.
* src/getargs.c: Likewise.
* src/muscle-tab.c: Likewise.
* src/reader.c: Likewise.
* tests/glr-regression.at: Adjust to match.
* tests/input.at: Likewise.
* tests/push.at: Likewise.
* tests/skeletons.at: Likewise.
2012-01-19 09:09:42 +01:00
Jim Meyering
ae93e4e4b8 quote consistently and make tests pass with new quoting from gnulib
Updating to gnulib pulled in new quote and quotarg modules,
by which quoting is now done like 'this' rather than `this'.
That change induces many "make check" test failures.  This change
adapts code and tests so that "make check" passes once again.
* src/scan-code.l: Quote like 'this', not like `this'.
* src/scan-gram.l: Likewise.
* src/symtab.c: Likewise.
* tests/actions.at: Adjust tests to match.
* tests/input.at: Likewise.
* tests/named-refs.at: Likewise.
* tests/output.at: Likewise.
* tests/regression.at: Likewise.
* lib/.gitignore: Regenerate.
* m4/.gitignore: Likewise.
2012-01-19 09:09:42 +01:00
Jim Meyering
728415f885 build: update gnulib and autoconf submodules to latest 2012-01-19 09:09:41 +01:00
Jim Meyering
85ad742d4e build: manually update bootstrap from gnulib, and adapt
Updating to the latest bootstrap from gnulib involves more of a
change than usual, and updating to the latest gnulib would involve
its own set of challenges with the upcoming quoting changes, so
we update bootstrap manually and separately.
* bootstrap: Update from gnulib.
* Makefile.am: Initialize more variables to empty, so that gnulib.mk
can append to them with "+=".
* bootstrap.conf (gnulib_mk_hook): Remove.  No longer honored.
(bootstrap_post_import_hook): Instead, run the same command,
etc/prefix-gnulib-mk lib/$gnulib_mk, via slightly different API.
Temporarily disable "bootstrap_sync=true".
* etc/prefix-gnulib-mk: Don't prepend "lib/" to tokens like -I$(...
or "\".
2012-01-19 09:09:38 +01:00
Jim Meyering
77f114dd6e maint: include <config.h> first
* cfg.mk (exclude_file_name_regexp--sc_require_config_h_first):
Exempt data/glr.c and data/yacc.c from the include-config.h-first
requirement.
2012-01-19 06:58:00 +01:00
Jim Meyering
cf33c228e0 build: include <config.h> from lib/yyerror.c
* lib/yyerror.c: Include <config.h>.
2012-01-19 06:57:08 +01:00
Jim Meyering
e7f5dbf82d maint: list djgpp/subpipe.c in po/POTFILES.in
* po/POTFILES.in: Add djgpp/subpipe.c.
2012-01-19 06:56:56 +01:00
Jim Meyering
aebc430361 maint: placate the space-TAB syntax-check
* cfg.mk (exclude_file_name_regexp--sc_space_tab): Exempt
tests/input.at and tests/c++.at, since they appear to use
SP-TAB sequences deliberately.
* OChangeLog: Remove space-before-TAB.
2012-01-19 06:56:47 +01:00
Jim Meyering
da5462d42a maint: remove final trailing space
* src/scan-gram.l (%): Remove single space at end of line.
2012-01-19 06:56:34 +01:00
Jim Meyering
b87414a05e maint: get gpl-3.0 from gnulib
* bootstrap.conf (gnulib_modules): Add gpl-3.0.
* doc/gpl-3.0.texi: Remove from version control, now that
we get it via gnulib.
* doc/.gitignore: Ignore it.
2012-01-19 06:56:12 +01:00
Jim Meyering
411614fac4 doc: correct typo: s/can not/cannot/
* doc/bison.texinfo (Bug Reports): s/can not/cannot/
And remove trailing blanks.
2012-01-19 06:55:53 +01:00
Akim Demaille
2d404819d0 java: fix reduction traces.
* data/lalr1.java (yy_reduce_print): Fix state index.
	Reported by Tim Landscheidt.
2012-01-15 14:24:07 +01:00
Jim Meyering
78e365574e build: avoid warning from coverity about lbitset_elt_find
* lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt",
at a point where we know it is non-NULL, due to prior dereference.

Copyright (C) 1987-1988, 1991-2012 Free Software Foundation,
2012-01-13 12:06:56 +01:00
Jim Meyering
3ca445da25 maint: get fdl.texi from gnulib
* bootstrap.conf (gnulib_modules): Add fdl.
* doc/fdl.texi: Remove file.
2012-01-13 12:05:15 +01:00
Jim Meyering
6116a98165 maint: spell "file system" as two separate words
* doc/Doxyfile.in: Spell it "file system", to avoid a
"make syntax-check" failure.
2012-01-13 12:05:15 +01:00