Trait Lexer

Source
pub trait Lexer<AT: Default> {
    // Required method
    fn nextsym(&mut self) -> Option<Lextoken<AT>>;

    // Provided methods
    fn linenum(&self) -> usize { ... }
    fn column(&self) -> usize { ... }
    fn current_line(&self) -> &str { ... }
}
Expand description

This trait is deprecated by Tokenizer and is only available with the legacy-parser installation feature.

Required Methods§

Source

fn nextsym(&mut self) -> Option<Lextoken<AT>>

retrieves the next Lextoken, or None at end-of-stream.

Provided Methods§

Source

fn linenum(&self) -> usize

returns the current line number. The default implementation returns 0.

Source

fn column(&self) -> usize

returns the current column (character position) on the current line. The default implementation returns 0;

Source

fn current_line(&self) -> &str

returns the current line being tokenized. The default implementation returns the empty string.

Implementors§

Source§

impl<'t, AT: Default> Lexer<AT> for charlexer<'t>