[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bison 3.6.92 released [beta]

From: Akim Demaille
Subject: Bison 3.6.92 released [beta]
Date: Sun, 19 Jul 2020 11:44:35 +0200

I plan to release Bison 3.7 this week, so that I can wrap a bug fix
release before August if needed.

Compared to the previous beta, the format of the counterexamples has
changed, to improve readability, especially for complex cases.  We go

    First example        expr • ID $end
    First derivation     $accept ::=[ s ::=[ a ::=[ expr • ] ID ] $end ]
    Second example       expr • ID ',' ID $end
    Second derivation    $accept ::=[ s ::=[ a ::=[ expr ::=[ expr • ID ',' ] ] 
ID ] $end ]


    First example        expr • ID ',' ID $end
    Shift derivation
      ↳ s                      $end
        ↳ a                 ID
          ↳ expr
            ↳ expr • ID ','
    Second example       expr • ID $end
    Reduce derivation
      ↳ s             $end
        ↳ a        ID
          ↳ expr •

We *need* feedback on this beta.  Not just on counterexamples, there were
other changes affecting all the skeletons.

        *Please* *,* *pretty* *please* *,* *test* *it* *!*

Feedback on the format of the counterexamples would also be most useful.



PS/ The experimental back-end for the D programming language is still
looking for active support from the D community.


Here are the compressed sources:
  https://alpha.gnu.org/gnu/bison/bison-3.6.92.tar.gz   (5.1MB)
  https://alpha.gnu.org/gnu/bison/bison-3.6.92.tar.lz   (3.1MB)
  https://alpha.gnu.org/gnu/bison/bison-3.6.92.tar.xz   (3.1MB)

Here are the GPG detached signatures[*]:

Use a mirror for higher download bandwidth:

[*] 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.6.92.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.2
  Flex 2.6.4
  Gnulib v0.1-3630-gcf6d5db12


* Noteworthy changes in release 3.6.92 (2020-07-19) [beta]

Changes in the display of counterexamples.

** Documentation

*** Examples

  The bistromathic demonstrates %param and how to quote sources in the error

    > 123 456
    1.5-7: syntax error: expected end of file or + or - or * or / or ^ before 
        1 | 123 456
          |     ^~~

* Noteworthy changes in release 3.6.91 (2020-07-09) [beta]

** Bug fixes

  Portability issues.

* Noteworthy changes in release 3.6.90 (2020-07-04) [beta]

** Deprecated features

  The YYPRINT macro, which works only with yacc.c and only for tokens, was
  obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
  It is deprecated and its support will be removed eventually.

  In conformance with the recommendations of the Graphviz team, in the next
  version Bison the option `--graph` will generate a *.gv file by default,
  instead of *.dot.  A transition started in Bison 3.4.

** New features

*** Counterexample Generation

  Contributed by Vincent Imbimbo.

  When given `--report=counterexamples` or `-Wcounterexamples`, bison will
  now output counterexamples for conflicts in the grammar.  These are
  strings in the grammar which can be parsed in two ways due to the
  conflict.  For example:

    Example              exp '+' exp • '/' exp
    First derivation     exp ::=[ exp ::=[ exp '+' exp • ] '/' exp ]
    Second derivation    exp ::=[ exp '+' exp ::=[ exp • '/' exp ] ]

  This is a shift/reduce conflict caused by none of the operators having
  precedence, so the example can be parsed in the two ways shown.   When
  bison cannot find an example that can be derived in two ways, it instead
  generates two examples that are the same up until the dot:

    First example        expr • ID $end
    First derivation     $accept ::=[ s ::=[ a ::=[ expr • ] ID ] $end ]
    Second example       expr • ID ',' ID $end
    Second derivation    $accept ::=[ s ::=[ a ::=[ expr ::=[ expr • ID ',' ] ] 
ID ] $end ]

  In these cases, the parser usually doesn't have enough lookahead to
  differentiate the two given examples.

  The counterexamples are "focused": in a large grammar they do not
  pollute the output with all the derivations from the start symbol,
  rather they start on the "conflicted nonterminal".

*** File prefix mapping

  Contributed by Joshua Watt.

  Bison learned a new argument, `--file-prefix-map OLD=NEW`.  Any file path
  in the output (specifically `#line` directives and `#ifdef` header guards)
  that begins with the prefix OLD will have it replaced with the prefix NEW,
  similar to the `-ffile-prefix-map` in GCC.  This option can be used to
  make bison output reproducible.

** Changes

*** Relocatable installation

  When installed to be relocatable (via `configure --enable-relocatable`),
  bison will now also look for a relocated m4.

*** C++ file names

  The `filename_type` %define variable was renamed `api.filename.type`.
  Instead of

    %define filename_type "symbol"


    %define api.filename.type {symbol}

  (Or let `bison --update` do it for you).

  It now defaults to `const std::string` instead of `std::string`.

*** Deprecated %define variable names

  The following variables have been renamed for consistency.  Backward
  compatibility is ensured, but upgrading is recommended.

    filename_type       -> api.filename.type
    package             -> api.package

*** Push parsers no longer clear their state when parsing is finished

  Previously push-parsers cleared their state when parsing was finished (on
  success and on failure).  This made it impossible to check if there were
  parse errors, since `yynerrs` was also reset.  This can be especially
  troublesome when used in autocompletion, since a parser with error
  recovery would suggest (irrelevant) expected tokens even if there were

  Now the parser state can be examined when parsing is finished.  The parser
  state is reset when starting a new parse.

** Bug fixes

*** Include the generated header (yacc.c)

  Historically, when --defines was used, bison generated a header and pasted
  an exact copy of it into the generated parser implementation file.  Since
  Bison 3.4 it is possible to specify that the header should be `#include`d,
  and how.  For instance

    %define api.header.include {"parse.h"}


    %define api.header.include {<parser/parse.h>}

  Now api.header.include defaults to `"header-basename"`, as was intended in
  Bison 3.4, where `header-basename` is the basename of the generated
  header.  This is disabled when the generated header is `y.tab.h`, to
  comply with Automake's ylwrap.

*** String aliases are faithfully propagated

  Bison used to interpret user strings (i.e., decoding backslash escapes)
  when reading them, and to escape them (i.e., issue non-printable
  characters as backslash escapes, taking the locale into account) when
  outputting them.  As a consequence non-ASCII strings (say in UTF-8) ended
  up "ciphered" as sequences of backslash escapes.  This happened not only
  in the generated sources (where the compiler will reinterpret them), but
  also in all the generated reports (text, xml, html, dot, etc.).  Reports
  were therefore not readable when string aliases were not pure ASCII.
  Worse yet: the output depended on the user's locale.

  Now Bison faithfully treats the string aliases exactly the way the user
  spelled them.  This fixes all the aforementioned problems.  However, now,
  string aliases semantically equivalent but syntactically different (e.g.,
  "A", "\x41", "\101") are considered to be different.

*** Crash when generating IELR

  An old, well hidden, bug in the generation of IELR parsers was fixed.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]