Table of Contents

Class EmbeddedCodeSource

Namespace
Utils.Parser.EmbeddedCode
Assembly
Utils.Parser.dll

Describes a raw ANTLR embedded-code source block without assigning execution behavior to it.

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

Constructors

EmbeddedCodeSource(string, EmbeddedCodeKind, string?, int?, int?, SourceCodeLocation?)

Initializes a new instance of the EmbeddedCodeSource record.

public EmbeddedCodeSource(string sourceText, EmbeddedCodeKind kind, string? ruleName = null, int? alternativeIndex = null, int? elementIndex = null, SourceCodeLocation? location = null)

Parameters

sourceText string

Raw embedded-code source text without surrounding ANTLR delimiters.

kind EmbeddedCodeKind

Kind of ANTLR construct that owns the source text.

ruleName string

Optional rule name that owns the source text.

alternativeIndex int?

Optional zero-based alternative index that owns the source text.

elementIndex int?

Optional zero-based element index that owns the source text.

location SourceCodeLocation

Optional human-readable source location for diagnostics or tooling.

Properties

AlternativeIndex

Gets the optional zero-based alternative index that owns the source text.

public int? AlternativeIndex { get; }

Property Value

int?

ElementIndex

Gets the optional zero-based element index that owns the source text.

public int? ElementIndex { get; }

Property Value

int?

Kind

Gets the kind of ANTLR construct that owns the source text.

public EmbeddedCodeKind Kind { get; }

Property Value

EmbeddedCodeKind

Location

Gets the optional human-readable source location for diagnostics or tooling.

public SourceCodeLocation? Location { get; }

Property Value

SourceCodeLocation

RawCode

Gets the typed raw embedded-code source text without surrounding ANTLR delimiters.

public RawEmbeddedCode RawCode { get; }

Property Value

RawEmbeddedCode

RuleName

Gets the optional rule name that owns the source text.

public string? RuleName { get; }

Property Value

string

SourceText

Gets the raw embedded-code source text without surrounding ANTLR delimiters.

public string SourceText { get; }

Property Value

string