[−][src]Struct cfg::prediction::FirstSetsCollector
Collector of FIRST sets.
Methods
impl<'a, G> FirstSetsCollector<'a, G> where
G: ContextFree,
&'a G: ContextFreeRef<'a, Target = G>,
[src]
G: ContextFree,
&'a G: ContextFreeRef<'a, Target = G>,
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]
&self,
string: &[Symbol]
) -> BTreeSet<Option<Symbol>>
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,
G: Sync,
impl<'a, G> Sync for FirstSetsCollector<'a, G> where
G: Sync,
G: Sync,
impl<'a, G> Unpin for FirstSetsCollector<'a, G>
impl<'a, G> UnwindSafe for FirstSetsCollector<'a, G> where
G: RefUnwindSafe,
G: RefUnwindSafe,
impl<'a, G> RefUnwindSafe for FirstSetsCollector<'a, 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,