Interface IRuntimeSemantics<TContext, TFlags>
Represents any runtime semantics rules.
public interface IRuntimeSemantics<TContext, TFlags> where TContext : SemanticContext<TFlags>, new() where TFlags : struct, Enum
Type Parameters
TContextThe type of
SemanticContextfor this semantic operation.TFlagsThe type of semantic flags of the semantic context.
Methods
Analyze(IRuntimeSession, ConversionOperationSemanticContext, ISemanticFlagsAccumulator<TFlags>, SyntaxNode, params VBTypedValue[])
Analyzes the specified SyntaxNode in the specified execution context, using the specified inputs.
ISemanticFlagsAccumulator<TFlags> Analyze(IRuntimeSession session, ConversionOperationSemanticContext conversionContext, ISemanticFlagsAccumulator<TFlags> builder, SyntaxNode node, params VBTypedValue[] inputs)
Parameters
sessionIRuntimeSessionThe current execution session — its
Symbols.Resolveris the read face over the current execution context.conversionContextConversionOperationSemanticContextbuilderISemanticFlagsAccumulator<TFlags>A semantic flags builder specifically for the operation defined by the
nodeunder scrutiny.nodeSyntaxNodeThe bound node to analyze.
inputsVBTypedValue[]The inputs of the bound node.
Returns
- ISemanticFlagsAccumulator<TFlags>
Returns its
builderparameter.
Evaluate(IRuntimeSession, TContext, SyntaxNode, params VBTypedValue[])
Evaluates the specified SyntaxNode in the specified execution context, using the specified inputs.
RuntimeSemanticsEvaluationResult Evaluate(IRuntimeSession session, TContext context, SyntaxNode node, params VBTypedValue[] inputs)
Parameters
sessionIRuntimeSessionThe current execution session — its
Symbols.Resolveris the read face over the current execution context;Objects/CallStackare here for the runtime semantics that need to instantiate an object or push/pop an activation.contextTContextThe semantic context of this operation, built by
Analyze.nodeSyntaxNodeThe bound node to be evaluated.
inputsVBTypedValue[]The inputs of the bound node.
Returns
Remarks
⚠️ Does not throw any run-time errors; instead it packages the error metadata in the result.