[][src]Struct antlr_rust::BaseLexer

pub struct BaseLexer<'input, T: LexerRecog<'input, Self> + 'static, Input: CharStream<TF::From>, TF: TokenFactory<'input> = CommonTokenFactory> {
    pub interpreter: Option<LexerATNSimulator>,
    pub input: Option<Input>,
    pub token_start_char_index: isize,
    pub token_start_line: isize,
    pub token_start_column: isize,
    pub token_type: isize,
    pub token: Option<TF::Tok>,
    pub channel: isize,
    pub mode: usize,
    pub text: Option<<TF::Data as ToOwned>::Owned>,
    // some fields omitted
}

Fields

interpreter: Option<LexerATNSimulator>input: Option<Input>token_start_char_index: isizetoken_start_line: isizetoken_start_column: isizetoken_type: isizetoken: Option<TF::Tok>channel: isizemode: usizetext: Option<<TF::Data as ToOwned>::Owned>

text of token if overridden by user action

Implementations

impl<'input, T, Input, TF> BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

pub fn get_type(&self) -> isize[src]

pub fn get_char_index(&self) -> isize[src]

pub fn get_text<'a>(&'a self) -> Cow<'a, TF::Data> where
    'input: 'a, 
[src]

Current token text

pub fn set_text(&mut self, _text: <TF::Data as ToOwned>::Owned)[src]

Used from lexer actions to override text of the token that will be emitted next

pub fn add_error_listener(
    &mut self,
    listener: Box<dyn ErrorListener<'input, Self>>
)
[src]

Add error listener

pub fn remove_error_listeners(&mut self)[src]

pub fn new_base_lexer(
    input: Input,
    interpreter: LexerATNSimulator,
    recog: T,
    factory: &'input TF
) -> Self
[src]

Trait Implementations

impl<'input, T, Input, TF> Lexer<'input> for BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

impl<'input, T, Input, TF> Recognizer<'input> for BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

type Node = EmptyContextType<'input, TF>

impl<'input, T, Input, TF> TokenAware<'input> for BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

type TF = TF

impl<'input, T, Input, TF> TokenSource<'input> for BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

Auto Trait Implementations

impl<'input, T, Input, TF = CommonTokenFactory> !RefUnwindSafe for BaseLexer<'input, T, Input, TF>

impl<'input, T, Input, TF = CommonTokenFactory> !Send for BaseLexer<'input, T, Input, TF>

impl<'input, T, Input, TF = CommonTokenFactory> !Sync for BaseLexer<'input, T, Input, TF>

impl<'input, T, Input, TF> Unpin for BaseLexer<'input, T, Input, TF> where
    Input: Unpin,
    T: Unpin,
    <<TF as TokenFactory<'input>>::Data as ToOwned>::Owned: Unpin,
    <TF as TokenFactory<'input>>::Tok: Unpin

impl<'input, T, Input, TF = CommonTokenFactory> !UnwindSafe for BaseLexer<'input, T, Input, TF>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NodeText for T[src]

impl<'input, T> NodeText for T where
    T: CustomRuleContext<'input>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.