pub struct Engine<'a, M>where
    M: MemoryProvider,{ /* private fields */ }Expand description
The Engine is an interpreter for ΑΩ-operations and is used to execute basic blocks. After execution you can inspect the concrete values of registers / memory / ΑΩ-variables.
Implementations§
Source§impl<'a, M> Engine<'a, M>where
    M: MemoryProvider,
 
impl<'a, M> Engine<'a, M>where
    M: MemoryProvider,
Sourcepub fn attach(bb: &'a BasicBlock, memory: Option<&'a mut M>) -> Self
 
pub fn attach(bb: &'a BasicBlock, memory: Option<&'a mut M>) -> Self
Attach this engine to a BasicBlock that you want to execute. Optionally you can pass a MemoryProvider that handles the memory loads and stores of the given basic block.
Sourcepub fn event(&self) -> Option<EventId>
 
pub fn event(&self) -> Option<EventId>
After execution, this is set if the basic block threw an event
Sourcepub fn event_channel(&self) -> &[Var]
 
pub fn event_channel(&self) -> &[Var]
Access the event channel that the basic block wrote to
Sourcepub fn set_register(&mut self, reg: &Register, value: Value)
 
pub fn set_register(&mut self, reg: &Register, value: Value)
Set the contents of a given register to a given value
Sourcepub fn get_register(&self, reg: &Register) -> &Value
 
pub fn get_register(&self, reg: &Register) -> &Value
Get the contents of a given register
Sourcepub fn memory_mut(&mut self) -> Option<&mut M>
 
pub fn memory_mut(&mut self) -> Option<&mut M>
Get the memory subsystem
Sourcepub fn var(&self, var: Var) -> &Value
 
pub fn var(&self, var: Var) -> &Value
Get the concrete value of a given ΑΩ-variable after execution
Sourcepub fn jump(&self) -> Option<&JumpTarget>
 
pub fn jump(&self) -> Option<&JumpTarget>
If the basic block ended with some kind of jump, this value is set
Sourcepub fn execute(&mut self) -> Result<(), EngineError>
 
pub fn execute(&mut self) -> Result<(), EngineError>
Execute all the ΑΩ-operations inside the attached basic block