Table of Contents

Struct SyntaxNodeId

Namespace
RDCore.SDK.Model.AST.Abstract
Assembly
RDCore.SDK.dll

Represents an identifier that is unique for every node of an AST.

public readonly record struct SyntaxNodeId : IEquatable<SyntaxNodeId>, IComparable<SyntaxNodeId>
Implements
Inherited Members

Remarks

Encodes the node's position within the AST.

Constructors

SyntaxNodeId(string, ImmutableArray<int>)

Represents an identifier that is unique for every node of an AST.

public SyntaxNodeId(string DocumentUri, ImmutableArray<int> Lineage)

Parameters

DocumentUri string

The URI of the document this syntax tree belongs to.

Lineage ImmutableArray<int>

An array of successive child index values in the syntax tree.

Remarks

Encodes the node's position within the AST.

Properties

DocumentUri

The URI of the document this syntax tree belongs to.

public string DocumentUri { get; init; }

Property Value

string

Lineage

An array of successive child index values in the syntax tree.

public ImmutableArray<int> Lineage { get; init; }

Property Value

ImmutableArray<int>

Methods

Add(int)

public SyntaxNodeId Add(int position)

Parameters

position int

Returns

SyntaxNodeId

CompareTo(SyntaxNodeId)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(SyntaxNodeId other)

Parameters

other SyntaxNodeId

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(SyntaxNodeId)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(SyntaxNodeId other)

Parameters

other SyntaxNodeId

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.