LexerBuilder

This class is used to build a Lexer using the Niwen Lexer DSL, and is used in lambda-with-receivers to provide high level DSLs for the configuration of a lexer.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
inner class StateInfixCreator

Utility class whose only role is to allow the default state construct to work. (default state { ... } and default state label).

Functions

Link copied to clipboard
open override fun build(): Lexer
Link copied to clipboard
fun state(body: StateBuilder.() -> Unit)

Create a state using a high-level DSL and add it to this object. The state is not constructed immediately and is only constructed when build is called.

Link copied to clipboard
infix fun StateLabel.state(body: StateBuilder.() -> Unit)

Register a state with the given StateLabel

Properties

Link copied to clipboard

DSL construct that allows you to directly create and go to a default state. Use it like this: default state { ... }