Struct rustemo::StringLexer

source ·
pub struct StringLexer<C, S, TK, TR: 'static, const TERMINAL_COUNT: usize> { /* private fields */ }
Expand description

A lexer that operates over string inputs and uses generated string and regex recognizers provided by the parser table.

Implementations§

source§

impl<'i, C: Context<'i, str, S, TK>, S: State, TK, TR: TokenRecognizer<'i>, const TERMINAL_COUNT: usize> StringLexer<C, S, TK, TR, TERMINAL_COUNT>

source

pub fn new( skip_ws: bool, token_recognizers: &'static [TR; TERMINAL_COUNT] ) -> Self

Trait Implementations§

source§

impl<'i, C, S, TK, TR, const TERMINAL_COUNT: usize> Lexer<'i, C, S, TK> for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
where C: Context<'i, str, S, TK>, S: State + Into<usize>, TK: Debug + Into<usize> + Copy + 'i, TR: TokenRecognizer<'i>,

§

type Input = str

source§

fn next_tokens( &self, context: &mut C, input: &'i Self::Input, expected_tokens: Vec<(TK, bool)> ) -> Box<dyn Iterator<Item = Token<'i, Self::Input, TK>> + 'i>

Given the current context, this method yield an iterator over possible tokens found at the current location where the order and kinds of token to look for, and its finish flags, are given by the expected_tokens parameter. Read more

Auto Trait Implementations§

§

impl<C, S, TK, TR, const TERMINAL_COUNT: usize> RefUnwindSafe for StringLexer<C, S, TK, TR, TERMINAL_COUNT>

§

impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Send for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
where C: Send, S: Send, TK: Send, TR: Sync,

§

impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Sync for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
where C: Sync, S: Sync, TK: Sync, TR: Sync,

§

impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Unpin for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
where C: Unpin, S: Unpin, TK: Unpin,

§

impl<C, S, TK, TR, const TERMINAL_COUNT: usize> UnwindSafe for StringLexer<C, S, TK, TR, TERMINAL_COUNT>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.