pub enum NTValue {
None,
Parents,
Default,
SetIds(Vec<VarId>),
SetNames(Vec<String>),
}Expand description
Determines which nonterminals have a value, so a dedicated type and field in contexts:
None: No nonterminal has a valueParents: Only the top nonterminal parents have a valueDefault: The top nonterminal parents and the children of(<L> )+*have a valueSetIds(Vec<VarId>): The nonterminals that have a value is set explicitly by IDSetNames(Vec<String>): The nonterminals that have a value is set explicitly by name. The names “<default>” and “<parents>” can be used to set all the nonterminals of the corresponding class. Individual nonterminals can be preceded by a “-” to indicate they don’t hold a value.
Variants§
None
No nonterminal has a value
Parents
Only the top nonterminal parents have a value
Default
The top nonterminal parents and the children of (<L> )+* have a value
SetIds(Vec<VarId>)
The set of nonterminals that have a value is set explicitly by ID
SetNames(Vec<String>)
The set of nonterminals that have a value is set explicitly by name. Individual names preceded by a “-” don’t have a value.
Implementations§
Source§impl NTValue
impl NTValue
Sourcepub const DEFAULT: &str = "<default>"
pub const DEFAULT: &str = "<default>"
Only the top nonterminal parents have a value (can be used in NTValue::SetNames)
Sourcepub const PARENTS: &str = "<parents>"
pub const PARENTS: &str = "<parents>"
The top nonterminal parents and the children of (<L> )+* have a value (can be used in NTValue::SetNames)
pub fn is_none(&self) -> bool
pub fn is_parents(&self) -> bool
pub fn is_default(&self) -> bool
pub fn is_ids(&self) -> bool
pub fn is_names(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for NTValue
Auto Trait Implementations§
impl Freeze for NTValue
impl RefUnwindSafe for NTValue
impl Send for NTValue
impl Sync for NTValue
impl Unpin for NTValue
impl UnsafeUnpin for NTValue
impl UnwindSafe for NTValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> BuildFrom<S> for S
impl<S> BuildFrom<S> for S
Source§fn build_from(source: S) -> S
fn build_from(source: S) -> S
Converts to this type from the input type.
Source§impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
Source§fn build_into(self) -> T
fn build_into(self) -> T
Calls T::from(self) to convert a S into a T.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
Source§type Error = <T as TryBuildFrom<S>>::Error
type Error = <T as TryBuildFrom<S>>::Error
The type returned in the event of a conversion error.
Source§fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
Performs the conversion.