Token

open class Token<T : TokenType>(val type: T, val value: String?, val start: Int, val end: Int)(source)

The input of the com.shakelang.shake.lexer.Lexer gets converted into Tokens. These get parsed by the parser

Since

0.1.0

Parameters

type

the Token.type of the Token

value

the Token.value of the Token

start

the Token.start of the Token

end

the Token.end of the Token

Constructors

Link copied to clipboard
constructor(type: T, start: Int, end: Int)

Constructor for Token

constructor(type: T, value: String?, start: Int, end: Int)

Properties

Link copied to clipboard
open val end: Int

The ending Position of the Token

Link copied to clipboard
open val start: Int

The starting Position of the Token

Link copied to clipboard
open val type: T

The type of the Token

Link copied to clipboard
open val value: String?

The value of the Token (This is for identifiers, strings or numbers. If not necessary this is null)

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Check if the Token is equal to another Token

Link copied to clipboard
open override fun hashCode(): Int

Get the hash code of the Token

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

String representation of the Token