Struct lrlex::LRNonStreamingLexer
source · pub struct LRNonStreamingLexer<'lexer, 'input: 'lexer, LexerTypesT: LexerTypes>{ /* private fields */ }
Expand description
An LRNonStreamingLexer
holds a reference to a string and can lex it into lrpar::Lexemes.
Although the struct is tied to a single string, no guarantees are made about whether the
lexemes are cached or not.
Implementations§
source§impl<'lexer, 'input: 'lexer, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes<StorageT = StorageT>> LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
usize: AsPrimitive<StorageT>,
impl<'lexer, 'input: 'lexer, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes<StorageT = StorageT>> LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
usize: AsPrimitive<StorageT>,
sourcepub fn new(
s: &'input str,
lexemes: Vec<Result<LexerTypesT::LexemeT, LRLexError>>,
newlines: NewlineCache,
) -> LRNonStreamingLexer<'lexer, 'input, LexerTypesT>
pub fn new( s: &'input str, lexemes: Vec<Result<LexerTypesT::LexemeT, LRLexError>>, newlines: NewlineCache, ) -> LRNonStreamingLexer<'lexer, 'input, LexerTypesT>
Create a new LRNonStreamingLexer
that read in: the input s
; and derived lexemes
and
newlines
.
Note that if one or more lexemes or newlines was not created from s
, subsequent calls to
the LRNonStreamingLexer
may cause panic
s.
Trait Implementations§
source§impl<'lexer, 'input: 'lexer, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes<StorageT = StorageT, LexErrorT = LRLexError>> Lexer<LexerTypesT> for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
usize: AsPrimitive<StorageT>,
impl<'lexer, 'input: 'lexer, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes<StorageT = StorageT, LexErrorT = LRLexError>> Lexer<LexerTypesT> for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
usize: AsPrimitive<StorageT>,
source§impl<'lexer, 'input: 'lexer, LexerTypesT: LexerTypes<LexErrorT = LRLexError>> NonStreamingLexer<'input, LexerTypesT> for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>
impl<'lexer, 'input: 'lexer, LexerTypesT: LexerTypes<LexErrorT = LRLexError>> NonStreamingLexer<'input, LexerTypesT> for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>
Auto Trait Implementations§
impl<'lexer, 'input, LexerTypesT> Freeze for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>
impl<'lexer, 'input, LexerTypesT> RefUnwindSafe for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
<LexerTypesT as LexerTypes>::StorageT: Sized + RefUnwindSafe,
usize: Sized,
<LexerTypesT as LexerTypes>::LexemeT: RefUnwindSafe,
impl<'lexer, 'input, LexerTypesT> Send for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
<LexerTypesT as LexerTypes>::StorageT: Sized + Send,
usize: Sized,
<LexerTypesT as LexerTypes>::LexemeT: Send,
impl<'lexer, 'input, LexerTypesT> Sync for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
<LexerTypesT as LexerTypes>::StorageT: Sized + Sync,
usize: Sized,
<LexerTypesT as LexerTypes>::LexemeT: Sync,
impl<'lexer, 'input, LexerTypesT> Unpin for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
<LexerTypesT as LexerTypes>::StorageT: Sized + Unpin,
usize: Sized,
<LexerTypesT as LexerTypes>::LexemeT: Unpin,
impl<'lexer, 'input, LexerTypesT> UnwindSafe for LRNonStreamingLexer<'lexer, 'input, LexerTypesT>where
<LexerTypesT as LexerTypes>::StorageT: Sized + UnwindSafe,
usize: Sized,
<LexerTypesT as LexerTypes>::LexemeT: 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