Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#4471 closed task (fixed)

bison-3.4.1

Reported by: Bruce Dubbs Owned by: lfs-book
Priority: normal Milestone: 9.0
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

New minor version.

Change History (5)

comment:1 by Bruce Dubbs, 5 years ago

Noteworthy changes in release 3.4.1 (2019-05-22) [stable]

  • 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.

comment:2 by Bruce Dubbs, 5 years ago

Summary: bison-3.4bison-3.4.1

comment:3 by Bruce Dubbs, 5 years ago

I've run into a build problem in the current version. It only seems to occur in the restricted environment in Chapter 6, but a work around is to:

sed -i '6855 s/mv/cp/' Makefile.in
./configure ...
make -j1
...

If someone can come up with a better solution, please let me know.

comment:4 by Bruce Dubbs, 5 years ago

Resolution: fixed
Status: newclosed

Fixed at revision 11612.

comment:5 by Bruce Dubbs, 5 years ago

Milestone: 8.59.0

Milestone renamed

Note: See TracTickets for help on using tickets.