prefix

abstract fun prefix(type: T, parselet: PrefixParselet<T, E>, override: Boolean = false)

Registers a prefix parselets into the grammar.

Parameters

type

The token type to associate the parselet with.

parselet

The prefix parselet to register.

override

If set to true, imported parselets overrides existing ones. If false, they throw.

abstract fun prefix(type: T, override: Boolean = false, block: PrefixFunction<T, E>)

Registers a prefix parselets into the grammar.

Parameters

type

The token type to associate the parselet with.

override

If set to true, imported parselets overrides existing ones. If false, they throw.

block

The code to execute when the type matches.