Struct gearley::grammar::BinarizedGrammar [] [src]

pub struct BinarizedGrammar {
    // some fields omitted
}

Methods

impl BinarizedGrammar

fn new() -> Self

fn set_start(&mut self, start: Symbol)

fn get_start(&self) -> Symbol

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.

Trait Implementations

impl Deref for BinarizedGrammar

type Target = BinarizedCfg<History>

fn deref(&self) -> &Self::Target

impl DerefMut for BinarizedGrammar

fn deref_mut(&mut self) -> &mut Self::Target

Derived Implementations

impl Clone for BinarizedGrammar

fn clone(&self) -> BinarizedGrammar

1.0.0fn clone_from(&mut self, source: &Self)