Table of Contents

Class SourceLocation

Namespace
Utils.Parser.Source
Assembly
Utils.Parser.Source.dll

Represents a technical point in a source text for lexer, parser, and runtime operations.

public sealed record SourceLocation : IEquatable<SourceLocation>
Inheritance
SourceLocation
Implements
Inherited Members
Extension Methods

Remarks

SourceLocation is a runtime/source-buffer coordinate contract. It is not equivalent to SourceCodeLocation, which intentionally carries no absolute source offset and requires a file path for diagnostic or tooling display.

Constructors

SourceLocation(string?, int, int, int)

Represents a technical point in a source text for lexer, parser, and runtime operations.

public SourceLocation(string? FilePath, int Line, int Column, int Position)

Parameters

FilePath string

Optional path of the source file containing the location, or null for anonymous or in-memory source text.

Line int

1-based human-readable line number associated with the same point, when display coordinates are available.

Column int

1-based human-readable column number associated with the same point, when display coordinates are available.

Position int

Zero-based absolute offset from the start of the source text.

Remarks

SourceLocation is a runtime/source-buffer coordinate contract. It is not equivalent to SourceCodeLocation, which intentionally carries no absolute source offset and requires a file path for diagnostic or tooling display.

Properties

Column

1-based human-readable column number associated with the same point, when display coordinates are available.

public int Column { get; init; }

Property Value

int

FilePath

Optional path of the source file containing the location, or null for anonymous or in-memory source text.

public string? FilePath { get; init; }

Property Value

string

Line

1-based human-readable line number associated with the same point, when display coordinates are available.

public int Line { get; init; }

Property Value

int

Position

Zero-based absolute offset from the start of the source text.

public int Position { get; init; }

Property Value

int