Commit Graph

110 Commits

Author SHA1 Message Date
Akim Demaille
6537c71fcc maint: fix spello.
* README-hacking: Here.
* THANKS: Reported by Gilles Espinasse.
2012-06-12 14:49:48 +02:00
Akim Demaille
22172d4731 c++: compute the header guards.
This is a frequent request.  Recently pointed out by Wei Song,
<http://lists.gnu.org/archive/html/help-bison/2012-05/msg00002.html>.

* data/c.m4 (b4_tocpp, b4_cpp_guard, b4_cpp_guard_open)
(b4_cpp_guard_close): New.
* data/lalr1.cc, data/location.cc, data/stack.hh: Use them.
* TODO (Header Guards): Move to...
* NEWS: here.
Formatting changes.
2012-05-21 18:15:41 +02: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
bd65f25570 bitset: fix an incorrect error message.
* lib/bitset_stats.c: here.
	Reported by Stefano Lattarini.
2012-02-19 10:21:32 +01:00
Akim Demaille
a34e8b242e 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.
(cherry picked from commit 3272a7256f)

Conflicts:

	examples/variant.yy
	tests/bison.in
2012-02-14 20:12:34 +01:00
Akim Demaille
94556574b5 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.
(cherry picked from commit d115aad911)

Conflicts:

	TODO
	data/yacc.c
