Token

data class Token(kind: TokenKindEnum, start: Int, end: Int, line: Int, column: Int, value: String?, prev: Token?, next: Token?)

Represents a range of characters represented by a lexical token within a Source.

Constructors

Token
Link copied to clipboard
fun Token(kind: TokenKindEnum, start: Int = 0, end: Int = 0, line: Int = 0, column: Int = 0, value: String? = null, prev: Token? = null, next: Token? = null)

Functions

toString
Link copied to clipboard
open override fun toString(): String

Properties

column
Link copied to clipboard
val column: Int = 0
The 1-indexed column number at which this Token begins.
end
Link copied to clipboard
val end: Int = 0
The character offset at which this Node ends.
kind
Link copied to clipboard
val kind: TokenKindEnum
The kind of Token.
line
Link copied to clipboard
val line: Int = 0
The 1-indexed line number on which this Token appears.
next
Link copied to clipboard
var next: Token? = null
prev
Link copied to clipboard
var prev: Token? = null
Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens.
start
Link copied to clipboard
val start: Int = 0
The character offset at which this Node begins.
value
Link copied to clipboard
val value: String? = null
For non-punctuation tokens, represents the interpreted value of the token.