BNF converter

  • Authors:
  • Markus Forsberg;Aarne Ranta

  • Affiliations:
  • Chalmers University of Technology and the University of Gothenburg, Gothenburg, Sweden;Chalmers University of Technology and the University of Gothenburg, Gothenburg, Sweden

  • Venue:
  • Haskell '04 Proceedings of the 2004 ACM SIGPLAN workshop on Haskell
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

We will demonstrate BNFC (the BNF Converter) [7, 6], a multi-lingual compiler tool. BNFC takes as its input a grammar written in LBNF (Labelled BNF) notation, and generates a compiler front-end (an abstract syntax, a lexer, and a parser). Furthermore, it generates a case skeleton usable as the starting point of back-end construction, a pretty printer, a test bench, and a LaTeX document usable as language specification. The program components can be generated in Haskell, Java, C and C++ and their standard parser and lexer tools. BNFC itself was written in Haskell.The methodology used for the generated front-end is based on Appel's books on compiler construction [3, 1, 2]. BNFC has been used as a teaching tool in compiler construction courses at Chalmers. It has also been applied to research-related programming language development, and in an industrial application producing a compiler for a telecommunications protocol description language [4].BNFC is freely available under the GPL license at its website and in the testing distribution of Debian Linux.