Table of Contents

Struct StaticEvaluationContext

Namespace
RDCore.SDK.Semantics.Static.Abstract
Assembly
RDCore.SDK.dll

The compile-time context an IStaticSemantics rule evaluates an expression against: the name-resolution service, and the LexicalScope a SimpleName or MemberAccess expression resolves from (RD-VBAL §2.3.1.2).

public readonly record struct StaticEvaluationContext : IEquatable<StaticEvaluationContext>
Implements
Inherited Members

Remarks

Deliberately just these two. A rule that needs a module-level fact — Option Explicit, Option Compare, whatever MS-VBAL directive comes next — reads it off EnclosingModuleDirectives() through Scope, rather than this record growing a parameter for it: ModuleDirectives is where that kind of fact belongs, so this signature never has to change again to carry one.

Constructors

StaticEvaluationContext(ISymbolResolver, LexicalScope)

The compile-time context an IStaticSemantics rule evaluates an expression against: the name-resolution service, and the LexicalScope a SimpleName or MemberAccess expression resolves from (RD-VBAL §2.3.1.2).

public StaticEvaluationContext(ISymbolResolver Resolver, LexicalScope Scope)

Parameters

Resolver ISymbolResolver

Resolves identifier names to symbols and reads their bound values.

Scope LexicalScope

The scope the expression being evaluated is lexically found in.

Remarks

Deliberately just these two. A rule that needs a module-level fact — Option Explicit, Option Compare, whatever MS-VBAL directive comes next — reads it off EnclosingModuleDirectives() through Scope, rather than this record growing a parameter for it: ModuleDirectives is where that kind of fact belongs, so this signature never has to change again to carry one.

Properties

Resolver

Resolves identifier names to symbols and reads their bound values.

public ISymbolResolver Resolver { get; init; }

Property Value

ISymbolResolver

Scope

The scope the expression being evaluated is lexically found in.

public LexicalScope Scope { get; init; }

Property Value

LexicalScope