The BNFC-meta package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


This package provides a very simple way of defining a compiler front-end for a language by embedding a BNF grammar directly into a Haskell source file. Specifically, given a quasi-quoted LBNF grammar (as used by the BNF Converter) it generates (using Template Haskell) a LALR parser and pretty pretty printer for the language. The parser is then used to automatically define a quasi-quoter for the defined language so it can also be seamlessly embedded in Haskell source code. With a simple addition to the gramwmar, the user can define a universal syntax for anti-quoting. This means that any grammar non-terminal can be replaced by a quoted Haskell expression of the appropriate type. A few example languages are included in the source tarball.

The LBNF grammar formalism is described thoroughly in the BNF Converter documentation:

This library and the additions it makes to LBNF is described in a 2011 Haskell Symposium paper titled "Embedded Parser Generators":


Versions0.1,,,, 0.2,,, 0.2.1, 0.2.2, 0.3,,,,,, 0.4,,,,
Change logNone available
Dependenciesalex-meta (>= && <0.4), array (>=0.4 && <0.6), base (>=4.2 && <5), happy-meta (>= && <0.3), haskell-src-meta (>=0.5 && <1.0), syb (>=0.2 && <1.0), template-haskell (>=2.4 && <2.10) [details]
AuthorJonas Duregård
MaintainerJonas Duregård (
UploadedTue Aug 12 09:05:26 UTC 2014 by JonasDuregard



Maintainers' corner

For package maintainers and hackage trustees