Struct lrlex::LRNonStreamingLexer[][src]

pub struct LRNonStreamingLexer<'lexer, 'input: 'lexer, LexemeT, StorageT: Debug> { /* fields omitted */ }
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

Create a new LRNonStreamingLexer that read in: the input s; and derived lexemes and newlines. The newlines Vec<usize> is a sorted list of the byte index of the start of the following line. i.e. for the input string " a\nb\n c d" the Vec should contain [3, 5].

Note that if one or more lexemes or newlines was not created from s, subsequent calls to the LRNonStreamingLexer may cause panics.

Trait Implementations

Iterate over all the lexemes in this lexer. Note that: Read more

Return the user input associated with a Span. Read more

Return the lines containing the input at span (including all the text on the lines that span starts and ends on). Read more

Return ((start line, start column), (end line, end column)) for span. Note that column characters (not bytes) are returned. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.