Struct lrlex::LRNonStreamingLexerDef [−][src]
pub struct LRNonStreamingLexerDef<LexemeT, StorageT> { /* fields omitted */ }
Expand description
This struct represents, in essence, a .l file in memory. From it one can produce an LRNonStreamingLexer which actually lexes inputs.
Implementations
pub fn lexer<'lexer, 'input: 'lexer>(
&'lexer self,
s: &'input str
) -> LRNonStreamingLexer<'lexer, 'input, LexemeT, StorageT>
pub fn lexer<'lexer, 'input: 'lexer>(
&'lexer self,
s: &'input str
) -> LRNonStreamingLexer<'lexer, 'input, LexemeT, StorageT>
Return an LRNonStreamingLexer for the String
s
that will lex relative to this
LRNonStreamingLexerDef.
Trait Implementations
Instantiate a lexer from a string (e.g. representing a .l
file).
Get the Rule
instance associated with a particular lexeme ID. Panics if no such rule
exists. Read more
Get the Rule
instance associated with a particular name.
Set the id attribute on rules to the corresponding value in map
. This is typically used
to synchronise a parser’s notion of lexeme IDs with the lexers. While doing this, it keeps
track of which lexemes: Read more
Returns an iterator over all rules in this AST.