context-free-grammar-0.1.1: Basic algorithms on context-free grammars
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Cfg.Productive

Description

Productivity of productions in the grammar.

Synopsis

Documentation

productives :: forall cfg t nt. (Cfg cfg t nt, Ord nt, Ord t) => cfg t nt -> Set (Production t nt) Source #

Returns the productive productions of this grammar.

unproductives :: forall cfg t nt. (Cfg cfg t nt, Ord nt, Ord t) => cfg t nt -> Set (Production t nt) Source #

Returns the unproductive productions of this grammar.

removeUnproductives :: forall cfg t nt. (Cfg cfg t nt, Ord nt, Ord t) => cfg t nt -> FreeCfg t nt Source #

Returns an equivalent grammar not including unproductive productions.