pub struct Cycles<G> { /* private fields */ }Expand description
Provides information about cycles among unit derivations in the grammar. There are two ways of pruning cycles.
Implementations§
Source§impl<G> Cycles<G>where
G: RuleContainer,
impl<G> Cycles<G>where
G: RuleContainer,
Source§impl<'a, G> Cycles<&'a mut G>where
G: RuleContainer,
impl<'a, G> Cycles<&'a mut G>where
G: RuleContainer,
Sourcepub fn cycle_participants(
&'a self,
) -> CycleParticipants<'a, G, impl Iterator<Item = RuleRef<'a>>> ⓘ
pub fn cycle_participants( &'a self, ) -> CycleParticipants<'a, G, impl Iterator<Item = RuleRef<'a>>> ⓘ
Iterates over rules that participate in a cycle.
Sourcepub fn remove_cycles(&mut self)
pub fn remove_cycles(&mut self)
Removes all rules that participate in a cycle. Doesn’t preserve the language represented by the grammar.
Sourcepub fn rewrite_cycles(&mut self)
pub fn rewrite_cycles(&mut self)
Rewrites all rules that participate in a cycle. Preserves the language represented by the grammar.
Auto Trait Implementations§
impl<G> Freeze for Cycles<G>where
G: Freeze,
impl<G> RefUnwindSafe for Cycles<G>where
G: RefUnwindSafe,
impl<G> Send for Cycles<G>where
G: Send,
impl<G> Sync for Cycles<G>where
G: Sync,
impl<G> Unpin for Cycles<G>where
G: Unpin,
impl<G> UnwindSafe for Cycles<G>where
G: UnwindSafe,
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