MatcherImpl

class MatcherImpl<T> : LexerDSL<T>

Functions

configure
Link copied to clipboard
common
open override fun configure(block: ClosureFunction<LexerContext<T>, Char, Unit>)
Configures the lexer to execute a specific block of code when match.
invoke
Link copied to clipboard
common
open operator fun Char.invoke(block: ClosureFunction<LexerContext<T>, Char, Unit> = {})
Configures the lexer to execute a specific block of code when this character matches.
open operator fun String.invoke(block: ClosureFunction<LexerContext<T>, Char, Unit> = {})
Configures the lexer to execute a specific block of code when this sequence of characters matches.
isEmpty
Link copied to clipboard
common
fun isEmpty(): Boolean
matching
Link copied to clipboard
common
open override fun matching(char: Char): MatcherImpl<T>
Returns a matcher for a character.
open override fun matching(block: CharPredicate): MatcherImpl<T>
Returns a matcher for a predicate.
open override fun matching(string: String): MatcherImpl<T>
Returns a matcher for a sequence of characters.
open fun matching(char: Char, block: Closure<LexerDSL<T>, Unit>)
Returns a matcher for a characters and configures it.
open fun matching(string: String, block: Closure<LexerDSL<T>, Unit>)
Returns a matcher for a sequence of characters and configures it.

Properties

onMatch
Link copied to clipboard
common
var onMatch: ClosureFunction<LexerContext<T>, Char, Unit>? = null
predicates
Link copied to clipboard
common
val predicates: ArrayList<Pair<CharPredicate, MatcherImpl<T>>>
trie
Link copied to clipboard
common
val trie: LinkedHashMap<Char, MatcherImpl<T>>