pub struct TermLexer<I>where
I: FusedIterator<Item = u8>,{
pub opers: OperDefs,
/* private fields */
}Fields§
§opers: OperDefsImplementations§
Trait Implementations§
Source§impl<I> Lexer<Arena> for TermLexer<I>where
I: FusedIterator<Item = u8>,
impl<I> Lexer<Arena> for TermLexer<I>where
I: FusedIterator<Item = u8>,
Source§type LexerData = LexData
type LexerData = LexData
The lexer data providing DFA tables and rule definitions.
Must be provided by the implementer and must be the struct generated by
parlex-gen’s lexer generator, Alex.
Source§type Token = TermToken
type Token = TermToken
The token type produced by the lexer.
Must be provided by the implementor.
Source§fn ctx(&self) -> &LexerCtx<Self::Input, Self::LexerData, Self::Token>
fn ctx(&self) -> &LexerCtx<Self::Input, Self::LexerData, Self::Token>
Returns a shared reference to the lexer context.
Must be provided by the implementor and return
&LexerCtx.Source§fn ctx_mut(
&mut self,
) -> &mut LexerCtx<Self::Input, Self::LexerData, Self::Token>
fn ctx_mut( &mut self, ) -> &mut LexerCtx<Self::Input, Self::LexerData, Self::Token>
Returns a mutable reference to the lexer context.
Must be provided by the implementor and return
&mut LexerCtx.Source§fn action(
&mut self,
arena: &mut Arena,
rule: <Self::LexerData as LexerData>::LexerRule,
) -> Result<()>
fn action( &mut self, arena: &mut Arena, rule: <Self::LexerData as LexerData>::LexerRule, ) -> Result<()>
Executes a lexer action based on the matched rule and user data.
Must be provided by the implementor.
Source§fn stats(&self) -> LexerStats
fn stats(&self) -> LexerStats
Returns current lexer statistics.
Source§fn try_collect(&mut self, user_data: &mut U) -> Result<Vec<Self::Token>, Error>
fn try_collect(&mut self, user_data: &mut U) -> Result<Vec<Self::Token>, Error>
Collects all tokens from the input until exhaustion.
Source§fn try_next(&mut self, user_data: &mut U) -> Result<Option<Self::Token>, Error>
fn try_next(&mut self, user_data: &mut U) -> Result<Option<Self::Token>, Error>
Attempts to fetch the next token from the input stream.
Source§fn begin(&mut self, mode: <Self::LexerData as LexerData>::LexerMode)
fn begin(&mut self, mode: <Self::LexerData as LexerData>::LexerMode)
Switches the lexer to a different mode.
Source§fn yield_token(&mut self, token: Self::Token)
fn yield_token(&mut self, token: Self::Token)
Emits a token into the output queue.
Source§fn take_str(&mut self) -> Result<SmartString<LazyCompact>, Error>
fn take_str(&mut self) -> Result<SmartString<LazyCompact>, Error>
Takes accumulated bytes from the main buffer and converts them into a UTF-8 string.
Source§fn take_str2(&mut self) -> Result<SmartString<LazyCompact>, Error>
fn take_str2(&mut self) -> Result<SmartString<LazyCompact>, Error>
Takes accumulated bytes from the secondary buffer and converts them into a UTF-8 string.
Source§fn extend_buffer2_with_buffer(&mut self)
fn extend_buffer2_with_buffer(&mut self)
Extends the secondary buffer with the contents of the main buffer.
Auto Trait Implementations§
impl<I> Freeze for TermLexer<I>where
I: Freeze,
impl<I> RefUnwindSafe for TermLexer<I>where
I: RefUnwindSafe,
impl<I> Send for TermLexer<I>where
I: Send,
impl<I> Sync for TermLexer<I>where
I: Sync,
impl<I> Unpin for TermLexer<I>where
I: Unpin,
impl<I> UnwindSafe for TermLexer<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more