2 min read

On Monday, the team at Bison announced the release of GNU Bison 3.2, a general-purpose parser generator. It converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser, employing LALR(1) parser tables. This release is bootstrapped with the following tools, Gettext, Autoconf 2.69, Automake 1.16.1, Flex 2.6.4, and Gnulib v0.1-2176-ga79f2a287

GNU Bison, commonly known as Bison, is a parser generator that is part of the GNU Project. It is used to develop a wide range of language parsers, right from those used in simple desk calculators to complex programming languages. One has to be fluent in C or C++ programming in order to use Bison.

Bison 3.2  comes with massive improvements to the deterministic C++ skeleton, Lalr1.cc, while maintaining compatibility with C++98. Move-only types can now be used for semantic values while working with Bison’s variants.

In modern C++ (C++11 and later), one should always use ‘std::move’ with the values of the right-hand side symbols ($1, $2, etc.), as they will be popped from the stack anyway. Using ‘std::move’ is now mandatory for move-only types such as unique_ptr, and it provides a significant speedup for large types such as std::string, or std::vector, etc. A warning will be issued when automove is enabled, and a value is used several times.

Major Changes in Bison 3.2

  1. Support for DJGPP (DJ’s GNU Programming Platform), which have been unmaintained and untested for years, is now termed obsolete. Unless there is an activity to revive it, it will be removed.
  2. To denote the output stream, printers should now use ‘yyo’ instead of ‘yyoutput’.
  3. The variant-based symbols in C++ should now use emplace() instead ofbuild().
  4. In C++ parsers, the parser::operator() is now a synonym for the parser::parse.
  5. A ‘comment’ in the generated code now emphasizes that users should not depend on non-documented implementation details, such as macros starting with YY_.
  6. A new section named “A Simple C++ Example”, is now a tutorial for parsers in C++.

Bug Fixes in Bison 3.2

Major bug fixes in this release include Portability issues in MinGW and VS2015,  the test suite and with Flex.

To know more about this release check out the official mailing list.

Read Next

Mio, a header-only C++11 memory mapping library, released!

Google releases Oboe, a C++ library to build high-performance Android audio apps

The 5 most popular programming languages in 2018