Table of Contents

Interface ISessionSymbols

Namespace
RDCore.SDK.Runtime.Abstract.Execution
Assembly
RDCore.SDK.dll

The symbol table of an execution session: defines and resolves symbols by scope.

public interface ISessionSymbols

Properties

Resolver

The read face over this table — resolves a name visible from a scope by walking the scope tree the currently-defined symbols form (tracks later TryDefine(Symbol, ScopeKind) calls), and reads the live run-time binding a defined symbol was allocated, if any.

ISymbolResolver Resolver { get; }

Property Value

ISymbolResolver

Methods

CreateFrame(SyntaxNodeId, StaticSymbol)

Creates a new, empty ICallStackFrame for an activation of procedure, wired to this session's value storage. The caller Push(Symbol, VBTypedValue)es each parameter and Dim local it declares, then pushes the frame onto CallStack to make them resolvable.

ICallStackFrame CreateFrame(SyntaxNodeId nodeId, StaticSymbol procedure)

Parameters

nodeId SyntaxNodeId

The Identity of the call-site node this activation is for.

procedure StaticSymbol

The StaticSymbol identifying the procedure being activated.

Returns

ICallStackFrame

CreateInstance(VBRuntimeObjectId, VBClassModuleSymbol)

Creates a new IObjectInstance for a freshly-created object of classModule, allocating storage for every instance field the class declares (RD-VBAL §2.3.1.2's instance heap tier) and registering it for later lookup by objectId. This only allocates the instance's field storage — the object's reference-counted lifetime is tracked separately, by Objects.

IObjectInstance CreateInstance(VBRuntimeObjectId objectId, VBClassModuleSymbol classModule)

Parameters

objectId VBRuntimeObjectId

The object's identity, minted by CreateObject().

classModule VBClassModuleSymbol

The class module being instantiated.

Returns

IObjectInstance

DestroyInstance(VBRuntimeObjectId)

Frees every field objectId's instance allocated and forgets it. Called once the object's reference count reaches zero and TryRemoveObject(VBRuntimeObjectId) succeeds.

bool DestroyInstance(VBRuntimeObjectId objectId)

Parameters

objectId VBRuntimeObjectId

Returns

bool

false if no instance is registered for objectId.

TryDefine(Symbol, ScopeKind)

Defines symbol in the given scope. A program-lifetime declaration — a standard module's or the global scope's field or variable — is allocated storage immediately, reachable afterwards through Resolver's GetValue.

bool TryDefine(Symbol symbol, ScopeKind scope)

Parameters

symbol Symbol
scope ScopeKind

Returns

bool

true if the symbol was added; false if it was already defined in that scope.

TryGetInstance(VBRuntimeObjectId, out IObjectInstance?)

Gets the IObjectInstance registered for objectId, if any — e.g. to resolve a member-access expression's target once objectId is known from evaluating the object reference it was accessed through.

bool TryGetInstance(VBRuntimeObjectId objectId, out IObjectInstance? instance)

Parameters

objectId VBRuntimeObjectId
instance IObjectInstance

Returns

bool

TryResolve(string, Symbol, out Symbol?)

Resolves name visible from scope.

bool TryResolve(string name, Symbol scope, out Symbol? symbol)

Parameters

name string
scope Symbol
symbol Symbol

Returns

bool