Package-level declarations

Types

Link copied to clipboard
class Grammar(val lexemes: List<Lexeme<*>>, val rules: Map<String, Rule<*>>, val startRule: Rule<*>?)

Represents a complete Context-Free Grammar definition with lexing and parsing capabilities.

Functions

Link copied to clipboard
inline fun <T, R : Any> Iterable<T>.mapToFirstNotNullOf(transform: (T) -> R?): Pair<T, R>

Locates the first element T from this Iterable that, when passed to the transform lambda, produces a non-null value R, returning the Pair T to R.

Link copied to clipboard
fun requireNull(value: Any?)

Requires that the given value is null, throwing IllegalArgumentException if it is not.

inline fun <T : Any> requireNull(value: T?, lazyMessage: (T) -> String)

Requires that the given value is null, throwing IllegalArgumentException with the given message if it is not.