Package-level declarations

Types

Link copied to clipboard

A PatternElement that matches any one of several alternative elements.

Link copied to clipboard
abstract class Node

Represents a node in an Abstract Syntax Tree (AST) produced by parsing.

Link copied to clipboard
class ParserContext(val input: List<Token>)

Provides context for parsing operations and manages the Rule invocation stack.

Link copied to clipboard
class ParserException(val line: Int? = null, val column: Int? = null, val tokensConsumed: Int = 0, val rule: Rule<*>? = null, val element: PatternElement? = null, message: String, cause: Throwable? = null) : Exception

Exception thrown when parsing fails.

Link copied to clipboard
interface PatternElement

Represents a syntactic element in a production pattern.

Link copied to clipboard
class ReferenceElement<N : Node>(val rule: () -> Rule<N>) : PatternElement

A PatternElement that matches a nonterminal Rule reference.

Link copied to clipboard
class RepeatableElement(val element: PatternElement, val min: Int = 0, val max: Int = Int.MAX_VALUE) : PatternElement

A PatternElement that matches an element repeatedly, within a specified range of repetitions.

Link copied to clipboard
class Rule<out N : Node>(val name: String, val productions: List<Rule.Production<N>>)

Represents a nonterminal symbol in a Grammar with one or more potential productions.

Link copied to clipboard
class RuleBuilder<N : Node>(name: String?)

A DSL builder for defining production rules within a Grammar.

Link copied to clipboard

A PatternElement that matches a sequence of elements in order.

Link copied to clipboard

A PatternElement that matches a single Token based on a matcher criterion.

Functions

Link copied to clipboard

Creates a repeatable PatternElement that matches 1 or more times.

Link copied to clipboard

Creates an optional PatternElement that matches 0 or 1 times.