Skip to main content

TokenSource

Trait TokenSource 

Source
pub trait TokenSource {
    // Required methods
    fn next_token(&mut self) -> CommonToken;
    fn line(&self) -> usize;
    fn column(&self) -> usize;
    fn source_name(&self) -> &str;

    // Provided methods
    fn drain_errors(&mut self) -> Vec<TokenSourceError> { ... }
    fn lexer_dfa_string(&self) -> String { ... }
}

Required Methods§

Source

fn next_token(&mut self) -> CommonToken

Source

fn line(&self) -> usize

Source

fn column(&self) -> usize

Source

fn source_name(&self) -> &str

Provided Methods§

Source

fn drain_errors(&mut self) -> Vec<TokenSourceError>

Returns and clears diagnostics emitted while fetching tokens.

Source

fn lexer_dfa_string(&self) -> String

Serializes lexer DFA cache state when the token source exposes one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§