Token

data class Token(    val tokenType: TokenType,     val lexeme: String,     val line: Int,     val column: Int,     val value: String? = null)

The smallest meaningful unit of information in the input.

A list of tokens is generated during lexical analysis and used to build an AST during syntax analysis.

Parameters

value

Some token types, such as TokenType.NUMBER have a value associated with them

Constructors

Link copied to clipboard
fun Token(    tokenType: TokenType,     lexeme: String,     line: Int,     column: Int,     value: String? = null)

Properties

Link copied to clipboard
val column: Int

the column number in the input on which this token was found

Link copied to clipboard
val lexeme: String

the exact string from the source from which this token was generated

Link copied to clipboard
val line: Int

the line number in the input on which this token was found

Link copied to clipboard
val tokenType: TokenType

the type of this token

Link copied to clipboard
val value: String? = null