Table of Contents

Class Token

Namespace
flx.SILQ.Models
Assembly
flx.SILQ.dll

Represents a token identified by the SILQ tokenizer, including its type, lexeme, literal value, and line number.

public record Token : IEquatable<Token>
Inheritance
Token
Implements
Inherited Members

Constructors

Token(TokenType, string, object, int, int)

Represents a token identified by the SILQ tokenizer, including its type, lexeme, literal value, and line number.

public Token(TokenType TokenType, string Lexeme, object Literal = null, int Line = -1, int Column = -1)

Parameters

TokenType TokenType

The type of the token.

Lexeme string

The string representation of the token as found in the source code.

Literal object

The literal value of the token, if applicable.

Line int

The line number where the token was found.

Column int

Properties

Column

public int Column { get; init; }

Property Value

int

Lexeme

The string representation of the token as found in the source code.

public string Lexeme { get; init; }

Property Value

string

Line

The line number where the token was found.

public int Line { get; init; }

Property Value

int

Literal

The literal value of the token, if applicable.

public object Literal { get; init; }

Property Value

object

TokenType

The type of the token.

public TokenType TokenType { get; init; }

Property Value

TokenType

Methods

ToString()

Returns a formatted string representation of the token, including its type, lexeme, and literal value.

public override string ToString()

Returns

string

A string in the format: TokenType Lexeme Literal