ParsingContext
class ParsingContext(val tokens: List<Token>, typeMap: Map<ParserNodeDeclaration<*>, DescribedType<*>>, val branchSeeker: BranchSeeker? = null)
This object contains the information that is passed to expectations, and is global over a single parser run.
Constructors
Link copied to clipboard
constructor(tokens: List<Token>, typeMap: Map<ParserNodeDeclaration<*>, DescribedType<*>>, branchSeeker: BranchSeeker? = null)
Functions
Link copied to clipboard
fun <T> applyExpectations(startAt: Int, expectations: List<Expectation<T, *>>): ExpectationResult<T>
Apply each expectation of this list to the given context, starting at the given index.
Link copied to clipboard
If debugging is enabled, execute a set of expectations "within" a special node. Otherwise, directly executed the provided branch.
Link copied to clipboard
Retrieve the provided node declaration, or null if no such declaration could be found.