22/10 2003 Release of BNF Converter version 2.0, generating four
languages.
What is the BNF Converter?
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, but starting from Version 2.0, it can also be used
for generating Java, C++, and C.
Given a Labelled BNF grammar the tool produces:
- an abstract syntax as a Haskell/C++/C 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,
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
Downloads
Source code: BNFC_2.2.tgz
Report on the LBNF formalism:
LBNF-report.ps
Example grammars
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
Earlier versions
v2.1 source code with examples:
bnfc_2.1.tgz
v2.0 source code with examples:
bnfc_2.0.tgz
v1.3 source code with examples:
bnfc_1.3.tar
v1.0, source code with examples:
bnf_conv.tgz