Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
First sets of a context-free grammar.
- firstSet :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) => cfg (AugT t) (AugNT nt) -> AugNT nt -> LookaheadSet t
- firstSetMap :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) => cfg (AugT t) (AugNT nt) -> Map (AugNT nt) (LookaheadSet t)
- firstsOfVs :: Ord t => (AugNT nt -> LookaheadSet t) -> AugVs t nt -> LookaheadSet t
Documentation
firstSet :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) => cfg (AugT t) (AugNT nt) -> AugNT nt -> LookaheadSet t Source
Returns the first set of the nonterminal for the grammar. To
avoid recalculations, hold a copy of firstSet cfg
.
firstSetMap :: forall cfg t nt. (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) => cfg (AugT t) (AugNT nt) -> Map (AugNT nt) (LookaheadSet t) Source
Returns the first set of the nonterminal for the grammar as a map.
firstsOfVs :: Ord t => (AugNT nt -> LookaheadSet t) -> AugVs t nt -> LookaheadSet t Source
Given a firsts function, find the first set of a list of symbols.