From 57f8bd8d18cec4004423eeec8cb8338a0afd46c7 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 3 Oct 2012 08:43:10 +0200 Subject: [PATCH 1/5] doc: add missing documentation for --report * doc/bison.texi (Bison Options): Document --report's "solved", "all", and "none". --- doc/bison.texi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/bison.texi b/doc/bison.texi index 69836112..ba18d9a9 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -9072,13 +9072,23 @@ separated list of @var{things} among: Description of the grammar, conflicts (resolved and unresolved), and parser's automaton. +@item itemset +Implies @code{state} and augments the description of the automaton with +the full set of items for each state, instead of its core only. + @item lookahead Implies @code{state} and augments the description of the automaton with each rule's lookahead set. -@item itemset -Implies @code{state} and augments the description of the automaton with -the full set of items for each state, instead of its core only. +@item solved +Implies @code{state}. Explain how conflicts were solved thanks to +precedence and associativity directives. + +@item all +Enable all the items. + +@item none +Do not generate the report. @end table @item --report-file=@var{file} From 04a4684a513c1651c56fcc6d43e1049e5f07225d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 3 Oct 2012 09:17:58 +0200 Subject: [PATCH 2/5] tests: check that headers are self contained Reported by Alexandre Duret-Lutz. * tests/headers.at (Several parsers): here. --- THANKS | 2 +- tests/headers.at | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/THANKS b/THANKS index 8af0abbe..09d6736b 100644 --- a/THANKS +++ b/THANKS @@ -5,7 +5,7 @@ Airy Andre Airy.Andre@edf.fr Akim Demaille akim@freefriends.org Albert Chin-A-Young china@thewrittenword.com Alexander Belopolsky alexb@rentec.com -Alexandre Duret-Lutz adl@src.lip6.fr +Alexandre Duret-Lutz adl@lrde.epita.fr Andreas Schwab schwab@suse.de Andrew Suffield asuffield@users.sourceforge.net Angelo Borsotti angelo.borsotti@gmail.com diff --git a/tests/headers.at b/tests/headers.at index 0524340e..91fdb950 100644 --- a/tests/headers.at +++ b/tests/headers.at @@ -127,7 +127,8 @@ AT_SETUP([Several parsers]) # AT_TEST([PREFIX], [DIRECTIVES]) # ------------------------------- # Generate and compile to *.o. Make sure there is no (allowed) YY* -# nor yy* identifiers in the header. +# nor yy* identifiers in the header. Check that headers are +# self-contained, and can be compiled by a C++ compiler. m4_pushdef([AT_TEST], [AT_BISON_OPTION_PUSHDEFS([%define api.prefix "$1_" $2]) AT_DATA_GRAMMAR([$1.AT_SKEL_CC_IF([yy], [y])], @@ -242,6 +243,18 @@ AT_TEST([x8], [%define api.pure %define api.push-pull both]) AT_COMPILE_CXX([parser], [[x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc]]) AT_CHECK([./parser], [0], [[expout]]) +# Check that the headers are self-contained, and protected against +# multiple inclusions. While at it, check they are sane for C++. +for h in *.h *.hh +do + # No shell expansion with AT_DATA. + cat >$h.cc < Date: Wed, 3 Oct 2012 15:26:56 +0000 Subject: [PATCH 3/5] maint: fix an erroneous include This fixes test 130 (Several parsers). * data/location.cc: Include rather than since we really need << on strings for instance. * NEWS: Document this. Signed-off-by: Akim Demaille --- NEWS | 4 +++- data/location.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ad5f738e..c1ab7aa3 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ GNU Bison NEWS Incorrect definitions of YY_, issued by yacc.c when no parser header is generated, are removed. + All the generated headers are self-contained. + ** Changes in the format of error messages This used to be the format of many error reports: @@ -1894,7 +1896,7 @@ along with this program. If not, see . LocalWords: namespaces strerror const autoconfiguration Dconst Autoconf's FDL LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf - LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp + LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp calc yyo fval Local Variables: mode: outline diff --git a/data/location.cc b/data/location.cc index b7383d65..0673f4c2 100644 --- a/data/location.cc +++ b/data/location.cc @@ -30,7 +30,7 @@ b4_copyright([Positions for Bison parsers in C++], ]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ # include // std::max -# include +# include # include ]b4_null_define[ From ec78bdab6d3de74968b9a6bbe2d88d0f3317a6d9 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 4 Oct 2012 09:07:42 +0200 Subject: [PATCH 4/5] lalr1.cc: fix test suite portability Reported by Rob Vermaas' Hydra build farm on x86_64-darwin 10.2.0 with G++ 4.6.3. * tests/headers.at (Several parsers): Include AT_DATA_SOURCE_PROLOGUE in the files to compile. * data/location.cc: Do not include twice string and iostream (once by position.hh, and then by location.hh). * README-hacking (Typical errors): Some hints for other maintainers. --- README-hacking | 13 +++++++++++++ THANKS | 1 + data/location.cc | 2 -- tests/headers.at | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README-hacking b/README-hacking index bb91ac06..50669568 100644 --- a/README-hacking +++ b/README-hacking @@ -168,6 +168,19 @@ decide whether to update. ** make check Use liberally. +** Typical errors +If the test suite shows failures such as the following one + + .../bison/lib/getopt.h:196:8: error: redefinition of 'struct option' + /usr/include/getopt.h:54:8: error: previous definition of 'struct option' + +it probably means that some file was compiled without +AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I pick up +gnulib's replacement headers, such as getopt.h, which will go if config.h +was not included first. + +See tests/local.at for details. + ** make maintainer-check-valgrind This target uses valgrind both to check bison, and the generated parsers. diff --git a/THANKS b/THANKS index 09d6736b..f742e8f8 100644 --- a/THANKS +++ b/THANKS @@ -93,6 +93,7 @@ R Blake blakers@mac.com Raja R Harinath harinath@cs.umn.edu Ralf Wildenhues Ralf.Wildenhues@gmx.de Richard Stallman rms@gnu.org +Rob Vermaas rob.vermaas@gmail.com Robert Anisko anisko_r@epita.fr Satya Kiran Popuri satyakiran@gmail.com Sebastian Setzer sebastian.setzer.ext@siemens.com diff --git a/data/location.cc b/data/location.cc index 0673f4c2..92b6d096 100644 --- a/data/location.cc +++ b/data/location.cc @@ -159,8 +159,6 @@ b4_copyright([Locations for Bison parsers in C++], ]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ -# include -# include # include "position.hh" ]b4_namespace_open[ diff --git a/tests/headers.at b/tests/headers.at index 91fdb950..8e70a7eb 100644 --- a/tests/headers.at +++ b/tests/headers.at @@ -249,6 +249,7 @@ for h in *.h *.hh do # No shell expansion with AT_DATA. cat >$h.cc < Date: Thu, 4 Oct 2012 11:45:09 +0200 Subject: [PATCH 5/5] maint: word changes * README-hacking (Typical errors): Improve wording. --- README-hacking | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README-hacking b/README-hacking index 50669568..26391e98 100644 --- a/README-hacking +++ b/README-hacking @@ -175,9 +175,9 @@ If the test suite shows failures such as the following one /usr/include/getopt.h:54:8: error: previous definition of 'struct option' it probably means that some file was compiled without -AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I pick up -gnulib's replacement headers, such as getopt.h, which will go if config.h -was not included first. +AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I options +pick up gnulib's replacement headers, such as getopt.h, and this will go +wrong if config.h was not included first. See tests/local.at for details.