Table of Contents

Class DeclarationFact

Namespace
RDCore.SDK.Semantics
Assembly
RDCore.SDK.dll

What the static pass found out about a declaration.

public sealed record DeclarationFact : IEquatable<DeclarationFact>
Inheritance
DeclarationFact
Implements
Inherited Members

Remarks

A fact is stated only when it is true. What refers to a declaration that is accessible from outside the module, or that is called by convention or through the object it is a member of rather than by an expression that names it (an event handler, a member that implements an interface), is not all in the code the pass analyzed, and its references are not counted: References is then null, which says the references are not known and not that there are none.

Constructors

DeclarationFact(SemanticId, string, DeclarationKind, AccessModifier, bool, SourceLocation, DeclarationReferences?)

What the static pass found out about a declaration.

public DeclarationFact(SemanticId Symbol, string Name, DeclarationKind Kind, AccessModifier Access, bool IsImplicit, SourceLocation Location, DeclarationReferences? References)

Parameters

Symbol SemanticId

The identity of the declared symbol.

Name string

The name it is declared with.

Kind DeclarationKind

What it declares.

Access AccessModifier

Who can refer to it besides the module's own code.

IsImplicit bool

Whether it was never declared: it came into being because something referred to it, which is legal and worth reporting.

Location SourceLocation

Where it is declared.

References DeclarationReferences?

Every reference to it, when every reference to it is in the code that was analyzed and was analyzed completely; null otherwise.

Remarks

A fact is stated only when it is true. What refers to a declaration that is accessible from outside the module, or that is called by convention or through the object it is a member of rather than by an expression that names it (an event handler, a member that implements an interface), is not all in the code the pass analyzed, and its references are not counted: References is then null, which says the references are not known and not that there are none.

Properties

Access

Who can refer to it besides the module's own code.

public AccessModifier Access { get; init; }

Property Value

AccessModifier

DeclaredBy

How a local variable came to be declared: a Dim or a Static statement, a ReDim statement whose name matched nothing (MS-VBAL §5.4.3.3), or a reference to a name that matched nothing (§5.6.10). null for any other declaration.

public LocalDeclarationKind? DeclaredBy { get; init; }

Property Value

LocalDeclarationKind?

Hides

What a local or a parameter hides: what its name means in the rest of the module, which in its procedure it does not (MS-VBAL §5.6.10, a name is first matched in the procedure). null when the name means nothing else there, and for any other declaration.

public HiddenDeclaration? Hides { get; init; }

Property Value

HiddenDeclaration

IsImplicit

Whether it was never declared: it came into being because something referred to it, which is legal and worth reporting.

public bool IsImplicit { get; init; }

Property Value

bool

Kind

What it declares.

public DeclarationKind Kind { get; init; }

Property Value

DeclarationKind

Location

Where it is declared.

public SourceLocation Location { get; init; }

Property Value

SourceLocation

Name

The name it is declared with.

public string Name { get; init; }

Property Value

string

References

Every reference to it, when every reference to it is in the code that was analyzed and was analyzed completely; null otherwise.

public DeclarationReferences? References { get; init; }

Property Value

DeclarationReferences?

Role

What the declaration is there for, when it implements a member of an interface or handles an event. A role is stated only for a member of a class module whose interfaces and event sources the pass resolved; None is not a statement that it has none otherwise.

public DeclarationRole Role { get; init; }

Property Value

DeclarationRole

Symbol

The identity of the declared symbol.

public SemanticId Symbol { get; init; }

Property Value

SemanticId