Bison - News
Bison 3.4.2 released [stable]
Item posted by Akim Demaille <akim> on Sat 14 Sep 2019 07:01:33 AM UTC.
Bison 3.4.2 is a bug fix release of the 3.4 series. It fixes a number of
hard-to-find bugs, mostly discovered by fuzzing.
In Bison 3.4 a particular focus was put on improving the diagnostics, which
are now colored by default, and accurate with multibyte input. Their format
was also changed, and is now similar to GCC 9's diagnostics.
Users of the default backend (yacc.c) can use the new %define variable
api.header.include to avoid duplicating the content of the generated header
in the generated parser. There are two new examples installed, including a
reentrant calculator which supports recursive calls to the parser and
Flex-generated scanner.
See below for more details.
==================================================================
Bison is a general-purpose parser generator that converts an annotated
context-free grammar into a deterministic LR or generalized LR (GLR) parser
employing LALR(1) parser tables. Bison can also generate IELR(1) or
canonical LR(1) parser tables. Once you are proficient with Bison, you can
use it to develop a wide range of language parsers, from those used in
simple desk calculators to complex programming languages.
Bison is upward compatible with Yacc: all properly-written Yacc grammars
work with Bison with no change. Anyone familiar with Yacc should be able to
use Bison with little trouble. You need to be fluent in C, C++ or Java
programming in order to use Bison.
Here is the GNU Bison home page:
https://gnu.org/software/bison/
==================================================================
Here are the compressed sources:
https://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.gz (4.1MB)
https://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.xz (3.1MB)
Here are the GPG detached signatures[*]:
https://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.gz.sig
https://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.xz.sig
Use a mirror for higher download bandwidth:
https://www.gnu.org/order/ftp.html
[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify bison-3.4.2.tar.gz.sig
If that command fails because you don't have the required public key,
then run this command to import it:
gpg --keyserver keys.gnupg.net --recv-keys 0DDCAA3278D5264E
and rerun the 'gpg --verify' command.
This release was bootstrapped with the following tools:
Autoconf 2.69
Automake 1.16.1
Flex 2.6.4
Gettext 0.19.8.1
Gnulib v0.1-2844-g03add7eb9
==================================================================
NEWS
* Noteworthy changes in release 3.4.2 (2019-09-08) [stable]
** Bug fixes
In some cases, when warnings are disabled, bison could emit tons of white
spaces as diagnostics.
When running out of memory, bison could crash (found by fuzzing).
When defining twice the EOF token, bison would crash.
New warnings from recent compilers have been addressed in the generated
parsers (yacc.c, glr.c, glr.cc).
When lone carriage-return characters appeared in the input file,
diagnostics could hang forever.
* Noteworthy changes in release 3.4.1 (2019-05-22) [stable]
** Bug fixes
Portability fixes.
* Noteworthy changes in release 3.4 (2019-05-19) [stable]
** Deprecated features
The %pure-parser directive is deprecated in favor of '%define api.pure'
since Bison 2.3b (2008-05-27), but no warning was issued; there is one
now. Note that since Bison 2.7 you are strongly encouraged to use
'%define api.pure full' instead of '%define api.pure'.
** New features
*** Colored diagnostics
As an experimental feature, diagnostics are now colored, controlled by the
new options --color and --style.
To use them, install the libtextstyle library before configuring Bison.
It is available from
https://alpha.gnu.org/gnu/gettext/
for instance
https://alpha.gnu.org/gnu/gettext/libtextstyle-0.8.tar.gz
The option --color supports the following arguments:
- always, yes: Enable colors.
- never, no: Disable colors.
- auto, tty (default): Enable colors if the output device is a tty.
To customize the styles, create a CSS file similar to
/* bison-bw.css */
.warning { }
.error { font-weight: 800; text-decoration: underline; }
.note { }
then invoke bison with --style=bison-bw.css, or set the BISON_STYLE
environment variable to "bison-bw.css".
*** Disabling output
When given -fsyntax-only, the diagnostics are reported, but no output is
generated.
The name of this option is somewhat misleading as bison does more than
just checking the syntax: every stage is run (including checking for
conflicts for instance), except the generation of the output files.
*** Include the generated header (yacc.c)
Before, when --defines is used, bison generated a header, and pasted an
exact copy of it into the generated parser implementation file. If the
header name is not "y.tab.h", it is now #included instead of being
duplicated.
To use an '#include' even if the header name is "y.tab.h" (which is what
happens with --yacc, or when using the Autotools' ylwrap), define
api.header.include to the exact argument to pass to #include. For
instance:
%define api.header.include {"parse.h"}
or
%define api.header.include {<parser/parse.h>}
*** api.location.type is now supported in C (yacc.c, glr.c)
The %define variable api.location.type defines the name of the type to use
for locations. When defined, Bison no longer defines YYLTYPE.
This can be used in programs with several parsers to factor their
definition of locations: let one of them generate them, and the others
just use them.
** Changes
*** Graphviz output
In conformance with the recommendations of the Graphviz team, if %require
"3.4" (or better) is specified, the option --graph generates a *.gv file
by default, instead of *.dot.
*** Diagnostics overhaul
Column numbers were wrong with multibyte characters, which would also
result in skewed diagnostics with carets. Beside, because we were
indenting the quoted source with a single space, lines with tab characters
were incorrectly underlined.
To address these issues, and to be clearer, Bison now issues diagnostics
as GCC9 does. For instance it used to display (there's a tab before the
opening brace):
foo.y:3.37-38: error: $2 of ‘expr’ has no declared type
expr: expr '+' "number" { $$ = $1 + $2; }
^~
It now reports
foo.y:3.37-38: error: $2 of ‘expr’ has no declared type
3 | expr: expr '+' "number" { $$ = $1 + $2; }
| ^~
Other constructs now also have better locations, resulting in more precise
diagnostics.
*** Fix-it hints for %empty
Running Bison with -Wempty-rules and --update will remove incorrect %empty
annotations, and add the missing ones.
*** Generated reports
The format of the reports (parse.output) was improved for readability.
*** Better support for --no-line.
When --no-line is used, the generated files are now cleaner: no lines are
generated instead of empty lines. Together with using api.header.include,
that should help people saving the generated files into version control
systems get smaller diffs.
** Documentation
A new example in C shows an simple infix calculator with a hand-written
scanner (examples/c/calc).
A new example in C shows a reentrant parser (capable of recursive calls)
built with Flex and Bison (examples/c/reccalc).
There is a new section about the history of Yaccs and Bison.
** Bug fixes
A few obscure bugs were fixed, including the second oldest (known) bug in
Bison: it was there when Bison was entered in the RCS version control
system, in December 1987. See the NEWS of Bison 3.3 for the previous
oldest bug.
Powered by Savane 3.14-8aba.
Corresponding source code