Copyright | (c) Karl Cronburg 2018 |
---|---|
License | BSD3 |
Maintainer | karl@cs.tufts.edu |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
antlr4 :: QuasiQuoter Source #
There are three different quasiquoters in antlr-haskell, each with varying
support for different G4 features. If you're looking for the user-facing
quasiquoter then turn back now, because here-be-dragons. The user-facing
quasiquoter can be found in G4
as g4
.
- User-facing QuasiQuoter is in
G4
- Spliced QuasiQuoter is here
- Boot parser is in
srcLanguageANTLR4BootParser.hs.boot
The spliced quasiquoter, as packaged and shipped with distributions of antlr-haskell, allows for bootstrapping of the user-facing quasiquoter without requiring parsec as a dependency. The boot quasiquoter on the other hand is written entirely in parsec.
g4_decls :: [G4] -> Q [Dec] Source #
This function does the heavy-lifting of Haskell code generation, most notably generating non-terminal, terminal, and grammar data types as well as accompanying parsing functions.
mkLRParser :: (Lift sts, Lift nts, Prettify nts, Prettify sts, Data nts, Data sts, Ord nts, Ord sts, Show nts, Show sts, Hashable sts, Hashable nts) => [G4] -> Grammar () nts sts -> Q [Dec] Source #
Support for this is very experimental. This function allows you
to splice in compile-time computed versions of the LR1 data structures
so as to decrease the runtime of at-runtime parsing.
See testg4G4.hs
and testg4Main.hs
in the antlr-haskell source for
example usage of the glrParseFast
function generated.