Struct automaton::Expression
[−]
[src]
pub struct Expression<T: Token, S> { // some fields omitted }
Methods
impl<T: Token, S> Expression<T, S>
fn token(input: T) -> Expression<T, S>
Returns an automaton that accepts the given token
fn sequence<I: Iterator<Item=T>>(tokens: I) -> Expression<T, S>
fn concat(self, other: Expression<T, S>) -> Expression<T, S>
Concatenate two automata
fn union(self, other: Expression<T, S>) -> Expression<T, S>
fn intersection(self, other: Expression<T, S>) -> Expression<T, S>
fn kleene(self) -> Expression<T, S>
fn optional(self) -> Expression<T, S>
fn on_enter<F: Fn(&mut S) + 'static>(self, action: F) -> Expression<T, S>
Specify an action to be invoked when evaluation enters the machine
fn on_exit<F: Fn(&mut S) + 'static>(self, action: F) -> Expression<T, S>
Specify an action to be invoked when evaluation leaves the machine
fn compile(self) -> Automaton<T, S>
Compile the expression for evaluation