antlr-haskell-0.1.0.0: A Haskell implementation of the ANTLR top-down parser generator

Copyright(c) Karl Cronburg 2018
LicenseBSD3
Maintainerkarl@cs.tufts.edu
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Language.ANTLR4.Boot.Quote

Description

 
Synopsis

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.