pub struct Remap<'a> { /* private fields */ }Expand description
Remaps symbols and removes unused symbols.
Implementations§
Source§impl<'a> Remap<'a>
impl<'a> Remap<'a>
Sourcepub fn new(grammar: &'a mut Cfg) -> Self
pub fn new(grammar: &'a mut Cfg) -> 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)
pub fn reorder_symbols<F>(&mut self, f: F)
Remaps symbols to satisfy given ordering constraints. The argument must be a function that gives total order.
Sourcepub fn remap_symbols<F>(&mut self, map: F)
pub fn remap_symbols<F>(&mut self, map: F)
Translates symbols in rules to new symbol IDs.
Translates those inside wrapped_roots as well.
Sourcepub fn get_mapping(self) -> Mapping
pub fn get_mapping(self) -> Mapping
Get the mapping.
Auto Trait Implementations§
impl<'a> Freeze for Remap<'a>
impl<'a> !RefUnwindSafe for Remap<'a>
impl<'a> !Send for Remap<'a>
impl<'a> !Sync for Remap<'a>
impl<'a> Unpin for Remap<'a>
impl<'a> !UnwindSafe for Remap<'a>
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