[−][src]Struct cfg::classification::cyclical::Cycles
Provides information about cycles among unit derivations in the grammar. There are two ways of pruning cycles.
Methods
impl<'a, G> Cycles<&'a mut G> where
G: ContextFree,
&'b G: ContextFreeRef<'b, Target = G>,
&'b mut G: ContextFreeMut<'b, Target = G>,
[src]
G: ContextFree,
&'b G: ContextFreeRef<'b, Target = G>,
&'b mut G: ContextFreeMut<'b, Target = G>,
pub fn new(grammar: &'a mut G) -> Cycles<&'a mut G>
[src]
Analyzes the grammar's cycles.
pub fn cycle_free(&self) -> bool
[src]
Checks whether the grammar is cycle-free.
impl<'a, G> Cycles<&'a mut G> where
G: ContextFree,
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
[src]
G: ContextFree,
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
ⓘImportant traits for CycleParticipants<'a, G, <&'a G as ContextFreeRef<'a>>::Rules>pub fn cycle_participants(
&'a self
) -> CycleParticipants<'a, G, <&'a G as ContextFreeRef<'a>>::Rules>
[src]
ⓘImportant traits for CycleParticipants<'a, G, <&'a G as ContextFreeRef<'a>>::Rules>
&'a self
) -> CycleParticipants<'a, G, <&'a G as ContextFreeRef<'a>>::Rules>
Iterates over rules that participate in a cycle.
pub fn remove_cycles(&mut self) where
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
[src]
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
Removes all rules that participate in a cycle. Doesn't preserve the language represented by the grammar.
pub fn rewrite_cycles(&mut self) where
G::History: Clone,
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
[src]
G::History: Clone,
&'a G: ContextFreeRef<'a, Target = G>,
&'a mut G: ContextFreeMut<'a, Target = G>,
Rewrites all rules that participate in a cycle. Preserves the language represented by the grammar.
Auto Trait Implementations
impl<G> Send for Cycles<G> where
G: Send,
G: Send,
impl<G> Sync for Cycles<G> where
G: Sync,
G: Sync,
impl<G> Unpin for Cycles<G> where
G: Unpin,
G: Unpin,
impl<G> UnwindSafe for Cycles<G> where
G: UnwindSafe,
G: UnwindSafe,
impl<G> RefUnwindSafe for Cycles<G> where
G: RefUnwindSafe,
G: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,