Table of Contents

Class ModuleSemanticModel

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

What the semantic analysis pass found out about one module: what is wrong with what it declares, and the model of each procedure it declares.

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

Remarks

A module is valid when its declarations are, and every procedure is: a module whose procedures are all valid may still declare a name twice.

Constructors

ModuleSemanticModel(Uri, ImmutableArray<VBCompileErrorInfo>, ImmutableArray<ProcedureSemanticModel>)

What the semantic analysis pass found out about one module: what is wrong with what it declares, and the model of each procedure it declares.

public ModuleSemanticModel(Uri Module, ImmutableArray<VBCompileErrorInfo> DeclarationErrors, ImmutableArray<ProcedureSemanticModel> Procedures)

Parameters

Module Uri

The address of the module the model describes.

DeclarationErrors ImmutableArray<VBCompileErrorInfo>

The compile errors of the module's own declarations (DeclarationStaticSemanticsEvaluator), which no procedure body shows.

Procedures ImmutableArray<ProcedureSemanticModel>

The model of each procedure the module declares, in declaration order.

Remarks

A module is valid when its declarations are, and every procedure is: a module whose procedures are all valid may still declare a name twice.

Properties

CompileErrors

Every compile error of the module: those of its declarations, then those of each procedure.

public ImmutableArray<VBCompileErrorInfo> CompileErrors { get; }

Property Value

ImmutableArray<VBCompileErrorInfo>

DeclarationErrors

The compile errors of the module's own declarations (DeclarationStaticSemanticsEvaluator), which no procedure body shows.

public ImmutableArray<VBCompileErrorInfo> DeclarationErrors { get; init; }

Property Value

ImmutableArray<VBCompileErrorInfo>

Declarations

How each declaration of the module is used by the module's own code (DeclarationUsage): its variables, constants, parameters, procedures, properties and events, and the variables that were never declared. Empty when the pass had no workspace to resolve names in.

public ImmutableArray<DeclarationFact> Declarations { get; init; }

Property Value

ImmutableArray<DeclarationFact>

IsValid

Whether the static pass found nothing wrong with the module's declarations, nor with any procedure of the module.

public bool IsValid { get; }

Property Value

bool

Module

The address of the module the model describes.

public Uri Module { get; init; }

Property Value

Uri

OptionExplicit

Whether the module states Option Explicit (MS-VBAL §5.2.1.3): without it, a name that refers to nothing declared is not an error, but a variable that comes into being (IsImplicit).

public bool? OptionExplicit { get; init; }

Property Value

bool?

Remarks

The fact is not issued - it is null - for a module of a language that has no such directive (HasOptionExplicit): there is nothing it could state, and a false would say that it does not when it cannot.

Procedures

The model of each procedure the module declares, in declaration order.

public ImmutableArray<ProcedureSemanticModel> Procedures { get; init; }

Property Value

ImmutableArray<ProcedureSemanticModel>