Lexer

interface Lexer<T>

Reads characters from a Source and outputs tokens.

Author

AdrianTodt

Parameters

T

The type of tokens the lexer generates.

Functions

parse
Link copied to clipboard
common
abstract 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.

Inheritors

LexerImpl
Link copied to clipboard