RegexLexer

abstract class RegexLexer(val source: CharSequence, patterns: List<TokenRegexPattern>) : AbstractLexer

A Lexer that identifies tokens by matching Regex patterns.

Parameters

source

the content to be tokenized

patterns

the patterns to search for, in descending order of priority

Inheritors

Constructors

Link copied to clipboard
constructor(source: CharSequence, patterns: List<TokenRegexPattern>)

Properties

Link copied to clipboard
open override var currentIndex: Int

Index of the latest scanned character within source.

Link copied to clipboard
open override val source: CharSequence

Functions

Link copied to clipboard
abstract fun createFillToken(position: IntRange): Token?
Link copied to clipboard
open override fun tokenize(): List<Token>

Disassembles some raw string into smaller tokens.