Copyright | (c) Karl Cronburg 2018 |
---|---|
License | BSD3 |
Maintainer | karl@cs.tufts.edu |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module contains the glue code for hooking Sam's
ParserGenerator
implementation into the rest of
this package.
Synopsis
- parse :: CanParse nts tok => [tok] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok)
- parse' :: (CanParse nts tok, Prettify chr) => Tokenizer chr tok -> [chr] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok)
- atnOf :: (Ord nt, Ord t, Hashable nt, Hashable t) => Grammar s nt t dt -> ATNEnv nt t
- data GrammarSymbol nt t
- type ATNEnv nt t = Set (ATNEdge nt t)
Documentation
parse :: CanParse nts tok => [tok] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok) Source #
No tokenizer required (chr == tok):
parse' :: (CanParse nts tok, Prettify chr) => Tokenizer chr tok -> [chr] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok) Source #
Entrypoint to the ALL(*) parsing algorithm.
atnOf :: (Ord nt, Ord t, Hashable nt, Hashable t) => Grammar s nt t dt -> ATNEnv nt t Source #
Go from an antlr-haskell Grammar to an Allstar ATNEnv. ALL(*) does not currently support predicates and mutators.
data GrammarSymbol nt t Source #
Grammar symbol types