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
-
objectToken
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
TokenTypetypeGroup
TokenTypeGroupThe TokenTypeGroup of the Token.
value
stringThe value of the Token; may be empty.
startPosition
PositionendPosition
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
EndPosition
public readonly Position EndPosition
Field Value
StartPosition
public readonly Position StartPosition
Field Value
Type
public readonly TokenType Type
Field Value
TypeGroup
The TokenTypeGroup of the Token.
public readonly TokenTypeGroup TypeGroup
Field Value
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.