BNFC: A compiler front-end generator.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

The BNF Converter is a compiler construction tool generating a compiler front-end from a Labelled BNF grammar. It was originally written to generate Haskell code, but can also be used for generating Agda, C, C++, Java, Ocaml and XML code.

Given a Labelled BNF grammar the tool produces: an abstract syntax as a Haskell, Agda, C, C++, Ocaml module or Java directory, a case skeleton for the abstract syntax in the same language, an Alex, JLex, or Flex lexer generator file, a Happy, CUP, Bison, or Antlr parser generator file, a pretty-printer as a Haskell, Agda, C, C++, Java, or Ocaml module, an XML representation, a LaTeX file containing a readable specification of the language.


[Skip to Readme]

Properties

Versions 2.4.1.1, 2.4.1.2, 2.4.2.0, 2.4.2.1, 2.5.0, 2.5.0.1, 2.6.0.0, 2.6.0.1, 2.6.0.2, 2.6.0.3, 2.7.0.0, 2.7.0.1, 2.7.0.2, 2.7.1, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.3.1, 2.8.4, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.3, 2.9.4, 2.9.4.1, 2.9.5
Change log CHANGELOG.md
Dependencies array, base (>=4.8 && <5), BNFC, containers, deepseq, directory, filepath, mtl (>=2.2.1), pretty (>=1.1 && <1.2), process, semigroups, string-qq, time [details]
License BSD-3-Clause
Copyright (c) Andreas Abel, Jonas Almström Duregård, Krasimir Angelov, Jean-Philippe Bernardy, Björn Bringert, Johan Broberg, Kyle Butt, Paul Callaghan, Grégoire Détrez, Markus Forsberg, Ola Frid, Peter Gammie, Thomas Hallgren, Pascal Hof, Simon Huber, Patrik Jansson, Kristofer Johannisson, Antti-Juhani Kaijanaho, Andreas Lööw, Justin Meiners, Kent Mein, Ulf Norell, Gabriele Paganelli, Michael Pellauer, Fabian Ruch, and Aarne Ranta 2002 - 2021. Free software under the BSD 3-clause license.
Author
Maintainer bnfc-dev@googlegroups.com
Category Parsing
Home page http://bnfc.digitalgrammars.com/
Bug tracker https://github.com/BNFC/bnfc/issues
Source repo head: git clone git://github.com/BNFC/bnfc.git(source)
this: git clone git://github.com/BNFC/bnfc.git(tag v2.9.3)(source)
Uploaded by AndreasAbel at 2021-10-01T05:59:27Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for BNFC-2.9.3

[back to package description]

Hackage version Hackage CI BNFC on Stackage Nightly Stackage LTS version Build status Documentation status

The BNF Converter

What is the BNF Converter?

The BNF Converter (bnfc) is a compiler construction tool generating a compiler front-end from a Labelled BNF grammar. It is currently able to generate Haskell, Agda, C, C++, Java, and OCaml, as well as XML representations.

Given a Labelled BNF grammar the tool produces:

More information: http://bnfc.digitalgrammars.com/

Installation

Some binaries are available at https://github.com/BNFC/bnfc/releases. Installation from the Haskell sources is possible via stack or cabal.

You need a running installation of stack. To install and run the latest version of bnfc from stackage, enter at the command line:

  stack install BNFC
  bnfc --help

Installation via cabal

You need a running installation of a recent version of GHC and Cabal, most easily available via the Haskell Platform. To install and bnfc from hackage, enter at the command line:

  cabal install BNFC
  bnfc --help

Installing the development version

To install the development version of bnfc with the latest bugfixes (and regressions ;-)):

  git clone https://github.com/BNFC/bnfc.git
  cd bnfc/source

and then either

  cabal install

or

  stack install --stack-yaml stack-8.10.3.yaml

(replace 8.10.3 with your GHC version, and if you want to build with your installed GHC then add flag --system-ghc).

Mini tutorial

Documentation

https://bnfc.readthedocs.org/en/latest/

Support

You can discuss with us issues around bnfc on our mailing list bnfc-dev@googlegroups.com.

For current limitations of bnfc, or to report a new bug, please consult our issue tracker.

Contribute

License

The project is licensed under the BSD 3-clause license.

BNFC versions until 2.8.4 released under the GNU General Public License.