EvaluationContext

Struct EvaluationContext 

Source
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>

Source

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.

Source§

impl<R: RcUpdater> EvaluationContext<'_, R>

Source

pub(crate) fn for_target_address<F, T>( &mut self, new_here: HereValue, closure: F, ) -> T
where F: FnMut(&mut EvaluationContext<'_, R>) -> T,

Trait Implementations§

Source§

impl<'s, R: Debug + RcUpdater> Debug for EvaluationContext<'s, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s, R> Freeze for EvaluationContext<'s, R>

§

impl<'s, R> RefUnwindSafe for EvaluationContext<'s, R>
where R: RefUnwindSafe,

§

impl<'s, R> Send for EvaluationContext<'s, R>
where R: Send,

§

impl<'s, R> Sync for EvaluationContext<'s, R>
where R: Sync,

§

impl<'s, R> Unpin for EvaluationContext<'s, R>

§

impl<'s, R> !UnwindSafe for EvaluationContext<'s, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

§

type Proj<U: 'src> = U

§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more