Token Element
A PatternElement that matches a single Token based on a matcher criterion.
TokenElement uses a TokenMatcher to determine whether a token at the current position should be matched. Different matcher implementations support matching by token type, lexeme, or custom predicate.
When this PatternElement matches, exactly 1 TokenNode is added to the current capture.
Types
Link copied to clipboard
A matcher that matches tokens if they were produced by a specific lexeme.
Link copied to clipboard
class PredicateMatcher<K : Token>(val type: KClass<K>, val predicate: (K) -> Boolean) : TokenElement.TokenMatcher
Link copied to clipboard
Defines a criterion for matching tokens.
Link copied to clipboard