BNF Converter
Language Technology Group
Department of Computer Science and Engineering
Chalmers University of Technology and University of Gothenburg
News
- 2012-05-13: Added info on the source repository
for BNFC.
- 2012-03-12: BNFC has a new home:
bnfc.digitalgrammars.com.
- 2011-12-08:
BNFC user and developer group
created. Please join, and send your questions and bug
reports to this group!
- 2011-01-04: BNFC is part of the
CLT Toolkit.
- 2010-09-23: The source repository has moved again (details TBA).
You can now get BNFC from Hackage.
- 2008-09-23: Note the new Darcs repository location.
- 2008-01-18: Release of a Darcs snapshot of BNFC 2.4 (beta).
See Download below.
- 2007-06-05: Release of the Darcs repository (see under Download below).
This is currently the main distribution channel of BNFC.
- BNF Converter is now part of the stable distribution of Debian. Link
What is the BNF Converter?
The BNF Converter is a compiler construction tool generating a
compiler front-end
from a Labelled BNF grammar. It is currently able to generate
C, C++, C#, F#, Haskell, Java, and OCaml, as well as XML representations.
Given a Labelled BNF grammar the tool produces:
- an abstract syntax implementation
- a case skeleton for the abstract syntax in the same language
- an Alex, JLex,
or Flex lexer
generator file
- a Happy, CUP,
or Bison
parser generator file
- a pretty-printer as a Haskell/Java/C++/C module
- a Latex file containing a readable specification of the
language
User manuals
Download
Install
BNFC from Hackage:
cabal install bnfc
Darcs snapshot 2008-01-18:
Source repository
svn checkout https://svn.spraakdata.gu.se/clt/bnfc
Large examples
A grammar of C. An example C file parsable in type Program.
A grammar of Alfa
(For more details, see the Alfa home page.)
A grammar of LBNF. It is at the
same
time an example LBNF file, parsable in type Grammar. This
grammar is used in the implementation of the BNF Converter.
A grammar
of Java 1.1 developed by Mike Rainey
Authors
(c) Bjorn Bringert, Johan Broberg, Paul Callaghan, Markus Forsberg,
Ola Frid, Peter Gammie, Patrik Jansson, Kristofer Johannisson,
Antti-Juhani Kaijanaho, Ulf Norell, Michael Pellauer
and Aarne Ranta 2002 - 2011.
License
Free software under GNU General Public License (GPL).