BNFC-meta-0.6.1: Deriving Parsers and Quasi-Quoters from BNF Grammars

Safe HaskellNone
LanguageHaskell98

Language.LBNF

Contents

Description

Contains the main language definition routines of BNFC-meta.

Synopsis

Main language definition routines

lbnf :: QuasiQuoter Source #

QuasiQuoter for LBNF. Usage: [lbnf| <grammar for your language>|]

The spliced code is an expression of type Grammar.

bnfc :: Grammar -> Q [Dec] Source #

Typical usage (as a top level declaration): bnfc [lbnf|<grammar>|]

The spliced code contains a parser, a pretty-printer and a Quasi-Quoter for the language defined by the grammar.

Debugging functions

dumpCode :: Grammar -> Q [Dec] Source #

Equivalent to bnfc with the side-effect of dumping ALL the spliced code into a file named dump.hs

getCode :: String -> Grammar -> IO String Source #

Computes the Haskell source code that would be spliced by a grammar and wraps it into a compilable Haskell module.

dumpAlex :: Grammar -> Q [Dec] Source #

Equivalent to bnfc with the side-effect of dumping the lexer definition into a file named dump.x

dumpHappy :: Grammar -> Q [Dec] Source #

Equivalent to bnfc with the side-effect of dumping the parser definition into a file named "dump.y"