Struct cfg::sequence::builder::SequenceRuleBuilder [] [src]

pub struct SequenceRuleBuilder<H, D, Hs = NullHistorySource> {
    // some fields omitted
}

Sequence rule builder.

Methods

impl<H, D> SequenceRuleBuilder<H, D> where D: SequenceDestination<H>, H: RewriteSequence
[src]

fn new(destination: D) -> Self

Creates a sequence rule builder.

impl<H, D, Hs> SequenceRuleBuilder<H, D, Hs> where D: SequenceDestination<H>, H: RewriteSequence
[src]

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

Sets the default history source.

fn sequence(self, lhs: Symbol) -> Self

Starts building a sequence rule.

fn separator(self, sep: Separator) -> Self

Assigns the separator symbol and mode of separation.

fn intersperse(self, sym: Symbol) -> Self

Sets proper separation with the given separator symbol.

fn history(self, history: H) -> Self

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

fn inclusive(self, start: u32, end: Option<u32>) -> Self

Assigns the inclusive range of the number of repetitions.

fn rhs(self, rhs: Symbol) -> Self where Hs: HistorySource<H>

Adds a sequence rule to the grammar.

fn rhs_with_history(self, rhs: Symbol, history: H) -> Self

Adds a sequence rule to the grammar.