Copyright | (c) Sam Lasser (c) Karl Cronburg 2017-2018 |
---|---|
License | BSD3 |
Maintainer | karl@cs.tufts.edu |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data GrammarSymbol nt t
- type ATNEnv nt t = Set (ATNEdge nt t)
- data AST nt tok
- = Node nt [GrammarSymbol nt (Label tok)] [AST nt tok]
- | Leaf tok
- data ATNState nt
- type ATNEdge nt t = (ATNState nt, ATNEdgeLabel nt t, ATNState nt)
- data ATNEdgeLabel nt t
- = GS (GrammarSymbol nt t)
- | PRED Bool
- type Label tok = StripEOF (Sym tok)
- parse :: forall chr tok nt. (CanParse nt tok, Prettify chr) => Tokenizer chr tok -> [chr] -> GrammarSymbol nt (Label tok) -> ATNEnv nt (Label tok) -> Bool -> Either String (AST nt tok)
- type Tokenizer chr tok = [chr] -> [(tok, [chr])]
Documentation
data GrammarSymbol nt t Source #
Grammar symbol types
Instances
type ATNEnv nt t = Set (ATNEdge nt t) Source #
A set of ATN edges, defining the grammar over which the ALL(*) parsing algorithm operates.
Input sequence type
Return type of parse function
Node nt [GrammarSymbol nt (Label tok)] [AST nt tok] | |
Leaf tok |
Specifies the nonterminal we're currently parsing as well as what state we are in for parsing some NT symbol.
Instances
Eq nt => Eq (ATNState nt) Source # | |
Ord nt => Ord (ATNState nt) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator | |
Show nt => Show (ATNState nt) Source # | |
Prettify nt => Prettify (ATNState nt) Source # | |
type ATNEdge nt t = (ATNState nt, ATNEdgeLabel nt t, ATNState nt) Source #
Starting state, NT/T symbol to parse, and ending state.
data ATNEdgeLabel nt t Source #
The domain of labels on edges in an augmented recursive transition network, namely the symbol we parse upon traversing an edge.
GS (GrammarSymbol nt t) | The symbol to parse upon traversing an edge |
PRED Bool | Unimplemented predicates in ALL(*) |