It's amazing how much the order matters. To a point that many of
these benches are meaningless. For instance (some of the benches
where run with `make -C benches/latest rand
BENCHFLAGS=--benchmark_min_time=3`):
compiler: g++ -std=c++11 -O2
0. %define nofinal
1.
--------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------
BM_y0 1543 ns 1541 ns 441660
BM_y1 1521 ns 1520 ns 456535
--------------------------------------------------
BM_y0 1531 ns 1530 ns 440584
BM_y1 1512 ns 1511 ns 457591
--------------------------------------------------
BM_y0 1539 ns 1538 ns 2749330
BM_y1 1516 ns 1515 ns 2771500
--------------------------------------------------
BM_y0 1571 ns 1570 ns 2600782
BM_y1 1542 ns 1541 ns 2708349
--------------------------------------------------
BM_y0 1530 ns 1529 ns 2670363
BM_y1 1519 ns 1518 ns 2764096
--------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------
BM_y1 1529 ns 1528 ns 451937
BM_y0 1508 ns 1507 ns 453944
--------------------------------------------------
BM_y1 1525 ns 1524 ns 2750684
BM_y0 1516 ns 1515 ns 2794034
--------------------------------------------------
BM_y1 1526 ns 1525 ns 2749620
BM_y0 1515 ns 1514 ns 2808112
--------------------------------------------------
BM_y1 1524 ns 1523 ns 4475844
BM_y0 1502 ns 1501 ns 4611665
* etc/bench.pl.in: here.
GNU 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.
Bison and the parsers it generates are portable, they do not require any specific compilers.
GNU Bison's home page is https://gnu.org/software/bison/.
Installation
Build from git
Here are basic installation instructions for a repository checkout:
$ git submodule update --init
$ ./bootstrap
then proceed with the usual configure && make steps.
The file README-hacking.md is about building, modifying and checking Bison.
Build from tarball
See the file INSTALL for generic compilation and installation instructions.
Bison requires GNU m4 1.4.6 or later. See https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz.
Running a non installed bison
Once you ran make, you might want to toy with this fresh bison before
installing it. In that case, do not use src/bison: it would use the
installed files (skeletons, etc.), not the local ones. Use tests/bison.
Colored diagnostics
As an experimental feature, diagnostics are now colored, controlled by the
--color and --style options.
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/pub/gnu/gettext/libtextstyle-0.20.5.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, say bison-bw.css, 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.
Relocatability
If you pass --enable-relocatable to configure, Bison is relocatable.
A relocatable program can be moved or copied to a different location on the file system. It can also be used through mount points for network sharing. It is possible to make symlinks to the installed and moved programs, and invoke them through the symlink.
See "Enabling Relocatability" in the documentation.
Internationalization
Bison supports two catalogs: one for Bison itself (i.e., for the maintainer-side parser generation), and one for the generated parsers (i.e., for the user-side parser execution). The requirements between both differ: bison needs ngettext, the generated parsers do not. To simplify the build system, neither are installed if ngettext is not supported, even if generated parsers could have been localized. See http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for more details.
Questions
See the section FAQ in the documentation (doc/bison.info) for frequently
asked questions. The documentation is also available in PDF and HTML,
provided you have a recent version of Texinfo installed: run make pdf or
make html.
If you have questions about using Bison and the documentation does not answer them, please send mail to help-bison@gnu.org.
Bug reports
Please send bug reports to bug-bison@gnu.org. Be sure to include the
version number from bison --version, and a complete, self-contained test
case in each bug report.
Copyright statements
For any copyright year range specified as YYYY-ZZZZ in this package, note that the range specifies every single year in that closed interval.