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

pub struct PrecedencedRuleBuilder<D, Hs = NullHistorySource> where
    D: RuleContainer,
    D::History: AssignPrecedence + Default
{ /* 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]

pub fn new(rules: D, lhs: Symbol) -> Self[src]

Returns a precedenced rule builder.

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

pub fn default_history<Hs2>(self, state: Hs2) -> PrecedencedRuleBuilder<D, Hs2>[src]

Sets the default history source.

pub fn precedenced_rule(self, lhs: Symbol) -> PrecedencedRuleBuilder<D, Hs>[src]

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

pub fn rule(self, lhs: Symbol) -> RuleBuilder<D, Hs>[src]

Starts building a new grammar rule.

pub fn history(self, history: D::History) -> Self[src]

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

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

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

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

Creates a rule alternative with the given RHS and history.

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

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

pub fn lower_precedence(self) -> Self[src]

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]

Auto Trait Implementations

impl<D, Hs> Send for PrecedencedRuleBuilder<D, Hs> where
    D: Send,
    Hs: Send,
    <D as RuleContainer>::History: Send

impl<D, Hs> Sync for PrecedencedRuleBuilder<D, Hs> where
    D: Sync,
    Hs: Sync,
    <D as RuleContainer>::History: Sync

impl<D, Hs> Unpin for PrecedencedRuleBuilder<D, Hs> where
    D: Unpin,
    Hs: Unpin,
    <D as RuleContainer>::History: Unpin

impl<D, Hs> UnwindSafe for PrecedencedRuleBuilder<D, Hs> where
    D: UnwindSafe,
    Hs: UnwindSafe,
    <D as RuleContainer>::History: UnwindSafe

impl<D, Hs> RefUnwindSafe for PrecedencedRuleBuilder<D, Hs> where
    D: RefUnwindSafe,
    Hs: RefUnwindSafe,
    <D as RuleContainer>::History: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]