BNF Converter
Björn Bringert,
Markus Forsberg, and
Aarne Ranta
January 2008
News
- 18/1/2008 Release of a Darcs snapshot of BNFC 2.4 (beta).
See Download below.
- 5/6 2007 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
Darcs repository (the latest version of BNFC):
darcs get --partial http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/BNFC/
Darcs snapshot 18/1/2008:
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 - 2008.
License
Free software under GNU General Public License (GPL).