context-free-grammar-0.0.1: Basic algorithms on context-free grammars

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Cfg.FollowSet

Description

Follow sets of a context-free grammar.

Synopsis

Documentation

followSet Source

Arguments

:: (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) 
=> cfg (AugT t) (AugNT nt)

the grammar

-> (AugNT nt -> LookaheadSet t)

firstSet for the grammar

-> AugNT nt

the nonterminal

-> LookaheadSet t 

Returns the follow set of the nonterminal for the grammar. To avoid recalculations, hold a copy of followSet cfg.

followSetMap Source

Arguments

:: (Cfg cfg (AugT t) (AugNT nt), Ord nt, Ord t, Show nt) 
=> cfg (AugT t) (AugNT nt)

the grammar

-> (AugNT nt -> LookaheadSet t)

firstSet for the grammar

-> Map (AugNT nt) (LookaheadSet t) 

Returns the follow sets for the grammar as a map.