??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 178
2015-01-23 Akim Demaille
version 3.0.4
* NEWS: Record release date.
2015-01-23 Akim Demaille
gnulib: update
2015-01-23 Akim Demaille
build: re-enable compiler warnings, and fix them
There are warnings (-Wextra) in generated C++ code:
ltlparse.cc: In member function 'ltlyy::parser::symbol_number_type
ltlyy::parser::by_state::type_get() const':
ltlparse.cc:452:33: warning: enumeral and non-enumeral type in
conditional expression
return state == empty_state ? empty_symbol : yystos_[state];
Reported by Alexandre Duret-Lutz.
It turns out that -Wall and -Wextra were disabled because of a stupid
typo.
* configure.ac: Fix the stupid typo.
* data/lalr1.cc, src/AnnotationList.c, src/InadequacyList.c,
* src/ielr.c, src/print.c, src/scan-code.l, src/symlist.c,
* src/symlist.h, src/symtab.c, src/tables.c, tests/actions.at,
* tests/calc.at, tests/cxx-type.at, tests/glr-regression.at,
* tests/named-refs.at, tests/torture.at:
Fix warnings, mostly issues about variables used only with assertions,
which are disabled with -DNDEBUG.
2015-01-22 Akim Demaille
tests: c++: fix a C++03 conformance issue
This fixes test 241 on xLC:
"input.y", line 42.11: 1540-0274 (S) The name lookup for "report" did not find a declaration.
"input.y", line 42.11: 1540-1292 (I) Static declarations are not considered for a function call if the function is not qualified.
where report is:
static void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
and line 42 is:
%printer { report (yyo, $$, $$); } ;
It turns out that indeed this function must not be declared static,
. Let's put it into an
anonymous namespace.
Reported by Thomas Jahns.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html
* tests/actions.at (Qualified $$ in actions): Don't use "static",
prefer anonymous namespace.
2015-01-20 Akim Demaille
tests: fix a title
* tests/conflicts.at: De-overquote.
2015-01-20 Akim Demaille
c++: reserve 200 slots in the parser's stack
This is consistent with what is done with yacc.c and glr.c. Because
it also avoids that the stack needs to be resized very soon, it should
help keeping tests about destructors more reliable.
Indeed, if the stack is created too small, very soon the C++ library
needs to enlarge it, which means creating a new one, copying the
elements from the initial one onto it, and then destroy the elements
of the initial stack: that would be a spurious call to a destructor.
Reported by Thomas Jahns.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html
* data/stack.hh (stack::stack): Reserve 200 slots.
* tests/c++.at: Remove traces of stack expansions.
2015-01-20 Akim Demaille
tests: be more robust to unrecognized synclines, and try to recognize xlc
Reported by Thomas Jahns.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html
* tests/synclines.at (AT_SYNCLINES_COMPILE): Rename as...
(_AT_SYNCLINES_COMPILE): this.
Try to recognize xlc locations.
(AT_SYNCLINES_COMPILE): New. Skips the test if we can't read the
synclines.
2015-01-20 Akim Demaille
tests: fix C++ conformance
Reported by Thomas Jahns.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html
* tests/c++.at (Exception safety): Add missing include.
Don't use const_iterator for erase.
2015-01-18 Akim Demaille
build: fix some warnings
Reported by John Horigan.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00034.html
* src/graphviz.c, src/symtab.h: Address compiler warnings.
2015-01-16 Akim Demaille
build: avoid infinite recursions on include_next
On MacOS X 10.5 PPC with Apple's GCC 4.0.1:
% uname -a
Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:0
1 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
% gcc --version
powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
building in place enters into an infinite recursion on "#include_next":
% gmake V=1
[snip]
depbase=`echo lib/math.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -I. -Ilib -I. -I./lib -g -O2 -MT lib/math.o -MD -MP -MF $depbase.Tpo -c -o lib/math.o lib/math.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from lib/math.h:27,
from lib/math.h:27,
from lib/math.h:27,
from lib/math.h:27,
[snip]
from lib/math.h:27,
from lib/math.h:27,
from lib/math.c:3:
lib/math.h:27:23: error: #include nested too deeply
Makefile:3414: recipe for target 'lib/math.o' failed
gmake[2]: *** [lib/math.o] Error 1
Using -I./lib instead of -Ilib fixes the problem.
Reported by Pho.
* Makefile.am (AM_CPPFLAGS): Use -I./lib instead of -Ilib.
2015-01-16 Akim Demaille
doc: minor fixes
* doc/bison.texi: Fix warnings about colon in reference names.
* data/bison.m4, src/files.h: Fix comments.
* doc/Doxyfile.in: update.
2015-01-15 Akim Demaille
gnulib: strtoul is considered obsolete and now useless
* bootstrap.conf: here.
2015-01-15 Akim Demaille
c++: avoid warnings when destructors don't use $$
* data/c++.m4: here.
2015-01-15 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2015-01-15 Akim Demaille
version 3.0.3
* NEWS: Record release date.
2015-01-15 Akim Demaille
gnulib: update
2015-01-13 Akim Demaille
tests: split a large test case into several smaller ones
* tests/conflicts.at (AT_CONSISTENT_ERRORS_CHECK): Move AT_SETUP/AT_CLEANUP
into it, so that we don't skip non Java tests following a test case in Java.
2015-01-12 Akim Demaille
package: a bit of trouble shooting indications
* README-hacking: here.
2015-01-12 Akim Demaille
doc: liby's main arms the internationalization
Reported by Nicolas Bedon.
* doc/bison.texi (Yacc Library): Document the call the setlocale.
2015-01-09 Akim Demaille
bison: avoid warnings from static code analysis
A static analysis tool reports that some callers of symbol_list_n_get
might get NULL and not handle it properly. This is not the case, yet
we can suppress this pattern.
Reported by Mike Sullivan.
* src/symlist.c (symbol_list_n_get): Actually it is never called
to return 0. Enforce this postcondition via aver.
(symbol_list_n_type_name_get): Simplify accordingly. In particular,
discards a (translated) useless error message.
* src/symlist.h: Adjust documentation.
* src/scan-code.l: Style change.
2015-01-09 Akim Demaille
c++: fix the use of destructors when variants are enabled
When using variants, destructors generate invalid code.
Reported by Michael Catanzaro.
* data/c++.m4 (~basic_symbol): b4_symbol_foreach works on yysym:
define it.
* tests/c++.at (Variants): Check it.
2015-01-08 Akim Demaille
style: tests: simplify the handling of some C++ tests
* tests/c++.at: here.
(Doxygen): Pass %define, so that files such as position.hh etc.
are generated, instead of putting everything into input.hh.
2015-01-08 Akim Demaille
c++: symbols can be empty, so use it
The previous patches ensure that symbols (symbol_type and
stack_symbol_type) can be empty, cleared, and their emptiness can be
checked. Therefore, yyempty, which codes whether yyla is empty or
not, is now useless.
In C skeletons (e.g., yacc.c), the fact that the lookahead is empty is
coded by "yychar = YYEMPTY", which is exactly what this patch
restores, since yychar/yytoken corresponds to yyla.type.
* data/lalr1.cc (yyempty): Remove.
Rather, depend on yyla.empty ().
2015-01-08 Akim Demaille
c++: variants: don't leak the lookahead in error recovery
During error recovery, when discarding the lookeahead, we don't
destroy it, which is caught by parse.assert assertions.
Reported by Antonio Silva Correia.
With an analysis and suggested patch from Michel d'Hooge.
* tests/c++.at (Variants): Strengthen the test to try syntax errors
with discarded lookahead.
2015-01-08 Akim Demaille
c++: provide a means to clear symbols
The symbol destructor is currently the only means to clear a symbol.
Unfortunately during error recovery we might have to clear the
lookahead, which is a local variable (yyla) that has not yet reached
its end of scope.
Rather that duplicating the code to destroy a symbol, or rather than
destroying and recreating yyla, let's provide a means to clear a
symbol.
Reported by Antonio Silva Correia, with an analysis from Michel d'Hooge.
* data/c++.m4, data/lalr1.cc (basis_symbol::clear, by_state::clear)
(by_type::clear): New.
(basic_symbol::~basic_symbol): Use clear.
2015-01-08 Akim Demaille
c++: clean up the handling of empty symbols
* data/c++.m4, data/lalr1.cc (yyempty_): Remove, replaced by...
(empty_symbol, by_state::empty_state): these.
(basic_symbol::empty): New.
2015-01-08 Akim Demaille
c++: comment and style changes
* data/c++.m4, data/lalr1.cc: More documentation.
Tidy.
* tests/c++.at (string_cast): Rename as...
(to_string): this C++11 name.
2015-01-07 Akim Demaille
c++: variants: comparing addresses of typeid.name() is undefined
Instead of storing and comparing pointers to names of types, store
pointers to the typeids, and compares the typeids.
Reported by Thomas Jahns.
* data/variant.hh (yytname_): Replace with...
(yytypeid_): this.
2015-01-05 Akim Demaille
c++: locations: complete the API and fix comments
There are no support for += between locations, and some comments are wrong.
Reported by Alexandre Duret-Lutz.
* data/location.cc: Fix.
* doc/bison.texi: Document.
* tests/c++.at: Check.
2015-01-05 Akim Demaille
build: do not clean figure sources in make clean
"make clean && make" fails in in-tree builds.
* doc/local.mk (CLEANDIRS): Replace with...
(CLEANFILES): this safer list of files to clean.
2015-01-05 Akim Demaille
build: don't try to generate docs when cross-compiling
When cross-compiling don't run the generated bison to update the docs.
Reported by Aaro Koskinen.
* configure.ac (CROSS_COMPILING): New.
* doc/local.mk: Use it.
2015-01-04 Akim Demaille
package: fix a reporter's name
* THANKS, build-aux/git-log-fix: s/Bernd Edligner/Bernd Edlinger/.
2015-01-04 Akim Demaille
%union: fix the support for named %union
Bison supports a union tag, for obscure reasons. But it does a poor
job at it, especially since Bison 3.0.
Reported by Stephen Cameron and Tobias Frost.
It did not ensure that the name was not given several times. An easy
way to do this is to make the %union tag be handled as a %define
variable, as they cannot be defined several times.
Since Bison 3.0, the synclines were wrongly placed, resulting in
invalid code. Addressing this issue, because of the way the union tag
was stored (as a code muscle), would have been tedious. Unless we
rather define the %union tag as a %percent variable, whose synclines
are easier to manipulate.
So replace the b4_union_name muscle by the api.value.union.name
%define variable, document, and check.
* data/bison.m4: Make sure that api.value.union.name has a keyword value.
* data/c++.m4: Make sure that api.value.union.name is not defined.
* data/c.m4 (b4_union_name): No longer use it, use api.value.union.name.
* doc/bison.texi (%define Summary): Document it.
* src/parse-gram.y (union_name): No longer define b4_uion_name, but
api.value.union.name.
* tests/input.at (Redefined %union name): New.
* tests/synclines.at (%union name syncline): New.
* tests/types.at: Check named %unions.
2015-01-04 Akim Demaille
package: bump to 2015
Which also requires:
* gnulib: Update.
2014-12-31 Akim Demaille
flex: don't trust YY_USER_INIT
Reported by Bernd Edlinger and others.
* src/scan-gram.l: here.
2014-12-31 Akim Demaille
yacc.c: fix broken union when api.value.type=union and %defines are used
Reported by Rich Wilson.
* data/c.m4 (b4_symbol_type_register): Append to b4_union_members,
not b4_user_union_members.
The latter invokes the former, but it is the former which is reinitialized
to empty by b4_value_type_setup_union.
* tests/types.at: Check it.
This reveals another bug, this time in the case of glr.c parsers.
* data/glr.c: Generate the header file before the implementation file,
to be sure that the setup is run before what depends on it.
2014-12-31 Akim Demaille
doc: fix missing xref
Reported by xolodho.
* doc/bison.texi (Printer Decl): here.
2014-12-29 Akim Demaille
gnulib: update
2014-02-03 Akim Demaille
location: remove some ugly debugging code traces
* data/location.cc: here.
2014-02-03 Akim Demaille
build: use abort to pacify compiler errors
clang, with -DNDEBUG and -Werror fails on some functions that might
lack a return. This is because aver is just another assert, discarded
with -DNDEBUG. So use abort.
* src/muscle-tab.c, src/scan-skel.l: here.
2014-02-03 Akim Demaille
package: bump to 2014
* AUTHORS, ChangeLog-2012, Makefile.am, NEWS, PACKAGING, README,
* README-alpha, README-hacking, THANKS, TODO, bootstrap.conf,
* build-aux/darwin11.4.0.valgrind, build-aux/local.mk,
* build-aux/update-b4-copyright,
* build-aux/update-package-copyright-year, cfg.mk, configure.ac,
* data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4,
* data/c-like.m4, data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc,
* data/java-skel.m4, data/java.m4, data/lalr1.cc, data/lalr1.java,
* data/local.mk, data/location.cc, data/stack.hh, data/variant.hh,
* data/xslt/bison.xsl, data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl,
* data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint,
* djgpp/README.in, djgpp/config.bat, djgpp/config.sed,
* djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat,
* djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h,
* djgpp/testsuite.sed, doc/bison.texi, doc/local.mk, doc/refcard.tex,
* etc/README, etc/bench.pl.in, etc/local.mk,
* examples/calc++/calc++.test, examples/calc++/local.mk,
* examples/extexi, examples/local.mk, examples/mfcalc/local.mk,
* examples/mfcalc/mfcalc.test, examples/rpcalc/local.mk,
* examples/rpcalc/rpcalc.test, examples/test, examples/variant.yy,
* lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
* lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
* lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
* lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
* lib/local.mk, lib/main.c, lib/timevar.c, lib/timevar.def,
* lib/timevar.h, lib/vbitset.c, lib/vbitset.h, lib/yyerror.c,
* m4/bison-i18n.m4, m4/c-working.m4, m4/cxx.m4, m4/flex.m4,
* m4/timevar.m4, src/AnnotationList.c, src/AnnotationList.h,
* src/InadequacyList.c, src/InadequacyList.h, src/LR0.c, src/LR0.h,
* src/Sbitset.c, src/Sbitset.h, src/assoc.c, src/assoc.h,
* src/closure.c, src/closure.h, src/complain.c, src/complain.h,
* src/conflicts.c, src/conflicts.h, src/derives.c, src/derives.h,
* src/files.c, src/files.h, src/flex-scanner.h, src/getargs.c,
* src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c,
* src/graphviz.h, src/ielr.c, src/ielr.h, src/lalr.c, src/lalr.h,
* src/local.mk, src/location.c, src/location.h, src/main.c,
* src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c,
* src/named-ref.h, src/nullable.c, src/nullable.h, src/output.c,
* src/output.h, src/parse-gram.c, src/parse-gram.y, src/print-xml.c,
* src/print-xml.h, src/print.c, src/print.h, src/print_graph.c,
* src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
* src/reduce.h, src/relation.c, src/relation.h, src/scan-code.h,
* src/scan-code.l, src/scan-gram.h, src/scan-gram.l, src/scan-skel.h,
* src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
* src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
* src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
* tests/actions.at, tests/atlocal.in, tests/bison.in, tests/c++.at,
* tests/calc.at, tests/conflicts.at, tests/cxx-type.at,
* tests/existing.at, tests/glr-regression.at, tests/headers.at,
* tests/input.at, tests/java.at, tests/javapush.at, tests/local.at,
* tests/local.mk, tests/named-refs.at, tests/output.at, tests/push.at,
* tests/reduce.at, tests/regression.at, tests/sets.at,
* tests/skeletons.at, tests/synclines.at, tests/testsuite.at,
* tests/torture.at, tests/types.at:
here.
2014-01-03 Paul Eggert
doc: specify documentation encoding
* doc/bison.texi: Add '@documentencoding UTF-8'; needed since the
manual contains UTF-8 characters. This will cause the .info files
to contain UTF-8 quotes and the like, which should be OK nowadays.
Add @documentlanguage while we're at it.
2013-12-09 Akim Demaille
package: install the examples
Currently, we do not install the various examples extracted from the
documentation. Let's do it, as they are useful starting points.
* configure.ac: When --enable-gcc-warnings is set, enable ENABLE_GCC_WARNINGS.
* examples/extexi: No longer issue synclines by default.
* examples/local.mk: Except if ENABLE_GCC_WARNINGS.
* examples/calc++/local.mk, examples/mfcalc/local.mk,
* examples/rpcalc/local.mk: Install the example files.
2013-12-09 Akim Demaille
package: install README and the like in docdir
* Makefile.am: here.
2013-12-09 Akim Demaille
diagnostics: fix the order of multiple declarations reports
On
%token FOO "foo"
%printer {} "foo"
%printer {} FOO
we report
/tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO
%printer {} "foo"
^^
/tmp/foo.yy:3.10-11: previous declaration
%printer {} FOO
^^
* src/symtab.c (locations_sort): New.
Use it.
* tests/input.at (Invalid Aliases): Stress the order of diagnostics.
2013-12-09 Akim Demaille
symbol: provide an easy means to compare them in source order
* src/symtab.c (symbols_sort): New.
(user_token_number_redeclaration): Taken from here.
2013-12-05 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-12-05 Akim Demaille
version 3.0.2
* NEWS: Record release date.
2013-12-05 Akim Demaille
gnulib: update
* gnulib: here.
2013-12-04 Akim Demaille
output: do not generate source files when late errors are caught
Reported by Alexandre Duret-Lutz as "second problem" in:
http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html
* bootstrap.conf: We need the "unlink" module.
* src/files.h, src/files.c (unlink_generated_sources): New.
* src/output.c: Use it.
* tests/output.at: Check the case of late errors.
2013-12-04 Akim Demaille
output: record what generated files are source or report files
* src/files.h, src/files.c (output_file_name_check): Take an additional
argument to record whether a file is a source or report file.
* src/files.c (generated_file): New.
(file_names, file_names_count): Replace with...
(generated_files, generated_files_size): these.
* src/scan-skel.l: Adjust.
2013-12-04 Akim Demaille
output: do not generate source files when early errors are caught
Reported by Alexandre Duret-Lutz as "second problem" in:
http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html
One problem is that some errors are caught early, before the
generation of output files, while others can only be detected
afterwards (since, for instance, skeletons can raise errors
themselves).
This will be addressed in two steps: early errors do not generate
source files at all, while later errors will remove the files that
have already been generated.
* src/scan-skel.l (yyout): Open to /dev/null when there are errors.
* tests/output.at (AT_CHECK_FILES): Factored out of...
(AT_CHECK_OUTPUT): this.
Fuse the "SHELLIO" argument in the "FLAGS" one.
Use $5 to denote the expected exit status.
Add a test case for early errors.
2013-11-26 Akim Demaille
xml: also use "%empty" with html output
* data/xslt/xml2xhtml.xsl: No longer issue an Epsilon, display as in
dot and text formats.
2013-11-26 Akim Demaille
style: formatting changes
* src/print-xml.c: here.
2013-11-26 Akim Demaille
xml: also display %empty for empty right-hand sides
* data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: Display %empty where needed.
2013-11-26 Akim Demaille
reports: display %empty in the generated pointed-rules
* src/print.c (print_core): Use %empty for empty rules.
* src/print_graph.c (print_core): Ditto.
* tests/conflicts.at, tests/output.at, tests/reduce.at: Adjust
expectations.
2013-11-26 Akim Demaille
news: YYERROR vs variants
2013-11-18 Akim Demaille
style: scope reduction in lalr.cc
* src/lalr.c: Shorten variable scopes.
(lookahead_tokens_print): Use the same variable name in two loops
iterating over the same structure.
2013-11-15 Akim Demaille
lalr1.cc: formatting changes
* data/lalr1.cc: Fix indentation.
2013-11-15 Akim Demaille
lalr1.cc: fix the support of YYERROR with variants
When variant are enabled, the yylhs variable (the left-hand side of
the rule being reduced, i.e. $$ and @$) is explicitly destroyed when
YYERROR is called. This is because before running the user code, $$
is initialized, so that the user can properly use it.
However, when quitting yyparse, yylhs is also reclaimed by the C++
compiler: the variable goes out of scope.
Instead of trying to be too smart, let the compiler do its job: reduce
the scope of yylhs to exactly the reduction. This way, whatever the
type of scope exit (regular, exception, return, goto...) this variable
will be properly reclaimed.
Reported by Paolo Simone Gasparello.
* data/lalr1.cc (yyparse): Reduce the scope of yylhs.
* tests/c++.at: We now pass this test.
2013-11-15 Akim Demaille
tests: check $$'s destruction with variant, YYERROR, and no error recovery
When variant are enabled, the yylhs variable (the left-hand side of
the rule being reduced, i.e. $$ and @$) is explicitly destroyed when
YYERROR is called. This is because before running the user code, $$
is initialized, so that the user can properly use it.
However, when quitting yyparse, yylhs is also reclaimed by the C++
compiler: the variable goes out of scope.
This was not detected by the test suite because (i) the Object tracker
was too weak, and (ii) the problem does not show when there is error
recovery.
Reported by Paolo Simone Gasparello.
* tests/c++.at (Exception safety): Improve the objects logger to make
sure that we never destroy twice an object.
Also track copy-constructors.
Use a set instead of a list.
Display the logs before running the function body, this is more
useful in case of failure.
Generalize to track with and without error recovery.
2013-11-15 Akim Demaille
tests: simplify useless obfuscation
* tests/c++.at: $$ is not special for M4, there is no need to "escape"
it.
2013-11-14 Akim Demaille
skeletons: use better names when computing a "goto"
* data/glr.c (yyLRgotoState): Name the symbol argument yysym, instead
of yylhs.
* data/lalr1.cc (yy_lr_goto_state_): Likewise.
* data/lalr1.java (yy_lr_goto_state_): New, modeled after the previous
two routines.
Use it.
2013-11-12 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-11-12 Akim Demaille
version 3.0.1
* NEWS: Record release date.
2013-11-12 Akim Demaille
aver: it is no longer "protected against NDEBUG"
Apply the same rules for aver as for assert: no side effects,
especially not important ones.
* src/AnnotationList.c, src/muscle-tab.c: Adjust aver uses to resist
to -DNDEBUG.
2013-11-08 Akim Demaille
parsers: rename YY_NULL as YY_NULLPTR to avoid conflicts with Flex
Flex also defines YY_NULL (to 0). Avoid gratuitous conflicts.
* data/c.m4 (b4_null_define): Rename YY_NULL as YY_NULLPTR.
* data/glr.c, data/lalr1.cc, data/location.cc, data/variant.hh,
* data/yacc.c, src/parse-gram.c, tests/actions.at, tests/c++.at,
* tests/cxx-type.at, tests/glr-regression.at, tests/headers.at,
* tests/push.at, tests/regression.at:
Adjust.
2013-11-05 Akim Demaille
build: use Automake 1.14's non-recursive Makefile features
* configure.ac: Require Automake 1.14.
* examples/calc++/local.mk, examples/local.mk, examples/mfcalc/local.mk,
* examples/rpcalc/local.mk, tests/local.mk: Use %D% and %C%.
2013-11-05 Akim Demaille
build: restore maintainer-push-check
* tests/local.mk: here.
2013-11-05 Akim Demaille
c++: use __attribute__((__pure__)) to avoid warnings
Building C++ parsers with -Wsuggest-attribute=const and
-Wsuggest-attribute=noreturn triggers warning in generated code.
* data/lalr1.cc: Call b4_attribute_define.
(debug_stream, debug_level): Flag as pure.
* tests/headers.at (Several parsers): There are now more YY macros
that "leak".
2013-11-05 Akim Demaille
skeletons: update the handling of compiler attributes
* data/c.m4 (b4_attribute_define): Instead of defining __attribute__,
define YY_ATTRIBUTE conditionally.
(YY_ATTRIBUTE_PURE, YY_ATTRIBUTE_UNUSED, _Noreturn): New.
Use them.
* data/glr.c: Use them.
2013-11-05 Akim Demaille
gnulib: update
2013-10-24 Akim Demaille
style: use /* ... */ comments
* src/complain.c: Here.
2013-10-24 Akim Demaille
tests: skip C++ tests that are too demanding for some compilers
Some tests now fail when compiled with G++ 4.3 or 4.4 on MacPorts.
* tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): New.
* tests/c++.at (Exception safety): Use it.
2013-10-22 Akim Demaille
install: do not install yacc.1 when --disable-yacc
* configure.ac (ENABLE_YACC): New conditional.
(YACC_SCRIPT, YACC_LIBRARY): Remove.
* lib/local.mk, src/local.mk: Use the former instead of the latter.
* doc/local.mk: Use ENABLE_YACC to avoid installing yacc.1.
2013-10-22 Akim Demaille
style: avoid tabs
* src/scan-code.l: here.
2013-10-22 Akim Demaille
c++: fix generated doxygen comments
* configure.ac: Enable -Wdocumentation if supported.
* data/lalr1.cc: Fix comments.
2013-10-22 Akim Demaille
fix: uniqstr are already pointers
* src/uniqstr.c (uniqstr_assert): Remove incorrect double indirection,
and now useless cast.
2013-10-22 Paul Eggert
bison: pacify Sun C 5.12
* src/scan-code.l (show_sub_message):
Redo initializations to work around a bogus Sun C 5.12 warning.
(parse_ref): Remove unreachable code that Sun C 5.12 complains about.
* src/uniqstr.h (uniqstr_vsprintf): Use
_GL_ATTRIBUTE_FORMAT_PRINTF (...) instead of __attribute__
((__format__ (__printf__, ...))). Otherwise, Sun C 5.12
complains about an unknown attribute.
2013-10-22 Paul Eggert
maint: git now ignores rpcalc
* examples/rpcalc/.gitignore: Ignore rpcalc.
2013-10-22 Paul Eggert
build: examples/calc++/calc++ requires flex
* configure.ac (FLEX_CXX_WORKS): New AM_CONDITIONAL.
* examples/calc++/local.mk (examples/calc++/calc++):
Build if FLEX_CXX_WORKS, not BISON_CXX_WORKS.
2013-10-22 Paul Eggert
maint: mention help2man, texinfo, apt-get
* README-hacking: Add help2man, texinfo.
Describe how to add packages if you're using Debian.
2013-10-22 Paul Eggert
maint: git now ignores .log and .trs files
* .gitignore: Add *.log, *.trs.
2013-10-21 Akim Demaille
tests: fix incorrect object construction
Reported by Ken Moffat.
http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00009.html
* tests/c++.at (Exception safety): Here.
2013-10-16 Akim Demaille
glr: allow spaces between "%?" and "{" in predicates
Reported by Rici Lake.
http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html
http://stackoverflow.com/questions/19330171/
* src/scan-gram.l: Do not try to be too smart when diagnosing invalid
directives.
* tests/glr-regression.at (Predicates): New test.
2013-10-16 Akim Demaille
diagnostics: "-Werror -Wno-error=foo" must not emit errors
Currently "-Werror -Wno-error=foo" still turns "foo" warnings into errors.
Reported by Alexandre Duret-Lutz.
See http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html.
* src/complain.c (errority, errority_flag): New.
(complain_init): Initialize the latter.
(warning_argmatch): Extract the loop iterating on the flag's bits.
Set and unset errority_flag here.
(warnings_argmatch): -Wno-error is not the same as -Wno-error=everything:
we must remember if category foo was explicitly turned in an error/warning
via -W(no-)error=foo.
(warning_severity): Use errority_flag.
* tests/input.at (Symbols): Just check --yacc, not -Wyacc, that's the
job of tests on -W.
(-Werror is not affected by -Wnone and -Wall): Rename as...
(-Werror combinations): this.
Tests more combinations of -W, -W(no-)error, and -W(no-)error=foo.
* tests/local.at (AT_BISON_CHECK_WARNINGS): Don't expect -Werror
to turn runs that issue warnings into runs with errors, as the
warnings might be enforced as warnings by -Wno-error=foo, in which
case -Werror does not change anything.
* doc/bison.texi (Bison Options): Try to be clearer about how
-W(no-)error and -W(no-)error=foo interact.
2013-10-16 Akim Demaille
comment changes
* src/complain.h, src/complain.c: More documentation, more comments.
2013-10-04 Andreas Schwab
location: fix EOF check
* location.c (location_caret): Use int, not char, for values from
getc.
2013-09-19 Akim Demaille
style: variant: remove empty line
* data/variant.hh (b4_symbol_constructor_define_): Remove
stray eol.
2013-09-19 Akim Demaille
glr: more assertions
* data/glr.c (yyaddDeferredAction, yyglrShiftDefer, yypdumpstack):
More assertions.
2013-09-19 Akim Demaille
glr: shorten scopes
* data/glr.c (yyglrReduce): Define yyflag with its value.
2013-09-19 Akim Demaille
glr: formatting changes
* data/glr.c: here.
2013-09-19 Akim Demaille
glr: better use of tracing macros
* data/glr.c (yydestroyGLRState): Use YY_SYMBOL_PRINT instead of
yy_symbol_print.
2013-09-19 Akim Demaille
examples: improve the output of the "variant" example
* examples/variant.yy: Improve the printing of lists.
2013-09-19 Akim Demaille
variant: remove useless assertion
* data/variant.hh (move): Remove precondition assertion which is
ensured by the first call of the body (this precondition is also one
of "build").
2013-09-19 Akim Demaille
tests: remove stray debugging traces
* tests/atlocal.in: Remove traces.
Be ready to remove conftest.dSYM generated on OS X.
2013-09-04 Akim Demaille
tests: do not use grep -q
Reported by Daniel Galloway.
http://lists.gnu.org/archive/html/bug-bison/2013-08/msg00020.html
* tests/java.at: Ignore grep's output instead.
2013-08-25 Paul Eggert
build: don't require flex for ordinary builds
* configure.ac (LEX): Don't fail if this is lex, as flex is not
required for ordinary builds. Instead, issue a warning and
substitute a no-op LEX. Reported by Michael Felt in
.
2013-08-25 Paul Eggert
maint: update .gitignore
* .gitignore: Add *.eps, *.o, *.pdf, *.png, *.stamp, *~,
.deps, .dirstamp. Needed to suppress unwanted chatter from
'git status' after a bootstrap build.
2013-08-24 Paul Eggert
build: port to pre-5.8.7 perl
* examples/local.mk (extract): Omit -f from perl options.
This doesn't work with perl versions before 5.8.7
that are configured without USE_SITECUSTOMIZE.
Reported by Michael Felt in
.
2013-08-01 Akim Demaille
tests: minor change to make it easier to test other skeletons
* tests/c++.at (Variants): Pass the skeleton as argument.
2013-08-01 Valentin Tolmer
uniqstr: fix assertion
* src/uniqstr.c (uniqstr_assert): Really make sure str is a uniqstr,
not just whether some uniqstr with the same content was registered.
2013-08-01 Akim Demaille
build: ship the ASCII art figures
We don't ship the *.txt files that are used to build the info
file.
Reported by Colin Daley.
* doc/figs/example.txt: New.
* doc/local.mk (bison.info): Depend on the txt files.
And ship them.
2013-08-01 Akim Demaille
doc: prefer the ".gv" extension to ".dot"
See http://marc.info/?l=graphviz-devel&m=129418103126092 for the
motivation (basically, some word processor now uses *.dot).
* doc/figs/example-reduce.dot: Rename as...
* doc/figs/example-reduce.gv: this.
* doc/figs/example-shift.dot: Rename as...
* doc/figs/example-shift.gv: this.
* doc/figs/example.dot: Rename as...
* doc/figs/example.gv: this.
* doc/local.mk: Adjust.
2013-07-25 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-07-25 Akim Demaille
version 3.0
* NEWS: Record release date.
2013-07-25 Akim Demaille
regen
2013-07-25 Akim Demaille
news: prepare 3.0
* NEWS (3.0): Reorder.
2013-07-25 Akim Demaille
tests: fix invalid assignment when using variants in C++11
* tests/c++.at (Exception safety): In variant mode $$ is an instance
of Object. Assigning YY_NULL in C++98 is incorrect, but behaves ok,
as it assigns YY_NULL=0 using Object::operator= (char v). It is wrong
in C++11 as there is operator for "$$ = nullptr".
2013-07-25 Akim Demaille
yacc: beware of "uninitialized uses" warnings
Again some issues with the fact that yylval is reported by GCC as
possibly not initialized in some cases. Here, the case at hand is the
%destructor.
I am still not convinced that it is worth going all the trouble of
using pragmas to disable temporarily some warnings, instead of just
initializing the looking symbol once for all, but that's what Paul
voted for, see
.
* data/c.m4 (b4_attribute_define): Define
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END,
YY_INITIAL_VALUE here, as we will need them in the generation of the
destructor function, which is defined in yacc.c before yyparse, which
was in charge of defining these macros.
* data/yacc.c (b4_declare_scanner_communication_variables): Simplify:
trying to factor the definitions of the case pure and impure is
too complex.
Actually, it is not even clear that this macro should really exist,
as even the calls are complex.
Be careful not to issue a lone ";", as this is a statement, and C90
forbids declarations after statements ; so write
"YY_INITIAL_VALUE(Decl;)", not "YY_INITIAL_VALUE(Decl);".
2013-07-25 Akim Demaille
gnulib: update
2013-07-03 Akim Demaille
tests: skip C++ tests if we can't compile a simple program
There are possible conflicts between gnulib replacement functions (in
) and their C++ wrappers (in ). Trying to address
these in configure seems too hard, and I don't know how to fix the issue
in gnulib. Cowardly avoid the problem by skipping C++ tests when this
happens.
Reported by Stefano Lattarini.
http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html
* tests/atlocal.in (BISON_CXX_WORKS): Also set it to "skip" if we can't
compile a simple program using .
* tests/local.at: Comment changes.
2013-07-03 Akim Demaille
tests: fix 'find' portability issues
Reported by Stefano Lattarini.
http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00000.html
* tests/output.at (AT_CHECK_OUTPUT): Use Perl instead.
2013-06-24 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-06-24 Akim Demaille
version 2.7.91
* NEWS: Record release date.
2013-06-24 Akim Demaille
NEWS: prepare for 2.7.91
* NEWS (2.7.91): Java push parsers.
2013-06-24 Akim Demaille
java: rename YYMORE as YYPUSH_MORE for consistency with C
http://lists.gnu.org/archive/html/bison-patches/2013-06/msg00008.html
* data/lalr1.java, doc/bison.texi, tests/javapush.at:
s/YYMORE/YYPUSH_MORE.
2013-06-21 Akim Demaille
tests: fix Java push failure when running with BISON_USE_PUSH_FOR_PULL
* tests/javapush.at (Trivial Push Parser with api.push-pull verification):
When push for pull is enabled, there is one such function generated.
2013-06-21 Akim Demaille
style: minor changes in the Java tests
* tests/java.at (AT_CHECK_JAVA_GREP): Ignore the exit status.
* tests/javapush.at (AT_CHECK_JAVA_GREP): Be more alike the previous
one.
Formating changes.
Remove stray debugging "jj" file.
2013-06-21 Akim Demaille
java: push: do not reset the error counter
* data/lalr1.java (parse): here, when in push-pull is in "both" mode.
This breaks the test suite, for instance
make check TESTSUITEFLAGS='-d 388 BISON_USE_PUSH_FOR_PULL=1'.
More generally make maintainer-push-check.
2013-06-14 Akim Demaille
build: add Valgrind suppression file for GNU/Linux
* build-aux/linux-gnu.valgrind: New.
* build-aux/local.mk: Ship it.
* configure.ac: Use it.
2013-06-13 Dennis Heimbigner
java: add push-parser support
* data/lalr1.java: Capture the declarations as m4 macros to avoid
duplication. When push parsing, the declarations occur at the class
instance level rather than within the parse() function.
Change the way that the parser state is initialized. For
push-parsing, the parse state declarations are moved to
"push_parse_initialize()", which is called on the first invocation of
"push_parse()". The %initial-action code is also inserted after the
invocation of "push_parse_initialize()".
The body of the parse loop is modified to return values at appropriate
points when doing push parsing. In order to make push parsing work,
it is necessary to divide YYNEWSTATE into two states: YYNEWSTATE and
YYGETTOKEN. On the first call to push_parse(), the state is
YYNEWSTATE. On all later entries, the state is set to YYGETTOKEN. The
YYNEWSTATE switch arm falls through into YYGETTOKEN. YYGETTOKEN
indicates that a new token is potentially needed. Normally, with a
pull parser, this new token would be obtained by calling "yylex()". In
the push parser, the value YYMORE is returned to the caller. On the
next call to push_parse(), the parser will return to the YYGETTOKEN
state and continue operation.
* tests/javapush.at: New test file for java push parsing.
* tests/testsuite.at: Use it.
* tests/local.mk: Adjust.
* doc/bison.texi (Java Push Parser Interface): New.
2013-06-11 Akim Demaille
build: ship all the files, even if the C++ compiler is broken
* examples/calc++/local.mk: Be sure to ship calc++.test even if
the current C++ compiler is not sufficient to run the tests.
2013-06-05 Dennis Heimbigner
style: comment changes in Java skeleton
* data/lalr1.java: Here.
2013-06-03 Akim Demaille
tests: fix a G++ warning
* tests/c++.at: Use YY_NULL instead of 0 for the null pointer.
And formatting changes.
2013-06-03 Akim Demaille
build: fix a warning from clang
* src/muscle-tab.c: Declare local functions static.
2013-05-30 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-05-30 Akim Demaille
version 2.7.90
* NEWS: Record release date.
2013-05-30 Akim Demaille
style: syntax-check fixes
* data/yacc.c, src/Sbitset.c, src/Sbitset.h, src/muscle-tab.h,
* src/output.c, src/parse-gram.y, src/reader.c, src/symtab.c,
* src/uniqstr.c, src/uniqstr.h: Fix space before parens.
* cfg.mk (_space_before_paren_exempt): Add needed exceptions.
2013-05-30 Akim Demaille
xml: use %empty in the text output
* data/xslt/xml2text.xsl: here.
2013-05-30 Akim Demaille
build: locally disable new GCC warnings that fail on Flex generated code
* configure.ac: here.
2013-05-30 Akim Demaille
fix a memory leak
* src/print-xml.c (num_escape_bufs): New.
(print_xml): Be sure to release all the escape_bufs.
2013-05-30 Akim Demaille
regen
2013-05-30 Akim Demaille
build: be sure to include config.h first in the generated parser
Using %code for config.h is wrong, as some headers will already have
been included by Bison. In some cases, e.g., glibc's string.h, this
results in some declaration not being made for lack of definition of
_GNU_SOURCE, which is performed by config.h.
* src/parse-gram.y: here.
2013-05-29 Akim Demaille
Merge remote-tracking branch 'origin/maint'
* origin/maint:
maint: post-release administrivia
version 2.7.1
regen
2013-05-29 Petr Machata
drop unused options --raw, -n, -e, --include and -I
* --raw appears to be ignored. It was marked as obsolete in the
commit ec3bc39, and documented as no longer supported as of 1.29
(2001-09-07). Support for %raw appears to have been dropped in
e9955c83 on 2002-06-11, but --raw was kept around. Maybe it's time
to drop it as well?
* Commit e9955c83 dropped support for %no-parser as well, and
converted it to option. --no-parser was later dropped in 728c4be2
on 2007-08-12, but -n was kept around, probably as an omission. All
three are documented as removed since 2.3b (2008-05-27).
* -e existed for a single day in 2001. It was introduced in eeeb962b
on 2001-11-27. The handling was removed in c7925b99 on 2001-11-28,
but "e" was kept in the list of short options. Probably an
omission.
* --include appears to be dead code. The option sets a variable, but
that variable is not used anywhere. It was added in f6bd5427 on
2001-11-26 as a %-directive, with comments that it's not yet
implemented. It was converted to a command-line option later, but
doesn't seem to ever have been actually implemented.
2013-05-28 Akim Demaille
gnulib: update
2013-04-22 Akim Demaille
diagnostics: always point to the first directive
Some directives cannot be used several times (e.g., a given symbol may
only have a single printer). In case of repeated definitions, an
error is issued for the second definition, yet it is not discarded,
and becomes the definition used for the rest of the file.
This is not consistent with the idea that multiple definitions are not
allowed: discard any repeated directive.
* src/symtab.c (symbol_type_set, symbol_code_props_set)
(semantic_type_code_props_set, symbol_class_set, symbol_translation):
Discard repeated directives.
* tests/input.at (Default %printer and %destructor redeclared)
(Per-type %printer and %destructor redeclared): Update expectations.
2013-04-22 Akim Demaille
tests: factor test for printer/desctructor redefined
* tests/input.at (Default %printer and %destructor redeclared):
Introduce AT_TEST to factor.
2013-04-22 Akim Demaille
diagnostics: use appropriate location for useless precedence/associativity
* src/symtab.c (symbol_precedence_set): Use prec_location, not
location (which is the first occurrence of the symbol, possibly just
%token).
Also, as redefinitions are not allowed, keep the first values, not
the subsequent ones.
* tests/conflicts.at, tests/existing.at, tests/regression.at: Adjust.
2013-04-22 Akim Demaille
tests: factor duplicate expected warnings
* tests/existing.at: Instead of "t ? abc : aBc", write "a(t?b:B)c".
2013-04-19 Akim Demaille
tests: enable -Wsign-compare and fix corresponding warnings
-Wsign-compare was disabled for bison's own code, following gnulib's
approach. However, the generated parsers should not trigger such
warnings.
Reported by Efi Fogel.
http://lists.gnu.org/archive/html/help-bison/2013-04/msg00018.html
See also http://stackoverflow.com/questions/16101062 for the weird
"-(unsigned)i" piece of code.
* configure.ac (warn_tests): Enable -Wsign-compare.
* data/location.cc (position::add_): New.
(position::lines, position::columns): Use it.
* tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): Fix signedness issues.
2013-04-18 Akim Demaille
muscle: check more cases of %define variables with code values
* data/bison.m4 (b4_percent_define_check_kind): Fix overquotation.
(api.location.type, api.position.type): Check they have code values here.
* data/c++.m4 (api.location.type): No longer checked here.
(parser_class_name): Check it here.
* data/java.m4 (api.value.type, init_throws, lex_throws, parser_class_name)
(throws, annotations, extends, implements): Check they have code values.
* doc/bison.texi: Fix every incorrect occurrence of %define.
Document the additional syntax for %define: code values.
Document the additional syntax for -D/-F: string and code values.
* tests/calc.at, tests/headers.at, tests/input.at, tests/java.at,
* tests/local.at: Fix dependencies.
2013-04-18 Akim Demaille
regen
2013-04-18 Akim Demaille
parser: do not convert $ and @ in code values of %define variables
* src/parse-gram.y (value: "{...}"): Just strip the braces, but pass
the value as is.
2013-04-18 Akim Demaille
parser: no longer use the "braceless" non-terminal
The purpose of this symbol was only to factor function calls. As a
result the actions were indeed simpler, but the grammar was somewhat
uselessly obfuscated. Get rid of this symbol, but introduce functions
to simplify dependencies.
There is no (intended) changes of behavior here.
* src/parse-gram.y (strip_braces, translate_code(
(translate_code_braceless): New.
(braceless): Remove, use "{...}" instead, and one of the previous
functions depending on the context.
(STRING, "%{...%}", EPILOGUE): Declare as , instead of ,
the difference between both is useless (well, I couldn't make sense of
it, even after having read the initial commit that introduced them).
(%union): Remove the now useless "chars" type.
Adjust the printers.
* src/scan-gram.l: Adjust.
2013-04-18 Akim Demaille
regen
2013-04-18 Akim Demaille
style: avoid %{...%} in our parser
* src/parse-gram.y (%{...%}): Split in %code and %code requires.
* src/location.h: Add missing includes for self containedness.
2013-04-18 Akim Demaille
style: use %code for local function declarations in our parser
* src/parse-gram.y (version_check, gram_error, char_name, lloc_default):
Move their prototypes from %{...%} to %code.
(YYLLOC_DEFAULT, YY_LOCATION_PRINT): Move from %{...%} to %code.
(current_lhs): Move its implementation to the epilogue.
2013-04-16 Akim Demaille
regen
2013-04-16 Akim Demaille
muscle: check the kind of api.prefix, api.location.type
* data/bison.m4: Check api.prefix.
* data/c++.m4: Check api.location.type.
* doc/bison.texi: Fix uses of api.value.type, api.prefix, api.location.type.
Document {...} values for %define.
* src/parse-gram.y: Fix use of api.prefix.
* tests/calc.at: Fix uses of api.location.type.
* tests/input.at: Check api.prefix, and api.location.type.
2013-04-15 Akim Demaille
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-04-15 Akim Demaille
version 2.7.1
* NEWS: Record release date.
2013-04-15 Akim Demaille
regen
2013-04-15 Akim Demaille
muscle: enforce definition syntax for keyword variables
* src/muscle-tab.c (muscle_percent_define_get_kind)
(muscle_percent_define_check_kind): New.
(muscle_percent_define_default): Variables with a default value are
of "keyword" kind.
(muscle_percent_define_flag_if, muscle_percent_define_check_values):
Check that the variable is of keyword kind.
* data/bison.m4: Likewise, but in M4. That is to say...
(b4_percent_define_default): Define the kind when the variable is undefined.
(b4_percent_define_check_kind): Use a better error message.
(_b4_percent_define_check_values, _b4_percent_define_check_values):
Former "enum" variables should be defined using the keyword syntax.
* doc/bison.texi: Update.
A couple of fixes.
* tests/input.at (%define keyword variables): New.
2013-04-15 Akim Demaille
muscle: let -D/-F support the three kinds of %define variable values
See http://lists.gnu.org/archive/html/bison-patches/2013-04/msg00012.html
* src/getargs.c (getargs): Recognize {value} and "value" for -D and -F.
2013-04-15 Akim Demaille
muscle: minor refactoring
* src/muscle-tab.c (muscle_percent_define_default): Reduce the scopes.
2013-04-15 Akim Demaille
muscle: minor simplification which uncovers a missing warning
* src/muscle-tab.c (muscle_percent_define_ensure): Discover the virtues
of || to factor conditionals.
* NEWS: As api.pure is no longer flagged as "used" by accident,
we now have warnings for useless definitions.
* tests/calc.at: So remove api.pure settings when running C++ tests,
since C++ skeletons use a pure interface.
2013-04-15 Akim Demaille
muscle: factor the field retrieval
* src/muscle-tab.c (muscle_percent_define_get_raw): New.
Use it where appropriate.
(location_decode): No longer fetch the value from the table,
take the value as argument.
2013-04-15 Akim Demaille
muscle: factor the handling of used variables
* src/muscle-tab.c (muscle_percent_define_use): New, corresponding
to b4_percent_define_use.
Use it where appropriate.
2013-04-15 Akim Demaille
muscle: factor the computation of variable names
* src/muscle-tab.c (muscle_name): New.
Use it.
Propagate "uniqstr" as value type instead of plain "char const *".
2013-04-15 Akim Demaille
muscle: factor the kind check in M4
* data/bison.m4 (b4_percent_define_check_kind): New.
Use it to check api.token.prefix.
* data/c++.m4: Check the kind of api.namespace.
* doc/bison.texi: Update a reference to former 'namespace' variable.
* tests/input.at ("%define" code variables): Check api.namespace.
2013-04-15 Akim Demaille
muscle: factor conditionals on defined %define variables
* data/bison.m4 (b4_percent_define_ifdef_): New.
Use it where appropriate.
2013-04-11 Akim Demaille
api.token.prefix: use code values
* data/bison.m4: Remove useless (and incorrect: m4_* instead of b4_*)
default assignment to api.token.prefix.
Check that api.token.prefix is assigned code.
* tests/input.at (%define code variables): New test.
* NEWS, doc/bison.texi, tests/c++.at, tests/calc.at,
* tests/java.at, tests/local.at: Adjust to use braces.
2013-04-11 Akim Demaille
c++: fix several issues with locations
Reported by Daniel Frużyński.
http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html
* data/location.cc (position::columns, position::lines): Check for
underflow.
Fix some weird function signatures.
(location): Accept signed integers as arguments where appropriate.
Add operator- and operator+=.
* doc/bison.texi (C++ position, C++ location): Various fixes
and completion.
* tests/c++.at (C++ Locations): New tests.
2013-04-11 Akim Demaille
muscles: be sure that %code snippets are not glue together on a single line
Recently "braceless" in the parser was changed so that an eol was no
longer added to the value. This is not correct when a %code is used
multiple times, because the syncline of the next snippet might be
appended to the last (and not ended) line of the previous snippet.
* src/muscle-tab.h (muscle_grow): Make it private.
* src/muscle-tab.c (muscle_grow): Accept a fourth argument: a required
terminator.
Adjust callers.
* tests/input.at (Multiple %code): New.
2013-04-11 Akim Demaille
style: fix comments
* tests/actions.at: Fix incorrect "prototype".
2013-04-10 Akim Demaille
Merge remote-tracking branch 'origin/maint'
* origin/maint:
glr.cc: fix a clang warning
maint: update copyright years
build: fix VPATH issue
build: avoid clang's colored diagnostics in the test suite
tests: please clang and use ".cc", not ".c", for C++ input
gnulib: update
skeletons: avoid empty switch constructs
lalr1.cc: fix compiler warnings
yacc.c: do not use __attribute__ unprotected
tests: style changes
2013-04-09 Akim Demaille
api.value.type: use keyword/brace values
Suggested by Joel E. Denny.
http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html
* data/bison.m4 (b4_percent_define_get_kind): New.
(b4_variant_flag): Check that api.value.type is defined as the 'variant'
keyword value.
* data/c.m4 (_b4_value_type_setup_keyword): New.
(b4_value_type_setup): Use it to simplify reading.
Use b4_define_silent.
Decode api.value.type, including its type.
(b4_value_type_define): Likewise.
* data/c++.m4 (b4_value_type_declare): Adjust the decoding of api.value.type,
taking its kind into account.
* doc/bison.texi: Adjust all the examples to the new syntax.
* NEWS: Ditto.
* tests/types.at: Adjust
2013-04-09 Akim Demaille
api.value.type: diagnose guaranteed failure with --yacc
Instead of generating invalid C code, generate an error when --yacc and
'%define api.value.type union' are used together.
* data/bison.m4: Issue an error in this case.
* tests/types.at (%yacc vs. %define api.value.type union): New, check this
error.
* doc/bison.texi (Type Generation): Document it.
* tests/output.at: Check that '-o y.tab.c' and '-y' behave equally
wrt generated file names.
* NEWS (Use of YACC='bison -y'): New.
Promote the use of 'bison -o y.tab.c'.
2013-04-09 Akim Demaille
doc: style changes
* doc/bison.texi (Destructor Decl, Printer Decl): Group series of %token
and %type together.
2013-04-09 Akim Demaille
doc: display locations in error as recommended by GNU Coding Standards
* doc/bison.texi (Actions and Locations): here.
2013-04-09 Akim Demaille
doc: api.value.type union
* doc/bison.texi (Type Generation): New section.
(Multi-function Calc): Convert to use api.value.type=union.
2013-04-09 Akim Demaille
doc: move the section about "%union" where types are discussed
* doc/bison.texi (Union Decl): Move to...
(Defining Language Semantics): here.
2013-04-09 Akim Demaille
doc: deprecate #define YYSTYPE in favor of %define api.value.type
* doc/bison.texi: Convert examples with YYSTYPE to use api.value.type.
Deprecate YYSTYPE.
2013-04-09 Akim Demaille
value type: accept "->" in type tags
Provide a means to dereference pointers when defining tags. One
example could be:
%code requires
{
typedef struct ListElementType
{
union value
{
int intVal;
float floatVal;
char* charptrVal;
} value;
struct ListElementType* next;
} ListElementType;
}
%union
{
ListElementType* list;
}
%token value.charptrVal> STRING
%token value.intVal> INTEGER
%token value.floatVal> REAL
%type ElementList LiteralType
* src/scan-code.l, src/scan-gram.l: Accept "->" in tags.
* tests/types.at: Add more test cases to cover this case.
2013-04-09 Akim Demaille
style: simplify the scanning of type tags
* src/scan-gram.l: Remove the rule for simple tags: the "complex" case
subsumes it. It was more efficient, but duplicated the code for a
negligible benefit.
2013-04-09 Akim Demaille
api.value.type: implement proper support, check, and document
* data/c.m4 (b4_symbol_type_register, b4_type_define_tag)
(b4_symbol_value_union, b4_value_type_setup_union)
(b4_value_type_setup_variant, b4_value_type_setup):
New.
(b4_value_type_define): Use it to set up properly the type.
Handle the various possible values of api.value.type.
* data/c++.m4 (b4_value_type_declare): Likewise.
* data/lalr1.cc (b4_value_type_setup_variant): Redefine.
* tests/types.at: New.
Exercise all the C/C++ skeletons with different types of
api.value.type values.
* tests/local.mk, tests/testsuite.at: Use it.
* doc/bison.texi (%define Summary): Document api.value.type.
* NEWS: Advertise it, together with api.token.constructor.
2013-04-09 Akim Demaille
m4: allow the definition of side-effect only macros
* data/bison.m4 (b4_divert_kill, b4_define_silent): New.
* data/c.m4: Comment change.
2013-04-09 Akim Demaille
variant: fix inconsistent quotation
* data/variant.hh (b4_char_sizeof): De-overquote.
(b4_value_type_declare): De-underquote.
2013-04-09 Akim Demaille
m4: style changes in error messages
* data/bison.m4: Use $0 to denote the current macro's name.
2013-04-08 Akim Demaille
glr.cc: fix a clang warning
* data/glr.cc (b4_epilogue): Be sure to end with an end-of-line,
so that the file does end with one.
2013-04-08 Akim Demaille
maint: update copyright years
Run "make update-copyright".
2013-04-08 Akim Demaille
build: fix VPATH issue
* Makefile.am (update-b4-copyright, update-package-copyright-year): Fix
path to build-aux.
2013-04-08 Akim Demaille
build: avoid clang's colored diagnostics in the test suite
The syncline tests, which try to recognize compiler diagnostics,
are confused by escapes for colors.
* configure.ac (warn_tests): New, to factor the warnings for both
C and C++ tests.
Add -fno-color-diagnostics to it.
* tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue
together compiler flags.
2013-04-08 Akim Demaille
tests: please clang and use ".cc", not ".c", for C++ input
When fed with foo.c, clang++ 3.2 answers:
clang: error: treating 'c' input as 'c++' when in C++ mode,
this behavior is deprecated
* tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh
for C++.
2013-04-08 Akim Demaille
gnulib: update
2013-04-08 Akim Demaille
skeletons: avoid empty switch constructs
Reported by Rob Conde.
http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html
* data/c.m4 (b4_symbol_actions): Rename as...
(_b4_symbol_actions): this.
(b4_symbol_actions): New wrapper.
Do not emit empty switches.
Adjust all b4_symbol_actions callers.
2013-04-08 Akim Demaille
lalr1.cc: fix compiler warnings
Reported by Rob Conde.
http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html
* data/stack.hh (operator=, stack(const stack&)): Make this class
uncopyable, i.e., "undefine" these operators: make them private and
don't implement them.
(clear): New.
* data/lalr1.cc: Use it instead of an assignment.
(parser): Make this class uncopyable.
2013-04-08 Akim Demaille
yacc.c: do not use __attribute__ unprotected
Reported by Victor Khomenko.
http://lists.gnu.org/archive/html/bug-bison/2013-04/msg00001.html
* data/glr.c (YYUSE, __attribute__): Fuse their definition into...
* data/c.m4 (b4_attribute_define): this new macro.
* data/yacc.c, data/glr.c: Use it.
2013-04-05 Akim Demaille
api.namespace: demonstrate and use {...} values instead of "..." values
* tests/c++.at, tests/input.at: Use "%define api.namespace {foo}" instead
of using quotes.
* tests/local.at (AT_SETUP_STRIP, AT_NAME_PREFIX): Recognize uses of
braces instead of quotes.
* doc/bison.texi: Use braces for api.namespace's values.
2013-04-05 Akim Demaille
grammar: do not add a \n at the end of blocks of code
Now that we use "braceless" (which is {...} blocks of code with
initial and final braces stripped) to denote "short" values (such as
api.namespaces), the added end-of-line is a nuisance. As a matter of
fact, this extra-safety was useless, as every expansion of "braceless"
(aka, "user code") is followed by an end of line.
* src/parse-gram.y, src/parse-gram.c (braceless): Instead of replacing
the final brace by \n, just delete the brace.
2013-04-04 Akim Demaille
regen
2013-04-04 Akim Demaille
grammar: record the kind of %define variable values
Provide a means to tell the difference between "keyword" values (e.g.,
%define api.pull both), "string" values (e.g., %define file.name
"foo"), and "code" values (e.g., %define api.namespace {calc}).
Suggested by Joel E. Denny.
http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html
* src/muscle-tab.h, src/muscle-tab.c (muscle_kind, muscle_kind_new)
(muscle_kind_string): New.
(muscle_percent_define_insert): Take the kind as new argument.
Insert it in the muscle table.
Adjust callers.
* src/getargs.c: Adjust callers.
* src/parse-gram.y: Ditto.
(content.opt): Remove, replaced by...
(value): this new non-terminal, whose semantics value is stored
in the new "value" union member.
Provide a printer.
Support values in braces in additions to keyword and string values.
fuse me
2013-04-04 Akim Demaille
style: fix comments
* src/muscle-tab.c (muscle_percent_define_ensure): Update obsolete
comments.
2013-04-04 Akim Demaille
regen
2013-04-04 Akim Demaille
grammar: style changes
* src/parse-gram.y (PARAM_TYPE): Remove useless typedef guard.
There's a header guard.
Use 'yyo' with %printer.
Use a consistent style for %union one-liners.
2013-04-04 Akim Demaille
grammar: split %union to group together related aspects
* src/parse-gram.y (INT): Fuse the %type and %token declaration.
Move its %union right before its introduction.
(%union): Split in several %unions, right before their use.
2013-04-04 Akim Demaille
muscle: refactor
* src/muscle-tab.c (muscle_lookup, muscle_entry_new): New.
(muscle_insert, muscle_grow, muscle_find_const, muscle_find): Use them.
2013-04-03 Akim Demaille
style: comment changes
* src/muscle-tab.c: Move the documentation of public functions to...
* src/muscle-tab.h: here.
Fix comment consistency issues.
2013-04-03 Akim Demaille
muscle: minor refactoring
* src/muscle-tab.h (MUSCLE_INSERT_C_STRING): Use MUSCLE_INSERT_STRING.
2013-03-06 Akim Demaille
regen
2013-03-06 Valentin Tolmer
gram: correct token numbering in precedence declarations
In a precedence declaration, when tokens are declared with a litteral
character (e.g., 'a') or with a identifier (e.g., B), Bison behaved
differently: the litteral tokens would be numbered first, and then the
other ones, leading to the following grammar:
%right A B 'c' 'd'
being numbered as such: 'c' 'd' A B.
* src/parse-gram.y (symbol.prec): Set the symbol number when reading the
symbols.
* tests/conflicts.at (Token declaration order: literals vs. identifiers):
New.
2013-03-04 Akim Demaille
maint: update autoconf submodule
* submodules/autoconf: Up to master.
No significant changes in the files we use (m4sugar.m4 and foreach.m4).
2013-03-04 Akim Demaille
diagnostics: no longer include the yacc category in -Wall
It would be a pity to warn the users against Bison features...
http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00107.html
* src/complain.h, src/complain.c (Wall): Disable Wyacc.
(Weverything): New (hidden so far) category which really denotes all
the categories (what used to be Wall).
(warnings_args, warnings_types): Adjust.
(warning_argmatch): Now !none = Weverything and conversely, no longer Wall.
* NEWS, doc/bison.texi, src/getargs.c: Adjust the documentation.
* tests/input.at (-Werror is not affected by -Wnone and -Wall): Adjust
by not using a -Wyacc type of warning.
2013-03-04 Akim Demaille
grammar: no longer detect and cure missing semicolon at end of actions
Bison 3.0 is already breaking backward compatibility with other
features. It is an appropriate time to drop this feature. Note that
it was disabled when --yacc is passed. See
http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00102.html
Basically, revert e8cd1ad655bcc704b06fb2f191dc3ac1df32b796.
* src/scan-code.l (braces_level, need_semicolon, in_cpp): Remove.
Remove every rule needed to detect and add missing semicolon.
* tests/actions.at (Fix user actions without a trailing semicolon):
Remove.
* NEWS: Adjust.
2013-03-04 Akim Demaille
build: stop using bison -y
* Makefile.am (YACC): Pass -o y.tab.c, so that ylwrap is happy, and
yet we don't pass --yacc to bison.
(AM_YFLAGS): Disable Yacc warnings.
2013-02-23 Akim Demaille
c++: rename b4_semantic_type_declare as b4_value_type_declare
This is to match the names used in C and api.value.type, even if the
parser actually defines semantic_type.
* data/c++.m4 (b4_semantic_type_declare): Rename as...
(b4_value_type_declare): this.
* data/variant.hh: Likewise.
2013-02-23 Akim Demaille
news: typo
* NEWS: here.
2013-02-23 Akim Demaille
style: space changes in the tests
* tests/local.at: here.
2013-02-22 Akim Demaille
style: formatting changes in the doc
* doc/bison.texi: Use @file where appropriate.
2013-02-19 Akim Demaille
tests: fix invalid C++11 code
* tests/c++.at (Object): Somehow instances of Object were assigned
YY_NULL, which is 0 most of the time (that case passes), but is
nullptr in C++11, and there is nothing in Object to support such an
assignment (failure). Use 0 as value, and provide the needed
assignment operator.
Also, use a more natural order within the class definition.
2013-02-19 Akim Demaille
tests: fix failures with G++ 4.8 in Flex scanner
* configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Rename as...
(FLEX_SCANNER_CXXFLAGS): this.
Pass -Wno-zero-as-null-pointer-constant to G++ if it supports it.
* examples/calc++/local.mk: Adjust.
2013-02-19 Akim Demaille
regen
2013-02-19 Akim Demaille
gnulib: update
2013-02-19 Akim Demaille
style: rename variant private members
* data/variant.hh (buffer, tname, as_, raw, align_me): Rename as...
(yybuffer_, yytname_,yyas_, yyraw, yyalign_me): these.
2013-02-19 Akim Demaille
style: space changes
* data/variant.hh: Be sure to leave a space before arguments in function
calls.
2013-02-19 Akim Demaille
variant: fix G++ 4.4 warnings
The changes by Théophile Ranquet about type punning issues need
to be extend to in-place new to please G++ 4.4.7.
* data/variant.hh (variant::as_): New, factors the casts that avoid
compiler warnings.
(as, build): Use them.
2013-02-18 Akim Demaille
news: spell fixes
* NEWS: here.
2013-02-18 Akim Demaille
diagnostics: factor and enhance messages about duplicate rule directives
When reporting a duplicate directive on a rule, point to its first
occurrence:
one.y:11.10-15: error: only one %empty allowed per rule
%empty {} %empty
^^^^^^
one.y:11.3-8: previous declaration
%empty {} %empty
^^^^^^
And consistently discard the second one.
* src/complain.h, src/complain.c (duplicate_directive): New.
* src/reader.c: Use it where appropriate.
* src/symlist.h, src/symlist.c (symbol_list): Add a dprec_location member.
* tests/actions.at: Adjust expected output.
2013-02-18 Akim Demaille
style: no longer use backquotes
* tests/actions.at, tests/atlocal.in, tests/c++.at, tests/calc.at,
* tests/conflicts.at, tests/existing.at, tests/glr-regression.at,
* tests/input.at, tests/java.at, tests/local.at, tests/sets.at,
* tests/synclines.at, doc/bison.texi, lib/libiberty.h, lib/timevar.h:
Use single quotes.
2013-02-18 Akim Demaille
style: no longer use backquotes
* README, REFERENCES, TODO, configure.ac, data/README, data/bison.m4,
* data/c++.m4, data/c.m4, data/java.m4, data/lalr1.cc,
* data/lalr1.java, data/yacc.c, doc/local.mk, etc/bench.pl.in,
* src/conflicts.c, src/files.c, src/getargs.c, src/gram.h, src/lalr.c,
* src/location.c, src/location.h, src/muscle-tab.c, src/muscle-tab.h,
* src/output.c, src/parse-gram.c, src/parse-gram.y, src/print-xml.c,
* src/print.c, src/reader.c, src/reduce.c, src/scan-skel.l,
* src/symtab.h, src/system.h, src/tables.c:
Use single quotes, as currently recommended by the GNU Coding Standards.
2013-02-18 Akim Demaille
style: no longer use backquotes in messages
* src/getargs.c (usage): Use single quotes.
2013-02-18 Akim Demaille
doc: use %empty instead of /* empty */
* doc/bison.texi: Change the comments into explicit %empty.
2013-02-18 Akim Demaille
doc: introduce %empty and -Wempty-rule
* doc/bison.texi (Grammar Rules): Make it a @section which
contains...
(Rules Syntax): this new subsection (with the previous contents of
"Grammar Rules".
(Empty Rules): New subsection, extracted from the former
"Grammar Rules".
Document %empty.
(Recursion): New a subsection of "Grammar Rules".
Complete a few index entries.
(Bison Options): Document -Wempty-rule.
2013-02-18 Akim Demaille
report: use %empty to denote empty rules
* src/gram.c (rule_rhs_print): Use %empty for empty rules.
* tests/conflicts.at, tests/regression.at, tests/sets.at: Adjust.
2013-02-18 Akim Demaille
diagnostics: %empty enables -Wempty-rule
* src/complain.h, src/complain.c (warning_is_unset): New.
* src/reader.c (grammar_current_rule_empty_set): If enabled -Wempty-rule,
if not disabled.
* tests/actions.at (Implicitly empty rule): Check this feature.
Also check that -Wno-empty-rule does disable this warning.
2013-02-18 Akim Demaille
-Wempty-rule: diagnose empty rules without %empty
* src/complain.h, src/complain.c (warning_empty_rule, Wempty_rule):
New warning category.
(warnings_args, warnings_types): Adjust.
* src/reader.c (grammar_rule_check): Check the empty rules are
flagged by %empty.
* tests/actions.at (Implicitly empty rule): New.
* tests/existing.at: Add expected warnings.
2013-02-18 Akim Demaille
tests: use %empty
* tests/actions.at, tests/input.at, tests/reduce.at,
* tests/regression.at:
here.
2013-02-18 Akim Demaille