Class ModuleSemanticModel
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
ModuleUriThe address of the module the model describes.
DeclarationErrorsImmutableArray<VBCompileErrorInfo>The compile errors of the module's own declarations (DeclarationStaticSemanticsEvaluator), which no procedure body shows.
ProceduresImmutableArray<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
DeclarationErrors
The compile errors of the module's own declarations (DeclarationStaticSemanticsEvaluator), which no procedure body shows.
public ImmutableArray<VBCompileErrorInfo> DeclarationErrors { get; init; }
Property Value
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
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
Module
The address of the module the model describes.
public Uri Module { get; init; }
Property Value
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; }