# BNF Converter

Markus Forsberg and Aarne Ranta
March 2005

## News

- BNF Converter is now part of the stable distribution of Debian. Link
- 23/03 2005 Release of BNF Converter v.2.2. New features are: Java 1.5 support, XML generation, Generalized LR for Happy and a GF-to-BNFC translation support.

## 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

- Report on the LBNF formalism: LBNF-report.pdf LBNF-report.ps.gz
- Technical Report
- Quick Start
- Haskell Mode
- Haskell GLR Mode
- Java 1.4 Mode
- Java 1.5 Mode
- C Mode
- C++ Mode
- C# Mode
- XML Mode

## Downloads

Source code: BNFC_2.2.tgz

Report on the LBNF formalism: LBNF-report.pdf LBNF-report.ps.gz

## 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

## Authors

Björn Bringert, Paul Callaghan, Markus Forsberg, Peter Gammie, Patrik Jansson, Antti-Juhani Kaijanaho, Michael Pellauer, and Aarne Ranta.