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: Vec<Symbol>

The rule's right-hand side.

history: H

The rule's history.

Methods

impl<H> Rule<H>
[src]

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

Creates a new rule.

Trait Implementations

impl<H: Debug> Debug for Rule<H>
[src]

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

Formats the value using the given formatter.

impl<H: Clone> Clone for Rule<H>
[src]

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

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<H> GrammarRule for Rule<H>
[src]

type History = H

The type of history carried with the rule.

fn lhs(&self) -> Symbol

Returns the rule's left-hand side.

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

Returns the rule's right-hand side.

fn history(&self) -> &H

Returns a reference to the history carried with the rule.