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

Safe HaskellNone
LanguageHaskell2010

Data.Cfg.RuleApplication

Description

Results of application of the production rules of a grammar.

Synopsis

Documentation

language :: (Cfg cfg t nt, Ord nt) => cfg t nt -> [Vs t nt] Source

Given a grammar, returns all strings of terminals yielded by application of the production rules to the start symbol. This is the language of the grammar.

yields :: forall cfg t nt. (Cfg cfg t nt, Ord nt) => cfg t nt -> [Vs t nt] Source

Given a grammar, returns all strings yielded by application of production rules.

directlyYields :: Cfg cfg t nt => cfg t nt -> Vs t nt -> [Vs t nt] Source

Given a grammar and a string of symbols, returns the strings yielded by application of a production rule; that is, by expanding one nonterminal in the string.