| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Cfg.PredictSet
Description
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 Predictions. The LookaheadSets of the Predictions
will be pairwise disjoint.
Arguments
| :: 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.