The ezr² Project 0.1.1
The codebase for the ezr² programming language.
Loading...
Searching...
No Matches
EzrSquared.Token Class Reference

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

Public Member Functions

 Token (TokenType type, TokenTypeGroup typeGroup, string value, Position startPosition, Position? endPosition=null)
 Creates a new Token object.
 
override string ToString ()
 Converts the Token into a string, for debugging purposes.
 

Public Attributes

readonly TokenType Type
 The identifying TokenType of the Token.
 
readonly TokenTypeGroup TypeGroup
 The TokenTypeGroup of the Token.
 
readonly string Value
 The value of the Token; may be empty.
 
readonly Position StartPosition
 The starting Position of the Token in the script.
 
readonly Position EndPosition
 The ending Position of the Token in the script.
 

Static Public Attributes

static readonly Token Empty = new(TokenType.Invalid, TokenTypeGroup.Special, string.Empty, Position.None)
 An empty token value.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Token()

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

Creates a new Token object.

Parameters
typeThe identifying TokenType of the Token.
typeGroupThe TokenTypeGroup of the Token.
valueThe value of the Token; may be empty.
startPositionThe starting Position of the Token in the script.
endPositionThe ending Position of the Token in the script. If not given, copies startPosition and advances it.

Member Function Documentation

◆ ToString()

override string EzrSquared.Token.ToString ( )

Converts the Token into a string, for debugging purposes.

Returns
The string representation of the Token.

The documentation for this class was generated from the following file: