Safe Haskell | None |
---|---|
Language | Haskell98 |
Contains the main language definition routines of BNFC-meta.
Main language definition routines
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"
module Language.LBNF.Compiletime