Table of Contents

Class Token

Namespace
EzrSquared
Assembly
ezrSquared-lib.dll

The smallest component in the script identified by the TokenType, grouped together into Node objects to from source code constructs.

public record Token
Inheritance
object
Token

Constructors

Token(TokenType, TokenTypeGroup, string, Position, Position?)

Creates a new Token object.

public Token(TokenType type, TokenTypeGroup typeGroup, string value, Position startPosition, Position? endPosition = null)

Parameters

type TokenType

The identifying TokenType of the Token.

typeGroup TokenTypeGroup

The TokenTypeGroup of the Token.

value string

The value of the Token; may be empty.

startPosition Position

The starting Position of the Token in the script.

endPosition Position?

The ending Position of the Token in the script. If not given, copies startPosition and advances it.

Fields

Empty

An empty token value.

public static readonly Token Empty

Field Value

Token

EndPosition

The ending Position of the Token in the script.

public readonly Position EndPosition

Field Value

Position

StartPosition

The starting Position of the Token in the script.

public readonly Position StartPosition

Field Value

Position

Type

The identifying TokenType of the Token.

public readonly TokenType Type

Field Value

TokenType

TypeGroup

The TokenTypeGroup of the Token.

public readonly TokenTypeGroup TypeGroup

Field Value

TokenTypeGroup

Value

The value of the Token; may be empty.

public readonly string Value

Field Value

string

Methods

ToString()

Converts the Token into a string, for debugging purposes.

public override string ToString()

Returns

string

The string representation of the Token.