Table of Contents

Interface IAnalysisObserver

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

Receives the facts that the runtime semantics state about the code they evaluate: the conversions it asks for, the operations it performs, what its statements do, and the run-time errors it raises.

public interface IAnalysisObserver

Remarks

An observer is attached to a runtime pipeline when the pipeline is composed, and sees every conversion, operation and statement that pipeline evaluates, at the point where the evaluation would call the semantics. That is what makes what is observed the language's own answer, rather than a second walk of the code that must be kept in step with the first.

A pipeline composed without an observer states no facts and behaves exactly as before: observation costs a null check. An observer must not throw, and must not call back into the pipeline that is calling it.

A pipeline and its observer belong to one analysis: an observer is not required to be thread-safe.

Methods

OnConversion(ConversionFact)

A value was let-coerced (MS-VBAL 5.5.1.2).

void OnConversion(ConversionFact fact)

Parameters

fact ConversionFact

What the conversion is, and what is known of it.

OnError(VBErrorInfo)

An instruction raised a run-time error that is the code's: it raises it whenever it runs.

void OnError(VBErrorInfo error)

Parameters

error VBErrorInfo

The error, where the instruction raises it.

Remarks

👉 The error an evaluation raises for a value it only assumed is never one: the runtime semantics do not raise it. Nor is an internal error, which is a defect of the platform and not something the code does.

OnOperation(OperatorFact)

An operator was evaluated (MS-VBAL 5.6.9), or a member was accessed (MS-VBAL 5.6.12-14).

void OnOperation(OperatorFact fact)

Parameters

fact OperatorFact

What the operation is, and what is known of it.

OnStatement(StatementFact)

A statement whose runtime semantics establish facts of their own was evaluated (MS-VBAL 5.4).

void OnStatement(StatementFact fact)

Parameters

fact StatementFact

What the statement does, and what is known of it.