Struct cfg::precedence::PrecedencedRuleBuilder [] [src]

pub struct PrecedencedRuleBuilder<D, Hs = NullHistorySource> where D: RuleContainer, D::History: AssignPrecedence + Default {
    // some fields omitted
}

Precedenced rules are built in series of rule alternatives with equal precedence.

Methods

impl<D> PrecedencedRuleBuilder<D> where D: RuleContainer, D::History: AssignPrecedence + Default
[src]

fn new(rules: D, lhs: Symbol) -> Self

Returns a precedenced rule builder.

impl<D, Hs> PrecedencedRuleBuilder<D, Hs> where D: RuleContainer, D::History: AssignPrecedence + Default
[src]

fn default_history<Hs2>(self, state: Hs2) -> PrecedencedRuleBuilder<D, Hs2>

Sets the default history source.

fn precedenced_rule(self, lhs: Symbol) -> PrecedencedRuleBuilder<D, Hs>

Starts building a new precedenced rule. The differences in precedence among rules only matter within a particular precedenced rule.

fn rule(self, lhs: Symbol) -> RuleBuilder<D, Hs>

Starts building a new grammar rule.

fn history(self, history: D::History) -> Self

Assigns the rule history, which is used on the next call to rhs, unless overwritten by a call to rhs_with_history.

fn rhs<S>(self, syms: S) -> Self where S: AsRef<[Symbol]>, Hs: HistorySource<D::History>

Creates a rule alternative. If history wasn't provided, the rule has the Default history.

fn rhs_with_history<S>(self, syms: S, history: D::History) -> Self where S: AsRef<[Symbol]>

Creates a rule alternative with the given RHS and history.

fn associativity(self, assoc: Associativity) -> Self where D::History: AssignPrecedence

Assigns the associativity, which influences the next call to rhs or rhs_with_history.

fn lower_precedence(self) -> Self

Assigns lower precedence to rule alternatives that are built after this call.

Trait Implementations

impl<D, Hs> Drop for PrecedencedRuleBuilder<D, Hs> where D: RuleContainer, D::History: AssignPrecedence + Default
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more