[][src]Struct cfg::classification::cyclical::Cycles

pub struct Cycles<G> { /* fields omitted */ }

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]

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]

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]

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]

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]

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

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

impl<G> RefUnwindSafe for Cycles<G> where
    G: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]