Struct cfg::rule::Rule [] [src]

pub struct Rule<H> {
    pub rhs: Vec<Symbol>,
    pub history: H,
    // some fields omitted
}

Typical grammar rule representation.

Fields

rhs

The rule's right-hand side.

history

The rule's history.

Methods

impl<H> Rule<H>

fn new(lhs: Symbol, rhs: Vec<Symbol>, history: H) -> Self

Creates a new rule.

Trait Implementations

impl<H> GrammarRule for Rule<H>

type History = H

fn lhs(&self) -> Symbol

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

fn history(&self) -> &H

Derived Implementations

impl<H: Debug> Debug for Rule<H>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<H: Clone> Clone for Rule<H>

fn clone(&self) -> Rule<H>

1.0.0fn clone_from(&mut self, source: &Self)