pub trait IStateContext {
    // Required methods
    fn get_next_character(&mut self) -> StateChar;
    fn output_character(&mut self, character: StateChar);
}
Expand description

Represents the context as passed to each state struct.

Each state struct can access the next character or output the current character through this trait.

Required Methods§

source

fn get_next_character(&mut self) -> StateChar

Get the next character from the input.

Returns

Returns the next character wrapped in a StateChar::Char(). Returns StateChar::Eof if there is no more input.

source

fn output_character(&mut self, character: StateChar)

Write the character to the context. This is how the parser accumulates the filtered text.

Parameters
  • character

The character to accumulate expressed as a StateChar::Char(c).

Implementors§