# BNF Converter

Björn Bringert, Markus Forsberg, and Aarne Ranta
January 2008

## News

- 23/9/2008 Note the new Darcs repository location.
- 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

- Tutorial
- Report on the LBNF formalism: LBNF-report.pdf
- Technical Report
- Haskell Mode
- Haskell GLR Mode
- Java 1.4 Mode
- Java 1.5 Mode
- C Mode
- C++ Mode
- O'Caml Mode (2.3b)
- XML Mode

## Download

Darcs repository (the latest version of BNFC):

`darcs get --partial http://code.haskell.org/bnfc/`

Darcs snapshot 18/1/2008:

- BNFC-2.4b.tgz source package
- bnfc-2.4b.exe Windows binary
- bnfc-2.4b-linux-i386.gz Linux (i386) binary
- bndc-2.4b-macosx-i386.gz Mac OS X (i386) binary

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