pub struct Interpreter { /* private fields */ }
Expand description
The main interpreter, execute instructions, read from input, write to output
Implementations§
Source§impl Interpreter
impl Interpreter
Sourcepub fn new(
arch_length: usize,
arch_width: usize,
) -> Result<Interpreter, &'static str>
pub fn new( arch_length: usize, arch_width: usize, ) -> Result<Interpreter, &'static str>
Construct a new Interpreter with an existing Program.
arch_length
need to be in the range [1..2^32)
and arch_width
in [6..32)
.
Sourcepub fn copy_program(&mut self, program: &Program)
pub fn copy_program(&mut self, program: &Program)
Copy your program in the memory of the machine, a reset is done after program was loaded.
Sourcepub fn arch_length(&self) -> usize
pub fn arch_length(&self) -> usize
return the interpreter arch length
Sourcepub fn arch_width(&self) -> usize
pub fn arch_width(&self) -> usize
return the interpreter arch width
Sourcepub fn step<R: ?Sized + Read, W: ?Sized + Write>(
&mut self,
input: &mut R,
output: &mut W,
) -> Statement
pub fn step<R: ?Sized + Read, W: ?Sized + Write>( &mut self, input: &mut R, output: &mut W, ) -> Statement
Sourcepub fn debug_infos(&self) -> DebugInfos
pub fn debug_infos(&self) -> DebugInfos
Get a debug struct that can help for debugging programs
Auto Trait Implementations§
impl Freeze for Interpreter
impl RefUnwindSafe for Interpreter
impl Send for Interpreter
impl Sync for Interpreter
impl Unpin for Interpreter
impl UnwindSafe for Interpreter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more