No description
Find a file
Bruno Haible c1144a5076 tests: Fix test failures of Java tests on Cygwin.
Fix suggested by Paul Eggert.

* tests/atlocal.in (lf): New variable.
* tests/local.at (AT_JAVA_PARSER_CHECK): Pass a Windows-agnostic value
of line.separator to the Java runtime.
2025-08-09 13:58:50 -07:00
build-aux build: Fix "make dvi" and "make distcheck" error. 2025-08-03 20:29:41 -07:00
data maint: make update-copyright 2025-03-17 17:48:06 -07:00
doc maint: make update-copyright 2025-03-17 17:48:06 -07:00
etc maint: make update-copyright 2025-03-17 17:48:06 -07:00
examples build: Avoid failure of the Java tests in Cygwin-based environments. 2025-08-03 22:51:19 -07:00
gnulib@2410984b5b build: update gnulib and autoconf submodules to latest 2025-08-03 20:29:41 -07:00
gnulib-po gnulib: update 2020-11-20 06:28:42 +01:00
lib maint: update .gitignore files 2025-07-10 18:34:10 -07:00
m4 maint: update .gitignore files 2025-07-10 18:34:10 -07:00
po style: address syntax-check diagnostics 2020-12-21 07:51:02 +01:00
runtime-po gnulib: update 2020-11-20 06:28:42 +01:00
src maint: pacify -Wunterminated-string-initialization 2025-08-03 23:09:33 -07:00
submodules build: update gnulib and autoconf submodules to latest 2025-08-03 20:29:41 -07:00
tests tests: Fix test failures of Java tests on Cygwin. 2025-08-09 13:58:50 -07:00
.gitattributes git: add diff patterns for Autotest and Texinfo 2021-08-06 18:02:19 +02:00
.gitconfig git: add diff patterns for Autotest and Texinfo 2021-08-06 18:02:19 +02:00
.gitignore git: update ignores 2019-09-22 07:48:10 +02:00
.gitmodules Install autoconf as a submodule to get m4sugar. 2008-12-08 09:47:31 +01:00
.prev-version maint: post-release administrivia 2021-09-25 11:11:06 +02:00
.project * lib/timevar.c (get_time): Include children time. 2002-08-01 18:12:11 +00:00
.travis.yml maint: don’t use \] in BREs and EREs 2022-07-31 13:28:52 -07:00
.x-sc_require_config_h Initial version 2006-01-22 07:59:51 +00:00
.x-sc_unmarked_diagnostics Initial version 2006-01-22 07:59:51 +00:00
.x-update-copyright maint: don't update copyright years in bootstrap. 2011-01-03 09:03:02 -05:00
AUTHORS maint: make update-copyright 2025-03-17 17:48:06 -07:00
autogen.sh maint: ./bootstrap 2025-03-13 13:39:45 -07:00
autopull.sh maint: ./bootstrap 2025-03-13 13:39:45 -07:00
bootstrap ./bootstrap 2025-07-10 18:34:10 -07:00
bootstrap-funclib.sh ./bootstrap 2025-07-10 18:34:10 -07:00
bootstrap.conf build: Fix "make dvi" and "make distcheck" error. 2025-08-03 20:29:41 -07:00
cfg.mk maint: make update-copyright 2025-03-17 17:48:06 -07:00
ChangeLog-1998 maint: generate ChangeLog from git log 2012-01-20 09:33:14 +01:00
ChangeLog-2012 maint: make update-copyright 2025-03-17 17:48:06 -07:00
configure.ac maint: make update-copyright 2025-03-17 17:48:06 -07:00
COPYING Update URLs to prefer https: to http: 2021-01-29 13:48:43 -08:00
Makefile.am maint: make update-copyright 2025-03-17 17:48:06 -07:00
NEWS maint: make update-copyright 2025-03-17 17:48:06 -07:00
PACKAGING maint: make update-copyright 2025-03-17 17:48:06 -07:00
README maint: make update-copyright 2025-03-17 17:48:06 -07:00
README-alpha maint: make update-copyright 2025-03-17 17:48:06 -07:00
README-hacking.md maint: make update-copyright 2025-03-17 17:48:06 -07:00
README.md doc: update README 2019-10-21 08:53:06 +02:00
THANKS maint: make update-copyright 2025-03-17 17:48:06 -07:00
TODO maint: make update-copyright 2025-03-17 17:48:06 -07:00

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:

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

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.