[−][src]Struct bfkit::interp::Interpreter
A Brainfuck interpreter that supports breakpoints.
Methods
impl Interpreter
[src]
pub fn new(code: Vec<BrainfuckInstruction>) -> Self
[src]
Creates a new Interpreter form some input program.
Arguments
code
- A sequence of BrainfuckInstructions to be interpreted.
pub fn set_breakpoint(&mut self, address: usize) -> Result<bool, String>
[src]
Sets a breakpoint at the specified code address.
Arguments
address
- The code address to set a breakpoint at.
pub fn delete_breakpoint(&mut self, address: usize) -> bool
[src]
Removes a breakpoint at the specified code address.
Arguments
address
- The code address to delete a breakpoint from.
pub fn run(&mut self) -> StopReason
[src]
Runs the Interpreter until either a breakpoint is hit or until the program has run to completion.
pub fn step(&mut self)
[src]
Executes a single BrainfuckInstruction.
pub fn get(&self, address: usize) -> Result<u8, String>
[src]
pub fn set(&mut self, address: usize, value: u8) -> Result<u8, String>
[src]
Writes a value to the tape at the specified address.
Arguments
address
- The tape address to write to.value
- The value to write.
pub fn jump(&mut self, address: usize) -> Result<(), String>
[src]
Sets the instruction pointer to the specified code address.
Arguments
address
- The code address to jump to.
pub fn select(&mut self, address: usize) -> Result<(), String>
[src]
Sets the data pointer to the specified tape address.
Arguments
address
- The tape address to set the data pointer to.
Auto Trait Implementations
impl Send for Interpreter
impl Sync for Interpreter
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,