Struct cfg::remap::Remap [] [src]

pub struct Remap<'a, G: 'a> where G: ContextFree {
    // some fields omitted
}

Remaps symbols and removes unused symbols.

Methods

impl<'a, G> Remap<'a, G> where G: ContextFree, G::History: Clone

fn new(grammar: &'a mut G) -> Self

Creates Remap to record information about remapped symbols.

fn remove_unused_symbols(&mut self)

Removes unused symbols.

fn reorder_symbols<F>(&mut self, f: F) where F: Fn(Symbol, Symbol) -> Ordering

Remaps symbols to satisfy given ordering constraints. The argument must be a function that gives total order.

fn get_mapping(self) -> Mapping

Get the mapping.