Table of Contents

Class TypeDefDirectiveNode

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

A DirectiveNode representing a Def<Type> module directive.

public record TypeDefDirectiveNode : DirectiveNode, IEquatable<SyntaxNode>, IEquatable<DirectiveNode>, IEquatable<TypeDefDirectiveNode>
Inheritance
TypeDefDirectiveNode
Implements
Inherited Members
Extension Methods

Constructors

TypeDefDirectiveNode(SyntaxNodeId, SourceLocation, string, ImmutableArray<DefTypePrefixMapping>)

A DirectiveNode representing a Def<Type> module directive.

public TypeDefDirectiveNode(SyntaxNodeId Identity, SourceLocation Location, string Token, ImmutableArray<DefTypePrefixMapping> Mappings)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

Location SourceLocation

The Location of the directive.

Token string

The DefType token as written (any casing) mapping to a specific VBType (per the semantics defined in MS-VBAL 5.2.2 Implicit Definition Directives).

Mappings ImmutableArray<DefTypePrefixMapping>

The prefixing scheme defined by this directive.

Properties

Location

The Location of the directive.

public SourceLocation Location { get; init; }

Property Value

SourceLocation

Mappings

The prefixing scheme defined by this directive.

public ImmutableArray<DefTypePrefixMapping> Mappings { get; init; }

Property Value

ImmutableArray<DefTypePrefixMapping>

Token

The DefType token as written (any casing) mapping to a specific VBType (per the semantics defined in MS-VBAL 5.2.2 Implicit Definition Directives).

public string Token { get; init; }

Property Value

string

TypeName

The name of the type this directive gives to the names it covers (Integer for DefInt), or null for a token that is no Def<Type>.

public string? TypeName { get; }

Property Value

string

Remarks

A name rather than a VBType: LongPtr is a different type per environment, and it is the resolver that knows which one is bound.

Methods

Covering(IEnumerable<TypeDefDirectiveNode>, string)

The directive that gives identifierName its implicit declared type, or null when none covers it and the name is a Variant (MS-VBAL §5.2.2).

public static TypeDefDirectiveNode? Covering(IEnumerable<TypeDefDirectiveNode> directives, string identifierName)

Parameters

directives IEnumerable<TypeDefDirectiveNode>

The Def<Type> directives of a module, in the order they are written.

identifierName string

The name of an entity that is declared without a type.

Returns

TypeDefDirectiveNode

Remarks

Where several directives cover a letter, which is a static error, the one written first is the one that counts: this is the single place that says so, for whoever needs the implicit type of a name.

Covers(string)

Whether the implicit declared type of identifierName is given by this directive (MS-VBAL 5.2.3.1.5).

public bool Covers(string identifierName)

Parameters

identifierName string

The name of an entity that is declared without a type.

Returns

bool

GetVBType(bool)

The type this directive gives to the names it covers, with VBUnknownType for a token that is no Def<Type>.

public VBType GetVBType(bool is64bit)

Parameters

is64bit bool

Whether DefLngPtr is a 64-bit pointer.

Returns

VBType