Package-level declarations

Types

Link copied to clipboard
abstract class AbstractLexeme<out T : Token>(val name: String?) : Lexeme<T>

Abstract base class for Lexeme implementations that provides a name property in its constructor.

Link copied to clipboard

A collection of commonly used Lexeme implementations.

Link copied to clipboard
interface Lexeme<out T : Token>

Defines a pattern for recognizing and producing tokens from character input.

Link copied to clipboard
data class LexemeMatch<out T : Token>(val length: Int, val factory: () -> T? = null)

Represents a successful Lexeme match result.

Link copied to clipboard
class Lexer(val lexemes: List<Lexeme<*>>, val factoryOverrides: Map<Lexeme<*>, (value: CharSequence) -> Token> = emptyMap())

The Lexer transforms raw character input into a stream of tokens based on defined lexemes.

Link copied to clipboard
class LexerContext(val input: CharSequence)

Provides context for Lexer matching operations.

Link copied to clipboard
abstract class Token

Represents a lexical token produced by matching a Lexeme against input.

Properties

Link copied to clipboard