Struct gearley::grammar::BinarizedGrammar
[−]
[src]
pub struct BinarizedGrammar { /* fields omitted */ }
Methods
impl BinarizedGrammar
[src]
impl BinarizedGrammar
[src]
fn generate_special_start(self: BinarizedGrammar) -> BinarizedGrammar
fn eliminate_nulling(
self: BinarizedGrammar
) -> (BinarizedGrammar, BinarizedGrammar)
self: BinarizedGrammar
) -> (BinarizedGrammar, BinarizedGrammar)
fn process(self: BinarizedGrammar) -> (BinarizedGrammar, BinarizedGrammar)
Methods from Deref<Target = BinarizedCfg<History>>
fn sort(&mut self)
Sorts the rule array.
fn sort_by<F>(&mut self, compare: F) where
F: FnMut(&BinarizedRule<H>, &BinarizedRule<H>) -> Ordering,
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.
fn sym<T>(&mut self) -> T where
T: SymbolContainer,
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 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.
Trait Implementations
impl Clone for BinarizedGrammar
[src]
fn clone(&self) -> BinarizedGrammar
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Deref for BinarizedGrammar
[src]
type Target = BinarizedCfg<History>
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value