Struct cfg::classification::cyclical::Cycles
source · 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<'a, G> Cycles<&'a mut G>where
G: RuleContainer + Default,
for<'b> &'b G: RuleContainerRef<'b, Target = G>,
for<'b> &'b mut G: RuleContainerMut<'b, Target = G>,
impl<'a, G> Cycles<&'a mut G>where G: RuleContainer + Default, for<'b> &'b G: RuleContainerRef<'b, Target = G>, for<'b> &'b mut G: RuleContainerMut<'b, Target = G>,
source§impl<'a, G> Cycles<&'a mut G>where
G: RuleContainer + Default,
&'a G: RuleContainerRef<'a, Target = G>,
&'a mut G: RuleContainerMut<'a, Target = G>,
impl<'a, G> Cycles<&'a mut G>where G: RuleContainer + Default, &'a G: RuleContainerRef<'a, Target = G>, &'a mut G: RuleContainerMut<'a, Target = G>,
sourcepub fn cycle_participants(
&'a self
) -> CycleParticipants<'a, G, <&'a G as RuleContainerRef<'a>>::Rules> ⓘ
pub fn cycle_participants( &'a self ) -> CycleParticipants<'a, G, <&'a G as RuleContainerRef<'a>>::Rules> ⓘ
Iterates over rules that participate in a cycle.
sourcepub fn remove_cycles(&mut self)where
&'a G: RuleContainerRef<'a, Target = G>,
&'a mut G: RuleContainerMut<'a, Target = G>,
pub fn remove_cycles(&mut self)where &'a G: RuleContainerRef<'a, Target = G>, &'a mut G: RuleContainerMut<'a, Target = G>,
Removes all rules that participate in a cycle. Doesn’t preserve the language represented by the grammar.
sourcepub fn rewrite_cycles(&mut self)where
&'a G: RuleContainerRef<'a, Target = G>,
&'a mut G: RuleContainerMut<'a, Target = G>,
pub fn rewrite_cycles(&mut self)where &'a G: RuleContainerRef<'a, Target = G>, &'a mut G: RuleContainerMut<'a, Target = G>,
Rewrites all rules that participate in a cycle. Preserves the language represented by the grammar.
Auto Trait Implementations§
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