[][src]Struct cfg::prediction::FirstSetsCollector

pub struct FirstSetsCollector<'a, G> { /* fields omitted */ }

Collector of FIRST sets.

Methods

impl<'a, G> FirstSetsCollector<'a, G> where
    G: ContextFree,
    &'a G: ContextFreeRef<'a, Target = G>, 
[src]

pub fn new(grammar: &'a G) -> Self[src]

Compute all FIRST sets of the grammar.

We define a binary relation FIRST(N, S), in which N is related to S if the grammar has a production of the form N ⸬= α S β, where α is a nullable string of symbols.

We compute the transitive closure of this relation.

pub fn first_set_for_string(
    &self,
    string: &[Symbol]
) -> BTreeSet<Option<Symbol>>
[src]

Calculates a FIRST set for a string of symbols.

pub fn first_sets(&self) -> &PerSymbolSets[src]

Returns a FIRST sets structure.

Auto Trait Implementations

impl<'a, G> Send for FirstSetsCollector<'a, G> where
    G: Sync

impl<'a, G> Sync for FirstSetsCollector<'a, G> where
    G: Sync

impl<'a, G> Unpin for FirstSetsCollector<'a, G>

impl<'a, G> UnwindSafe for FirstSetsCollector<'a, G> where
    G: RefUnwindSafe

impl<'a, G> RefUnwindSafe for FirstSetsCollector<'a, 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]