Parser Context
A parsing context, created by a Parser.parse call, which exposes an interface for pratt-parsing.
Author
AdrianTodt
Parameters
T
The parser's (and underlying grammar's) token type.
E
The parser's (and underlying grammar's) expression result.
Functions
parse Expression
Link copied to clipboard
Parses the expression using this parser's grammar.
peek Ahead Until
Link copied to clipboard
Peeks the tokens ahead until a token of any of the types is found.
with Grammar
Link copied to clipboard
abstract fun withGrammar(grammar: Grammar<T, K, E>): ParserContext<T, K, E>
Content copied to clipboard
Creates a child parser context with the specified grammar.
Properties
Extensions
eat Sequence
Link copied to clipboard
ensure EOF
Link copied to clipboard
After executing a given block, throws a SyntaxException if remaining tokens are found in the ParserContext. Otherwise, returns the block's computed result.