bison: add command line option to map file prefixes
[bison.git] / README
blobf5748c3c25688a0ebb7ad640e6a07944dba1bf95
1 GNU Bison is a general-purpose parser generator that converts an annotated
2 context-free grammar into a deterministic LR or generalized LR (GLR) parser
3 employing LALR(1) parser tables.  Bison can also generate IELR(1) or
4 canonical LR(1) parser tables.  Once you are proficient with Bison, you can
5 use it to develop a wide range of language parsers, from those used in
6 simple desk calculators to complex programming languages.
8 Bison is upward compatible with Yacc: all properly-written Yacc grammars
9 work with Bison with no change.  Anyone familiar with Yacc should be able to
10 use Bison with little trouble.  You need to be fluent in C, C++ or Java
11 programming in order to use Bison.
13 Bison and the parsers it generates are portable, they do not require any
14 specific compilers.
16 GNU Bison's home page is https://gnu.org/software/bison/.
18 # Installation
19 ## Build from git
20 Here are basic installation instructions for a repository checkout:
22     $ git submodule update --init
23     $ ./bootstrap
25 then proceed with the usual `configure && make` steps.
27 The file README-hacking.md is about building, modifying and checking Bison.
29 ## Build from tarball
30 See the file INSTALL for generic compilation and installation instructions.
32 Bison requires GNU m4 1.4.6 or later.  See
33 https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz.
35 ## Running a non installed bison
36 Once you ran `make`, you might want to toy with this fresh bison before
37 installing it.  In that case, do not use `src/bison`: it would use the
38 *installed* files (skeletons, etc.), not the local ones.  Use `tests/bison`.
40 ## Colored diagnostics
41 As an experimental feature, diagnostics are now colored, controlled by the
42 `--color` and `--style` options.
44 To use them, install the libtextstyle library before configuring Bison.  It
45 is available from https://alpha.gnu.org/gnu/gettext/, for instance
46 https://alpha.gnu.org/pub/gnu/gettext/libtextstyle-0.20.5.tar.gz.
48 The option --color supports the following arguments:
49 - always, yes: Enable colors.
50 - never, no: Disable colors.
51 - auto, tty (default): Enable colors if the output device is a tty.
53 To customize the styles, create a CSS file, say `bison-bw.css`, similar to
55     /* bison-bw.css */
56     .warning   { }
57     .error     { font-weight: 800; text-decoration: underline; }
58     .note      { }
60 then invoke bison with `--style=bison-bw.css`, or set the `BISON_STYLE`
61 environment variable to `bison-bw.css`.
63 ## Relocatability
64 If you pass `--enable-relocatable` to `configure`, Bison is relocatable.
66 A relocatable program can be moved or copied to a different location on the
67 file system.  It can also be used through mount points for network sharing.
68 It is possible to make symlinks to the installed and moved programs, and
69 invoke them through the symlink.
71 See "Enabling Relocatability" in the documentation.
73 ## Internationalization
74 Bison supports two catalogs: one for Bison itself (i.e., for the
75 maintainer-side parser generation), and one for the generated parsers (i.e.,
76 for the user-side parser execution).  The requirements between both differ:
77 bison needs ngettext, the generated parsers do not.  To simplify the build
78 system, neither are installed if ngettext is not supported, even if
79 generated parsers could have been localized.  See
80 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for more
81 details.
83 # Questions
84 See the section FAQ in the documentation (doc/bison.info) for frequently
85 asked questions.  The documentation is also available in PDF and HTML,
86 provided you have a recent version of Texinfo installed: run `make pdf` or
87 `make html`.
89 If you have questions about using Bison and the documentation does not
90 answer them, please send mail to <help-bison@gnu.org>.
92 # Bug reports
93 Please send bug reports to <bug-bison@gnu.org>.  Be sure to include the
94 version number from `bison --version`, and a complete, self-contained test
95 case in each bug report.
97 # Copyright statements
98 For any copyright year range specified as YYYY-ZZZZ in this package, note
99 that the range specifies every single year in that closed interval.
101 <!--
103 Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2020 Free
104 Software Foundation, Inc.
106 This file is part of GNU bison, the GNU Compiler Compiler.
108 Permission is granted to copy, distribute and/or modify this document
109 under the terms of the GNU Free Documentation License, Version 1.3 or
110 any later version published by the Free Software Foundation; with no
111 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
112 Texts.  A copy of the license is included in the "GNU Free
113 Documentation License" file as part of this distribution.
115 Local Variables:
116 mode: markdown
117 fill-column: 76
118 ispell-dictionary: "american"
119 End:
121 LocalWords:  parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american md
122 LocalWords:  MERCHANTABILITY GLR LALR IELR submodule init README src bw
123 LocalWords:  Relocatability symlinks symlink