LexerImpl

class LexerImpl<T>(root: MatcherImpl<T>) : Lexer<T>

Types

ContextImpl
Link copied to clipboard
common
inner class ContextImpl(source: Source, output: (T) -> Unit) : LexerContext<T>
LexerMatcher
Link copied to clipboard
common
data class LexerMatcher<T>(trie: Map<Char, LexerImpl.LexerMatcher<T>>, predicates: List<Pair<CharPredicate, LexerImpl.LexerMatcher<T>>>, onMatch: ClosureFunction<LexerContext<T>, Char, Unit>?)

Functions

doParse
Link copied to clipboard
common
fun doParse(impl: LexerImpl.ContextImpl<T>, ctx: LexerContext<T> = impl)
parse
Link copied to clipboard
common
open override fun parse(source: Source, output: (T) -> Unit)
Parses a source and outputs tokens into a consumer.
parseTo
Link copied to clipboard
common
open fun <C : MutableCollection<in T>> parseTo(source: Source, collection: C): C
Parses a source and adds all tokens into a collection.
parseToList
Link copied to clipboard
common
open fun parseToList(source: Source): List<T>
Parses a source and adds all tokens into a list.