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 :: (Ord nts, Ord (Label t), Token t, Show nts, Show (Label t), Show t) => [t] -> GrammarSymbol nts (Label t) -> Set (ATNEdge nts (Label t)) -> Bool -> Either String (AST nts t)
- atnOf :: (Ord nt, Ord t, Hashable nt, Hashable t) => Grammar s nt t -> ATNEnv nt t
- class Token t where
- data GrammarSymbol nt t
- type ATNEnv nt t = Set (ATNEdge nt t)
Documentation
parse :: (Ord nts, Ord (Label t), Token t, Show nts, Show (Label t), Show t) => [t] -> GrammarSymbol nts (Label t) -> Set (ATNEdge nts (Label t)) -> Bool -> Either String (AST nts t) Source #
Entrypoint to the ALL(*) parsing algorithm.
atnOf :: (Ord nt, Ord t, Hashable nt, Hashable t) => Grammar s nt t -> ATNEnv nt t Source #
Go from an antlr-haskell Grammar to an Allstar ATNEnv. ALL(*) does not current support predicates and mutators.
Input sequence type
data GrammarSymbol nt t Source #
Grammar symbol types
Instances
(Eq nt, Eq t) => Eq (GrammarSymbol nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator (==) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # (/=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # | |
(Ord nt, Ord t) => Ord (GrammarSymbol nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator compare :: GrammarSymbol nt t -> GrammarSymbol nt t -> Ordering # (<) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # (<=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # (>) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # (>=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool # max :: GrammarSymbol nt t -> GrammarSymbol nt t -> GrammarSymbol nt t # min :: GrammarSymbol nt t -> GrammarSymbol nt t -> GrammarSymbol nt t # | |
(Show nt, Show t) => Show (GrammarSymbol nt t) Source # | |
Defined in Text.ANTLR.Allstar.ParserGenerator showsPrec :: Int -> GrammarSymbol nt t -> ShowS # show :: GrammarSymbol nt t -> String # showList :: [GrammarSymbol nt t] -> ShowS # |