lexer_builder_runtime library

Types needed at runtime by lexers generated by lexer_builder. See the lexer_builder example for information on how to use generated lexers, and the documentation for the classes here.

Classes

Lexer
Marker annotation for a lexer class.
LexerBase<T extends Token>
Base class for generated lexers. The lexer gets a List of rule lists, ordered by priority. The highest priority rule that matches is chosen, if only one in the list matches. If multiple rules in a list match, the longest match is used.
LexerRule<T extends Token>
Rule representation used internally by the generated code.
Rule
Annotation for a lexer rule.
Token
Base class for all Tokens.
TokenResponse<T extends Token>
Return type for rule methods. Use the constructors to affect the behaviour of the lexer.

Enums

TokenResponseType
The kinds of token responses.

Exceptions / Errors

LexerException
Base class for Lexer exceptions. If you throw exceptions in the rules, you should use a subclass of this.
LexerNoMatchException
No rule matched for the string starting at index.