Struct gearley::grammar::BinarizedGrammar
[−]
[src]
pub struct BinarizedGrammar { // some fields omitted }
Methods
impl BinarizedGrammar
impl BinarizedGrammar
fn generate_special_start(self: BinarizedGrammar) -> BinarizedGrammar
fn eliminate_nulling(self: BinarizedGrammar) -> (BinarizedGrammar, BinarizedGrammar)
fn process(self: BinarizedGrammar) -> (BinarizedGrammar, BinarizedGrammar)
Methods from Deref<Target=BinarizedCfg<History>>
fn eliminate_nulling_rules(&mut self) -> BinarizedCfg<H>
Eliminates all rules of the form A ::= epsilon
.
In other words, this splits off the set of nulling rules.
The language represented by the grammar is preserved, except for the possible lack of the empty string. Unproductive rules aren't preserved.
fn sym<T>(&mut self) -> T where T: SymbolContainer
Returns generated symbols.
fn next_sym(&mut self) -> Symbol
Generates a new unique symbol.
fn num_syms(&self) -> usize
Returns the number of symbols in use.
fn sort(&mut self)
Sorts the rule array.
fn sort_by<F>(&mut self, compare: F) where F: FnMut(&BinarizedRule<H>, &BinarizedRule<H>) -> Ordering
Sorts the rule array in place, using the argument to compare elements.
fn dedup(&mut self)
Removes consecutive duplicate rules.