pub struct Remap<'a, G>where
G: RuleContainer + 'a,{ /* private fields */ }
Expand description
Remaps symbols and removes unused symbols.
Implementations§
source§impl<'a, G> Remap<'a, G>where
G: RuleContainer,
impl<'a, G> Remap<'a, G>where G: RuleContainer,
sourcepub fn new(grammar: &'a mut G) -> Self
pub fn new(grammar: &'a mut G) -> Self
Creates Remap
to record information about remapped symbols.
sourcepub fn remove_unused_symbols(&mut self)
pub fn remove_unused_symbols(&mut self)
Removes unused symbols.
sourcepub fn reorder_symbols<F>(&mut self, f: F)where
F: Fn(Symbol, Symbol) -> Ordering,
pub 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.
sourcepub fn get_mapping(self) -> Mapping
pub fn get_mapping(self) -> Mapping
Get the mapping.
Auto Trait Implementations§
impl<'a, G> RefUnwindSafe for Remap<'a, G>where G: RefUnwindSafe,
impl<'a, G> Send for Remap<'a, G>where G: Send,
impl<'a, G> Sync for Remap<'a, G>where G: Sync,
impl<'a, G> Unpin for Remap<'a, G>
impl<'a, G> !UnwindSafe for Remap<'a, G>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more