Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Predict sets of a context-free grammar.
- type Prediction t nt = (LookaheadSet t, Set (AugProduction t nt))
- type Predictions t nt = Set (Prediction t nt)
- predictSet :: Ord t => (AugNT nt -> LookaheadSet t) -> (AugNT nt -> LookaheadSet t) -> AugProduction t nt -> LookaheadSet t
- ll1Info :: (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t) => cfg (AugT t) (AugNT nt) -> (AugProduction t nt -> LookaheadSet t) -> AugNT nt -> Predictions t nt
- ll1InfoMap :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t) => cfg (AugT t) (AugNT nt) -> (AugProduction t nt -> LookaheadSet t) -> Map (AugNT nt) (Predictions t nt)
- isLL1 :: Map (AugNT nt) (Predictions t nt) -> Bool
Documentation
type Prediction t nt = (LookaheadSet t, Set (AugProduction t nt)) Source
A lookahead set with the productions it predicts
type Predictions t nt = Set (Prediction t nt) Source
A set of Prediction
s. The LookaheadSet
s of the Prediction
s
will be pairwise disjoint.
:: Ord t | |
=> (AugNT nt -> LookaheadSet t) |
|
-> (AugNT nt -> LookaheadSet t) |
|
-> AugProduction t nt | the production |
-> LookaheadSet t |
Returns the predict set of a production.
ll1Info :: (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t) => cfg (AugT t) (AugNT nt) -> (AugProduction t nt -> LookaheadSet t) -> AugNT nt -> Predictions t nt Source
Returns the production Predictions
for a nonterminal symbol.
ll1InfoMap :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t) => cfg (AugT t) (AugNT nt) -> (AugProduction t nt -> LookaheadSet t) -> Map (AugNT nt) (Predictions t nt) Source
Returns the production Predictions
for the grammar as a map.