pub trait LexerBase {
// Required method
fn next_token(&mut self) -> Token;
// Provided method
fn current_stream(&self) -> Option<String> { ... }
}Expand description
Every lexer implements LexerBase and next_token allows to move to the next token of a given stream, until the end has been reached.
Required Methods§
Sourcefn next_token(&mut self) -> Token
fn next_token(&mut self) -> Token
Goes forward to the next token in the stream, if available.
Provided Methods§
Sourcefn current_stream(&self) -> Option<String>
fn current_stream(&self) -> Option<String>
Returns the current stream’s name, if any (for example, the normal lexer does know this value)