Struct nff::NonTerminals
source · pub struct NonTerminals { /* private fields */ }
Expand description
Put all nonterminals in a single struct, one hashmap for rules and one each for nullable, first, and follow.
Implementations
sourceimpl NonTerminals
impl NonTerminals
sourcepub fn init(grammar: String) -> Self
pub fn init(grammar: String) -> Self
Init takes the grammar in the form of a string and initializes all the hashmaps.
sourcepub fn calculate_null_set(&mut self)
pub fn calculate_null_set(&mut self)
Determines which nonterminals are nullable
sourcepub fn calculate_first_set(&mut self)
pub fn calculate_first_set(&mut self)
Determines the first set of each nonterminal
sourcepub fn calculate_follow_set(&mut self)
pub fn calculate_follow_set(&mut self)
Determines the follow set of each nonterminal
sourcepub fn print_rules(&self)
pub fn print_rules(&self)
You can use this function to verify that nff understood your rules correctly
sourcepub fn print_results(&self)
pub fn print_results(&self)
Print results
Auto Trait Implementations
impl RefUnwindSafe for NonTerminals
impl Send for NonTerminals
impl Sync for NonTerminals
impl Unpin for NonTerminals
impl UnwindSafe for NonTerminals
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more