2012-01-26 21:36:35 +01:00
Akim Demaille
48c4bf30fd maint: update THANKS.
* THANKS: Update Tys's address, on his request.
(cherry picked from commit 93ebddb11f)
2012-01-26 21:30:13 +01:00
Jim Meyering
c373ab641b 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.
(cherry picked from commit fb9eea8885)
2012-01-25 08:50:14 +01:00
Akim Demaille
33a1fa4e81 scanner: fix typo.
* src/scan-skel.l (@`): s/emtpy/empty/.
	Reported by Tim Landscheidt.
2012-01-11 16:46:36 +01:00
Joel E. Denny
7451638148 tests: fix empty unions.
Empty unions are not accepted by the ISO C99 grammar or by at
least some versions of Sun Studio.  Reported by Wolfgang S. Kechel
at
<http://lists.gnu.org/archive/html/bug-bison/2011-08/msg00003.html>.
* NEWS (2.5.1): Document fix.
* THANKS (Wolfgang S. Kechel): Add.
* tests/existing.at (GNU Cim Grammar)
(GNU pic (Groff 1.18.1) Grammar.): Remove empty %union.
2011-08-21 14:45:03 -04:00
Joel E. Denny
845346b3bb build: avoid YACC typo inherited from Autoconf.
The typo shows up in the `configure --help' output.  Reported by
W.C.A. Wijngaards and Paul Eggert at
<http://lists.gnu.org/archive/html/bug-bison/2011-07/msg00000.html>.
* README-hacking (Release Procedure): Remind about updating
maintainer tools before a release.
* THANKS (W.C.A. Wijngaards): Add.
* configure.ac (AC_PREREQ): Set to 2.68, which fixes the YACC
typo.
2011-07-10 13:42:12 -04:00
Joel E. Denny
8ffd7912e3 Add -Wother so -Wnone suppresses all warnings.
Reported by George Neuner at
<http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
* NEWS (2.5): Document.
* THANKS (George Neuner): Add.
* doc/bison.texinfo (Bison Options): Document.
* src/complain.c, src/complain.h
(warn_at, warn_at_indent, warn): Suppress warning if -Wno-other.
(midrule_value_at): New warning function, similar to yacc_at in
that it's controlled by its own warning category.
* src/getargs.c (warnings_flag): Initialize to warnings_other.
(warnings_args, warnings_types): Add entry for warnings_other.
(usage): Update.
* src/getargs.h (enum warnings): Add entry for warnings_other.
* src/gram.c (grammar_rules_useless_report): If -Wno-other, then
don't print useless rules.
* src/reader.c (symbol_should_be_used): Rather than adjusting the
return value based on whether midrule value warnings are enabled,
accept a new parameter for telling the caller whether true is
being returned for a potential midrule warning.
(grammar_rule_check): Use midrule_value_at for midrule value
warnings, and continue to use warn_at for all other warnings.  Let
them check whether the warnings are enabled.
* tests/local.at (AT_BISON_CHECK): Update documentation.
(AT_BISON_CHECK_NO_XML): Check that -Wnone and --warnings=none
disable all warnings exercised in the test suite.
2011-04-03 19:45:39 -04:00
Akim Demaille
8f462efe92 named references: fix double free.
In `rhs[name]: "a" | "b"', do not free "name" twice.
Reported by Tys Lefering.
<http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html>

	* src/named-ref.h, src/named-ref.c (named_ref_copy): New.
	* src/parse-gram.y (current_lhs): Rename as...
	(current_lhs_symbol): this.
	(current_lhs): New function.  Use it to free the current lhs
	named reference.
	* src/reader.c: Bind lhs to a copy of the current named reference.
	* src/symlist.c: Rely on free (0) being valid.
	* tests/named-refs.at: Test this.
2011-03-09 21:04:17 +01:00
Angelo Borsotti
6f75992be5 java: fix parser stack popping bug.
Reported at
<http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>.
* THANKS (Angelo Borsotti): Add.
* data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
in clearing the value stack.  Previously, the top element of the
stack wasn't cleared and so the value was not garbage collected.
2011-03-06 23:04:55 -05:00
Bernd Kiefer
8db68289d1 java: fix location handling bug.
Reported at
<http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
* data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
reversed access to location stack.
* THANKS (Bernd Kiefer): Add.
2011-02-19 19:46:54 -05:00
Joel E. Denny
210c1eef22 Correct my email address.
* ChangeLog: In all recent entries.
* THANKS (Joel E. Denny): Here.
(cherry picked from commit 1eb6350451)

Conflicts:

	ChangeLog
2011-01-02 09:39:23 -05:00
Akim Demaille
baacae4971 doc: fix lalr1.cc documentation.
* doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
	(C++ Bison Interface): Fix lalr1.cc skeleton name.
	(C++ Parser Interface): Fix semantic_type and location_type names.
	Document yy::parser::token.
	Reported by Jerry Quinn.

(cherry picked from commit 0100cd629d)

Conflicts:
	doc/bison.texinfo
2010-05-10 10:31:31 +02:00
Joel E. Denny
585ef2eb20 tests: fix for newer Sun Studio C++.
Reported by Dagobert Michelsen at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
* THANKS (Dagobert Michelsen): Add.
* configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
Autoconf macro for handling the restrict keyword.
* gnulib: Update to latest, which no longer overrides that macro
from Autoconf.
(cherry picked from commit 4333ba11c6)
2010-04-10 17:54:22 -04:00
Joel E. Denny
7a9c3cb3a7 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
Reported by Johan van Selst at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
* NEWS (2.4.3): New.
* THANKS (Johan van Selst): Add.
* gnulib: Update to latest.
(cherry picked from commit 311b2e56ea)

Conflicts:

	NEWS
2010-03-23 12:38:09 -04:00
Joel E. Denny
47fa574761 portability: fix several issues with M4 subprocess.
M4's output pipe was not being drained upon fatal errors during
scan_skel.  As a result, broken-pipe messages from M4 were seen
on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
failure in the test suite.  The problem was that, on platforms
where the default disposition for SIGPIPE is ignore instead of
terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
then reported it.  However, there's some sort of race condition,
because the new test group occasionally succeeded.
Reported by Albert Chin at
<http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.

There were also problems with the test suite livelocking on
Tru64 5.1b.  Reported by Didier Godefroy at
<http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
Switching to create_pipe_bidi suggested by Akim Demaille.

To attempt to solve both of these problems, switch to gnulib's
create_pipe_bidi and register M4 process as a slave.  Along the
way, clean up file name conflict handling, which was affected by
the broken-pipe problem before the switch.
* NEWS (2.4.2): Document.
* THANKS (Didier Godefroy): Add.
* bootstrap.conf (gnulib_modules): Add pipe.
* gnulib: Update to latest to make sure we have all the latest
fixes.
* lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
subpipe.c.
* po/POTFILES.in (lib/subpipe.c): Remove.
* src/files.c (compute_output_file_names): Update invocations
of output_file_name_check.
(output_file_name_check): In the case that the grammar file
would be overwritten, use complain instead of fatal, but replace
the output file name with /dev/null.  Use the /dev/null solution
for the case of two conflicting output files as well because it
seems safer in case Bison one day tries to open both files at
the same time.
* src/files.h (output_file_name_check): Update prototype.
* src/output.c (output_skeleton): Use create_pipe_bidi and
wait_subprocess.  Assert that scan_skel completely drains the
pipe.
* src/scan-skel.l (at_directive_perform): Update
output_file_name_check invocation.
* tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
grammar file actually isn't overwritten.
(Conflicting output files: -o foo.y): Update expected output.
* tests/skeletons.at (Fatal errors but M4 continues producing
output): New test group.
(cherry picked from commit 22cc8d813e)

Conflicts:

	NEWS
	bootstrap.conf
	lib/.cvsignore
	lib/.gitignore
	m4/.cvsignore
	m4/.gitignore
	src/output.c
2010-02-22 18:32:47 -05:00
Joel E. Denny
5a2f6eb4af Thank the developer of the initial push parser implementation.
This unfortunate oversight is several years old.
* THANKS (Odd Arild Olsen): Add.
(cherry picked from commit 326e5cf81e)
2010-01-15 13:44:55 -05:00
Joel E. Denny
af2ffe5c23 Document gcc -Wundef fix.
* NEWS (2.4.2): Here.
* THANKS (Jonathan Nieder): Add.
(cherry picked from commit c938d650db)
2009-12-16 01:51:14 -05:00
Joel E. Denny
9637e0ed1c tests: skip tests of file names that platform does not support.
Reported by Michael Raskin at
<http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
* THANKS (Michael Raskin): Add.
* tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix.  Cygwin used
to fail at least for file names containing ":" or "\".
(cherry picked from commit 2ceb8c617c)
2009-10-04 23:18:59 -04:00
Akim Demaille
8fbbeba2a4 doc: %initial-action to initialize yylloc.
Reported by Bill Allombert.
	* doc/bison.texinfo: Set fill-column to 76.
	(Location Type): Document the use of %initial-action to initialize
	yylloc.

(cherry picked from commit d59e456dbf)
2009-08-19 13:36:22 +02:00
Akim Demaille
2509eba631 build: lower gettext requirements.
Bison was uselessly requiring the formatstring macros from
gettext, which resulted in mo files not being installed on systems
that perfectly supported Bison mo files.  Lower the requirement.
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html

	* configure.ac: Require need-ngettext instead of
	need-formatstring-macros.
	Reported by Martin Jabocs.
	Suggested by Bruno Haible.
	* INSTALL: Restructure.
	(Internationalization): New.
(cherry picked from commit b9e42bb439)
2009-08-17 10:26:50 +02:00
Akim Demaille
6469c4d72b doc: update README-hacking.
* README-hacking: We now use git and git submodules.
	Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2009-03-26 23:48:46 +01:00
Akim Demaille
8defe11bfa Fix grep portability issues.
Grep on Solaris does not support -q.
Reported by Summum Bonum.

	* NEWS: Add a stub for 2.4.2.
	* THANKS: Add Summum Bonum.
	* tests/atlocal.in (EGREP): New.
	(CC, CXX, XSLTPROC): Make it possible to override them via
	envvars.
	* tests/java.at: Use $EGREP instead of egrep.
	Use AT_CHECK's ignore instead of grep's -q.
2009-01-08 09:46:40 +01:00
Joel E. Denny
462503f825 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 output file.
2008-11-19 00:38:14 -05:00
Joel E. Denny
14da0cdd07 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-04 13:30:38 -05:00
Joel E. Denny
0f0e1ace60 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 12:46:12 -04:00
Paolo Bonzini
ddf17a6e0e small but important bugfixes for the Java skeleton
2008-10-08  Di-an Jan  <dianj@freeshell.org>  (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-10-09 21:26:29 +02:00
Joel E. Denny
bcf07cb707 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-16 02:56:36 -04:00
Joel E. Denny
8f7e2e1ff2 * THANKS: Add Eric Blake. 2008-05-07 05:02:12 +00:00
Juan Manuel Guerrero
80d2c3adcc * THANKS: Update my email address. 2008-02-06 10:24:07 +00:00
Joel E. Denny
a2ea208d82 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
true since it's then always used regardless of whether yyoverflow is
defined.  Reported by Christian Burger at
<http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
* THANKS: Add Christian Burger.
2007-08-03 04:51:23 +00:00
Joel E. Denny
eb1b07409f Fix push parsing memory leak reported by Brandon Lucia at
<http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
* THANKS: Add Brandon Lucia.
* data/push.c (yypstate_delete): Free the stack if it was reallocated
but the parse never completed and thus freed it.
* tests/Makefile.am (TESTSUITE_AT): Add push.at.
* tests/testsuite.at: Include push.at.
* test/push.at: New.
(Push Parsing: Memory Leak for Early Deletion): New test case.
2007-07-28 04:27:32 +00:00
Joel E. Denny
0c650a2027 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
the case of pure parsers.  Reported by Frans Englich at
<http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
* THANKS: Add Frans Englich.
2007-05-26 19:10:43 +00:00
Paul Eggert
9b33de72cd Use ASCII for Sebastien Fricker's name. 2007-04-04 22:41:58 +00:00
Joel E. Denny
2955354793 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
Setzer.
(Java Differences): Fix some typos.
* THANKS: Add Sebastian Setzer.
2007-03-10 21:05:24 +00:00
Joel E. Denny
f57a753663 Use YYFPRINTF instead of fprintf where appropriate. Reported by
Sébastien Fricker at
<http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
* THANKS: Add Sébastien Fricker.
* data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
* doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
accept a variable number of arguments.
2007-02-24 05:43:35 +00:00
Paul Eggert
fcab4a2ee2 Credit Satya for the graphviz change. 2006-10-12 23:35:24 +00:00
Paul Eggert
c1630a8b80 * THANKS: Add Paolo Bonzini and Bob Rossi. 2006-10-09 16:18:52 +00:00
Paul Eggert
40637e8169 Add name for twlevo. 2006-06-15 18:29:10 +00:00
Joel E. Denny
9138c575d8 * data/glr.c (yyreportTree): Make room in yystates for the state
preceding the RHS.  This fixes the segmentation fault reported by Derek
M. Jones in
<http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
(yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
to the user.  Reported for yyreportTree by Derek M. Jones later in the
same thread.
* THANKS: Add Derek M. Jones.
Update my email address.
Fix typo in Steve Murphy's name.
2006-05-17 16:39:40 +00:00
Akim Demaille
cd8b579166 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
scheme.
Reported by Steve Murphy.
2006-05-14 21:00:37 +00:00
Akim Demaille
3cf084ecae * examples/extexi: Enforce the precedence of concatenation over
>>.
Reported by   tommy.nordgren@chello.se
2006-05-11 11:35:13 +00:00
Akim Demaille
f94705b204 Complete ChangeLog. 2006-05-11 06:21:18 +00:00
Akim Demaille
b2ddc3f337 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
rule.
Reported by Mickael Labau.
* tests/input.at (Torturing the Scanner): Test it.
2006-04-03 13:50:10 +00:00
Akim Demaille
7625ec2c83 * src/scan-skel.l: Output the base name parts of the parser and
header file names.
* tests/output.at (AT_CHECK_OUTPUT): Support subdirectorioes, and
additional checks.
Use this to exercise C++ outputs in subdirs.
Reported by Oleg Smolsky.
2005-10-13 10:13:24 +00:00
Paul Eggert
f9315de5a4 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
reported by Joel E. Denny in
<http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
(trivial change).
* tests/glr-regression.at (Duplicate representation of merged trees):
New test, from Joel E. Denny in:
<http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
* THANKS: Add Joel E. Denny.
2005-08-21 23:43:56 +00:00