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
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
LocationSourceLocationThe
Locationof the directive.TokenstringThe
DefTypetoken as written (any casing) mapping to a specificVBType(per the semantics defined in MS-VBAL 5.2.2 Implicit Definition Directives).MappingsImmutableArray<DefTypePrefixMapping>The prefixing scheme defined by this directive.
Properties
Location
The Location of the directive.
public SourceLocation Location { get; init; }
Property Value
Mappings
The prefixing scheme defined by this directive.
public ImmutableArray<DefTypePrefixMapping> Mappings { get; init; }
Property Value
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
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
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
directivesIEnumerable<TypeDefDirectiveNode>The
Def<Type>directives of a module, in the order they are written.identifierNamestringThe name of an entity that is declared without a type.
Returns
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
identifierNamestringThe name of an entity that is declared without a type.
Returns
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
is64bitboolWhether
DefLngPtris a 64-bit pointer.