Trait cfg::history::RewriteSequence [] [src]

pub trait RewriteSequence {
    type Rewritten;
    fn top(&self, rhs: Symbol, sep: Option<Symbol>, new_rhs: &[Symbol]) -> Self::Rewritten;
    fn bottom(&self, rhs: Symbol, sep: Option<Symbol>, new_rhs: &[Symbol]) -> Self::Rewritten;
}

Trait for history types that allow the sequence rule to be rewritten into grammar rules.

Associated Types

type Rewritten

Must be an Action, because all created grammar rules except the topmost one will have no-op semantic action.

Required Methods

fn top(&self, rhs: Symbol, sep: Option<Symbol>, new_rhs: &[Symbol]) -> Self::Rewritten

Returns a history. May record the rewrite.

fn bottom(&self, rhs: Symbol, sep: Option<Symbol>, new_rhs: &[Symbol]) -> Self::Rewritten

Returns a history. May record the rewrite.

Implementors