LexerBase

Trait LexerBase 

Source
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§

Source

fn next_token(&mut self) -> Token

Goes forward to the next token in the stream, if available.

Provided Methods§

Source

fn current_stream(&self) -> Option<String>

Returns the current stream’s name, if any (for example, the normal lexer does know this value)

Implementors§

Source§

impl<LB> LexerBase for SourceLexer<LB>
where LB: LexerBase,

Source§

impl<LB, U> LexerBase for MacroLexer<LB, U>
where LB: LexerBase, U: Clone,

Source§

impl<T: Read> LexerBase for Lexer<T>