| 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 |
Text.ANTLR.Allstar.ParserGenerator
Description
Synopsis
- data GrammarSymbol nt t
- class Token t where
- type ATNEnv nt t = Set (ATNEdge nt t)
- data AST nt 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
- parse :: (Eq nt, Show nt, Ord nt, Eq (Label tok), Show (Label tok), Ord (Label tok), Token tok, Show tok) => [tok] -> GrammarSymbol nt (Label tok) -> ATNEnv nt (Label tok) -> Bool -> Either String (AST nt tok)
Documentation
data GrammarSymbol nt t Source #
Grammar symbol types
Instances
Input sequence type
type ATNEnv nt t = Set (ATNEdge nt t) Source #
A set of ATN edges, defining the grammar over which the ALL(*) parsing algorithm operates.
Return type of parse function
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 # | |
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.
Constructors
| GS (GrammarSymbol nt t) | The symbol to parse upon traversing an edge |
| PRED Bool | Unimplemented predicates in ALL(*) |
Instances
| (Eq nt, Eq t) => Eq (ATNEdgeLabel nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator Methods (==) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # (/=) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # | |
| (Ord nt, Ord t) => Ord (ATNEdgeLabel nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator Methods compare :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Ordering # (<) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # (<=) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # (>) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # (>=) :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> Bool # max :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> ATNEdgeLabel nt t # min :: ATNEdgeLabel nt t -> ATNEdgeLabel nt t -> ATNEdgeLabel nt t # | |
| (Show nt, Show t) => Show (ATNEdgeLabel nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator Methods showsPrec :: Int -> ATNEdgeLabel nt t -> ShowS # show :: ATNEdgeLabel nt t -> String # showList :: [ATNEdgeLabel nt t] -> ShowS # | |
parse :: (Eq nt, Show nt, Ord nt, Eq (Label tok), Show (Label tok), Ord (Label tok), Token tok, Show tok) => [tok] -> GrammarSymbol nt (Label tok) -> ATNEnv nt (Label tok) -> Bool -> Either String (AST nt tok) Source #
ALL(*) parsing algorithm. This is not the entrypoint as used by
user-facing code. See parse instead.