Trait cfg::rule::GrammarRule

source ·
pub trait GrammarRule {
    // Required methods
    fn lhs(&self) -> Symbol;
    fn rhs(&self) -> &[Symbol];
    fn history_id(&self) -> HistoryId;

    // Provided method
    fn as_ref(&self) -> RuleRef<'_> { ... }
}
Expand description

Trait for rules of a context-free grammar.

Required Methods§

source

fn lhs(&self) -> Symbol

Returns the rule’s left-hand side.

source

fn rhs(&self) -> &[Symbol]

Returns the rule’s right-hand side.

source

fn history_id(&self) -> HistoryId

Returns a reference to the history carried with the rule.

Provided Methods§

source

fn as_ref(&self) -> RuleRef<'_>

Implementations on Foreign Types§

source§

impl<'a, R> GrammarRule for &'a Rwhere R: GrammarRule,

source§

fn lhs(&self) -> Symbol

source§

fn rhs(&self) -> &[Symbol]

source§

fn history_id(&self) -> HistoryId

Implementors§