Struct rustemo_compiler::grammar::Production
source · pub struct Production {
pub idx: ProdIndex,
pub nonterminal: NonTermIndex,
pub ntidx: usize,
pub kind: Option<String>,
pub rhs: Vec<ResolvingAssignment>,
pub assoc: Associativity,
pub prio: Priority,
pub dynamic: bool,
pub nops: bool,
pub nopse: bool,
pub meta: BTreeMap<String, ConstVal>,
}
Fields§
§idx: ProdIndex
§nonterminal: NonTermIndex
§ntidx: usize
§kind: Option<String>
§rhs: Vec<ResolvingAssignment>
§assoc: Associativity
§prio: Priority
§dynamic: bool
§nops: bool
§nopse: bool
§meta: BTreeMap<String, ConstVal>
Implementations§
source§impl Production
impl Production
pub fn rhs_symbols(&self) -> Vec<SymbolIndex>
sourcepub fn rhs_assign(&self) -> Vec<Assignment>
pub fn rhs_assign(&self) -> Vec<Assignment>
Returns resolved RHS assignments
sourcepub fn rhs_with_content(&self, grammar: &Grammar) -> Vec<Assignment>
pub fn rhs_with_content(&self, grammar: &Grammar) -> Vec<Assignment>
Returns RHS assignment which has some content (i.e. non-terminals and non-constant terminals).
pub fn rhs_symbol(&self, pos: usize) -> SymbolIndex
pub fn nonterminal<'a>(&self, grammar: &'a Grammar) -> &'a NonTerminal
pub fn to_string(&self, grammar: &Grammar) -> String
Trait Implementations§
source§impl Debug for Production
impl Debug for Production
source§impl Default for Production
impl Default for Production
source§impl Display for Production
impl Display for Production
source§impl Hash for Production
impl Hash for Production
source§impl Ord for Production
impl Ord for Production
source§impl PartialEq for Production
impl PartialEq for Production
source§impl PartialOrd for Production
impl PartialOrd for Production
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Production
Auto Trait Implementations§
impl RefUnwindSafe for Production
impl Send for Production
impl Sync for Production
impl Unpin for Production
impl UnwindSafe for Production
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.