Interface ISymbolStorage
The storage a running session binds its symbols to: the binding currently associated with a symbol, or held at an address of the session's memory map.
public interface ISymbolStorage
Remarks
Storage only: what a name binds to is ISymbolResolver's, and a resolver of a running session is both (IRuntimeSymbolResolver).
Methods
GetValue(Symbol)
Gets the IBindingHandle currently associated with the specified Symbol.
IBindingHandle GetValue(Symbol symbol)
Parameters
Returns
TryAllocate(Symbol, VBTypedValue, out MemoryAddress)
Reserves storage sized for value and binds it to symbol, chiefly for
a Static local's first-call allocation (MS-VBAL §5.4.3.1: module extent, so the
storage outlives the local's frame). It does not affect name resolution: a symbol's name resolves through
its declaring symbol (a procedure's Locals and Parameters). Calling it for a symbol that is
already allocated frees the previous allocation and makes a new one.
bool TryAllocate(Symbol symbol, VBTypedValue value, out MemoryAddress address)
Parameters
symbolSymbolThe symbol to reserve storage for.
valueVBTypedValueThe value to seed the new storage with.
addressMemoryAddressThe reserved address, on success.
Returns
- bool
falseif the underlying memory space is exhausted.
TryGetAddress(Symbol, out MemoryAddress)
Gets the MemoryAddress currently reserved for symbol, if any:
what a ByRef argument binds to (MS-VBAL §5.3.1.11: "a reference parameter
binding... referring to the variable referenced by the argument's expression").
bool TryGetAddress(Symbol symbol, out MemoryAddress address)
Parameters
symbolSymbolThe Symbol whose address to look up.
addressMemoryAddressThe reserved address, if
symbolis currently allocated.
Returns
TryRead(MemoryAddress, out IBindingHandle?)
Gets the IBindingHandle at the specified address in the runtime memory map.
bool TryRead(MemoryAddress address, out IBindingHandle? value)
Parameters
addressMemoryAddressThe memory address to read.
valueIBindingHandleThe retrieved binding, if successful.