AbstractLexeme

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.

Parameters

T

The type of token produced by this Lexeme

Inheritors

Constructors

Link copied to clipboard
constructor(name: String?)

Properties

Link copied to clipboard
open val defaultFactory: (value: CharSequence) -> T

A default Token factory that creates new instances of T for matches of this Lexeme, given the CharSequence which captures the Token (equal to Token.value).

Link copied to clipboard
open override val name: String?

An optional name for this Lexeme

Functions

Link copied to clipboard
abstract fun match(): LexemeMatch<T>?
Link copied to clipboard
open override fun toString(): String