Table of Contents

Class ProcedureSemanticModel

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

What the semantic analysis pass found out about one procedure: the facts a pass established about its code, which analyzers read to decide what becomes a diagnostic.

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

Remarks

A model is immutable, and built by the pass that analyzed the procedure; it is never written back onto the syntax tree or onto a value. Today it holds the compile errors of the static pass (RD-VBAL §5.0.1); the facts of the passes that follow (binding, types, flow) are added to it as they come online, so that whoever consumes a model keeps consuming the same type.

Constructors

ProcedureSemanticModel(SemanticId, ImmutableArray<VBCompileErrorInfo>)

What the semantic analysis pass found out about one procedure: the facts a pass established about its code, which analyzers read to decide what becomes a diagnostic.

public ProcedureSemanticModel(SemanticId Procedure, ImmutableArray<VBCompileErrorInfo> CompileErrors)

Parameters

Procedure SemanticId

The identity of the procedure the model describes.

CompileErrors ImmutableArray<VBCompileErrorInfo>

Every compile error the static pass found in the procedure's body, in traversal order, followed by the errors that can only be told once the whole body has been walked (a jump to a label that no line defines).

Remarks

A model is immutable, and built by the pass that analyzed the procedure; it is never written back onto the syntax tree or onto a value. Today it holds the compile errors of the static pass (RD-VBAL §5.0.1); the facts of the passes that follow (binding, types, flow) are added to it as they come online, so that whoever consumes a model keeps consuming the same type.

Properties

CompileErrors

Every compile error the static pass found in the procedure's body, in traversal order, followed by the errors that can only be told once the whole body has been walked (a jump to a label that no line defines).

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

Property Value

ImmutableArray<VBCompileErrorInfo>

Expressions

What the static pass found out about each expression of the procedure's body, by the expression: its declared type, what it names and is bound to, and how it is written. Empty when the pass had no workspace to resolve names in.

public ImmutableDictionary<SyntaxNodeId, ExpressionFact> Expressions { get; init; }

Property Value

ImmutableDictionary<SyntaxNodeId, ExpressionFact>

IsFullyAnalyzed

Whether Expressions has a fact for every place the body refers to a name, and nothing was found wrong with it: the references the facts say there are in the body are all the references there are. It is false whenever that could not be established - a procedure with an error, an expression the pass does not look into, or no workspace to resolve names in - and what is counted from the facts is not known then, which is not to say that it is none.

public bool IsFullyAnalyzed { get; init; }

Property Value

bool

IsValid

Whether the static pass found nothing wrong with the procedure.

public bool IsValid { get; }

Property Value

bool

Procedure

The identity of the procedure the model describes.

public SemanticId Procedure { get; init; }

Property Value

SemanticId