[−][src]Struct rustws::Interpreter
The interpreter used for running whitespace
Implementations
impl Interpreter
[src]
pub fn new(code: String, print_instructions: bool) -> Interpreter
[src]
Create an Interpreter from a source code passed as the argument
The print_instructions parameter prints the instructions. This should be set to True when debugging the code
Example
let source = String::from(" \t\t\n"); let interpreter = Interpreter::new(source, false);
pub fn from_file(file: &str, print_instructions: bool) -> Option<Interpreter>
[src]
Initialize an interpreter from a file
The print_instructions parameter prints the instructions. This should be set to True when debugging the code
Example
let interpreter = Interpreter::from_file("main.ws", false);
pub fn write(&mut self, num: i32)
[src]
Write a value on top of the stack Should be used when the Status is set to ReadChar/ReadInt
pub fn step(&mut self) -> Result<Status, Error>
[src]
Step to the next instructions
See Status and Error for the return value
pub fn pc(&self) -> usize
[src]
Current Program Counter
Auto Trait Implementations
impl RefUnwindSafe for Interpreter
impl Send for Interpreter
impl Sync for Interpreter
impl Unpin for Interpreter
impl UnwindSafe for Interpreter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,