CharPredicate

open class CharPredicate(val predicate: (Char) -> Boolean, name: String? = null) : AbstractLexeme<Token.Generic>

A Lexeme that matches a single character satisfying a predicate. Matches produced by this Lexeme always have a length of 1.

Constructors

Link copied to clipboard
constructor(predicate: (Char) -> Boolean, name: String? = null)

Properties

Link copied to clipboard
open override val defaultFactory: (CharSequence) -> Token.Generic

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

Link copied to clipboard

A function that tests whether a character should be matched

Functions

Link copied to clipboard
override fun match(): LexemeMatch<Token.Generic>?
Link copied to clipboard
open override fun toString(): String