pub(crate) struct EvaluationContext<'s, R: RcUpdater> {
pub(crate) here: HereValue,
pub(crate) explicit_symtab: &'s ExplicitSymbolTable,
pub(crate) implicit_symtab: &'s mut ImplicitSymbolTable,
pub(crate) index_register_assigner: &'s mut IndexRegisterAssigner,
pub(crate) memory_map: &'s MemoryMap,
pub(crate) rc_updater: &'s mut R,
pub(crate) lookup_operation: LookupOperation,
}
Expand description
Context data used by symbol lookup and word value evaluation.
The word-value evaluation process does not modify the memory map or the symbol table (so those structs are shared references). But it does modify the “implicit symbol table” which records default-assignments for symbols that don’t have an explicit definition. It can also update RC-words in-place.
Fields§
§here: HereValue
Defines how to evaluate #
.
explicit_symtab: &'s ExplicitSymbolTable
Definitions of tags, origins and equalities.
implicit_symtab: &'s mut ImplicitSymbolTable
Implicit symbol definitions and information about how these symbols have been used.
index_register_assigner: &'s mut IndexRegisterAssigner
Assigns default values to symbols used in an index context.
memory_map: &'s MemoryMap
Memory locations of the program’s blocks.
rc_updater: &'s mut R
Performs in-place updates of the values of RC-words.
lookup_operation: LookupOperation
The current lookup operation; this is used to detect loops.
Implementations§
Source§impl<R: RcUpdater> EvaluationContext<'_, R>
impl<R: RcUpdater> EvaluationContext<'_, R>
Sourcepub(crate) fn fetch_or_assign_default(
&mut self,
name: &SymbolName,
) -> Result<Unsigned36Bit, EvaluationFailure>
pub(crate) fn fetch_or_assign_default( &mut self, name: &SymbolName, ) -> Result<Unsigned36Bit, EvaluationFailure>
For a symbol lacking an explicit definition, look up the default value we assigned to it, or if we didn’t assign a value yet, assign a default value now and record it.