descriptionGNU bison
homepage URLhttp://www.gnu.org/software/bison/
repository URLgit://git.sv.gnu.org/bison.git
ownereblake@redhat.com
last changeFri, 4 Nov 2022 18:53:52 +0000 (4 11:53 -0700)
last refreshSun, 3 Nov 2024 10:08:07 +0000 (3 11:08 +0100)
content tags
add:
README.md

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++, D 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

The README-hacking.md file is about building, modifying and checking Bison. See its "Working from the Repository" section to build Bison from the git repo. Roughly, run:

$ git submodule update --init
$ ./bootstrap

then proceed with the usual configure && make steps.

Build from tarball

See the INSTALL file 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, 0.20.5 or newer, before configuring Bison. It is available from https://alpha.gnu.org/gnu/gettext/, for instance https://alpha.gnu.org/gnu/gettext/libtextstyle-0.20.5.tar.gz, or as part of Gettext 0.21 or newer, for instance https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.gz.

The option --color supports the following arguments:

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.

In some diagnostics, bison uses libtextstyle to emit special escapes to generate clickable hyperlinks. The environment variable NO_TERM_HYPERLINKS can be used to suppress them. This may be useful for terminal emulators which produce garbage output when they receive the escape sequence for a hyperlink. Currently (as of 2020), this affects some versions of emacs, guake, konsole, lxterminal, rxvt, yakuake.

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 https://lists.gnu.org/r/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.

shortlog
2022-11-04 Edoardo Sanguinetimaint: remove unnecessary casts before using gnulib... master
2022-09-20 Akim Demaillecex: check -Dcex.timeout
2022-09-20 Akim Demaillenews: update
2022-09-20 Adela Vaisd: fix syntax error on SymbolKind.toString method
2022-09-20 Adela Vaisd: fix interface syntax error
2022-09-16 Akim Demaillecex: provide the user with a means to change the timeout
2022-09-12 Akim Demailledoc: define the syntax of named references
2022-09-10 Akim Demaillecex: clarify message
2022-09-10 Akim Demailledoc: fix the description of the syntax of %token and...
2022-09-10 Akim Demaillereader: reject rules on YYEOF
2022-09-10 Akim Demaillegnulib: update
2022-09-04 Akim Demaillemuscles: fix handling of the "@'" escape
2022-09-03 Anthony Headingc++: enable C++11 assignment operators for lalr1.cc
2022-09-03 Akim Demailletests: ignore messages from the JVM
2022-09-03 Akim Demaillediagnostics: Windows compatibility issues
2022-08-02 Akim Demailleregen
...
tags
3 years ago v3.8.2 bison 3.8.2
3 years ago v3.8.1 bison 3.8.1
3 years ago v3.8 bison 3.8
3 years ago v3.7.91 bison 3.7.91
3 years ago v3.7.90 bison 3.7.90
3 years ago v3.7.6 bison 3.7.6
3 years ago v3.7.5 bison 3.7.5
3 years ago v3.7.4 bison 3.7.4
4 years ago v3.7.3 bison 3.7.3
4 years ago v3.7.2 bison 3.7.2
4 years ago v3.7.1 bison 3.7.1
4 years ago v3.7 bison 3.7
4 years ago v3.6.93 bison 3.6.93
4 years ago v3.6.92 bison 3.6.92
4 years ago v3.6.91 bison 3.6.91
4 years ago v3.6.90 bison 3.6.90
...
heads
23 months ago master
3 years ago maint
7 years ago yaxx
11 years ago warnings
11 years ago partialorder
11 years ago testsuite-subdirs
12 years ago optimize-m4-iterations
15 years ago candidates/semantic-error-messages
forks
Cached version (5223s old)
 gnu 
bison/ericb.git Eric Blake's GNU bison patches eblake@redhat.com 15 years ago