Table of Contents

Struct Pl0Token

Namespace
Pl0.Core
Assembly
Pl0.Core.dll

Represents a single token from the PL/0 lexer.

public readonly record struct Pl0Token : IEquatable<Pl0Token>
Implements
Inherited Members

Constructors

Pl0Token(TokenKind, string, TextPosition, int?)

Represents a single token from the PL/0 lexer.

public Pl0Token(TokenKind Kind, string Lexeme, TextPosition Position, int? NumberValue = null)

Parameters

Kind TokenKind

The token kind.

Lexeme string

The source text for the token.

Position TextPosition

The start position of the token.

NumberValue int?

Parsed numeric value for number tokens.

Properties

Kind

The token kind.

public TokenKind Kind { get; init; }

Property Value

TokenKind

Lexeme

The source text for the token.

public string Lexeme { get; init; }

Property Value

string

NumberValue

Parsed numeric value for number tokens.

public int? NumberValue { get; init; }

Property Value

int?

Position

The start position of the token.

public TextPosition Position { get; init; }

Property Value

TextPosition