[][src]Struct spaik::r8vm::R8VM

pub struct R8VM<'a> { /* fields omitted */ }

Implementations

impl<'a> R8VM<'a>[src]

pub fn new<'b>() -> R8VM<'b>[src]

pub fn minimize(&mut self)[src]

pub fn set<T: IntoLisp>(&mut self, var: SymID, obj: T) -> Result<(), Error>[src]

pub fn set_debug_mode(&mut self, debug_mode: bool)[src]

pub fn push_const<T: Into<NkSum>>(&mut self, v: T) -> usize[src]

pub fn get_func(&self, name: SymID) -> Option<&Func>[src]

pub fn add_func(&mut self, name: SymID, code: Linked, args: ArgSpec)[src]

pub fn load(&mut self, lib: SymID) -> Result<SymID, Error>[src]

pub fn consts_top(&self) -> usize[src]

pub fn get_env_global(&self, name: SymID) -> Option<usize>[src]

pub fn get_sysfn(&self, name: SymID) -> Option<usize>[src]

pub fn read(&mut self, lisp: &str) -> PResult<()>[src]

Reads LISP code into an AST.

pub fn eval_macroexpand<'z>(
    &mut self,
    v: &'z mut Value
) -> Result<&'z mut Value, Error>
[src]

pub fn macroexpand<'z>(
    &mut self,
    v: &'z mut Value
) -> Result<&'z mut Value, Error>
[src]

pub fn macroexpand_seq<'z>(
    &mut self,
    v: &'z mut Value
) -> Result<&'z mut Value, Error>
[src]

pub fn add_code(&mut self, mut code: Vec<Op>, consts: Option<Vec<NkSum>>)[src]

Add code into the VM, taking care to update the const references relative to the ones that already exist in the VM.

Arguments

  • code : Bytecode to be added.
  • labels : Optional debug labels.
  • consts : Constants referenced by the bytecode.

pub unsafe fn add_and_run(
    &mut self,
    code: Vec<Op>,
    consts: Option<Vec<NkSum>>
) -> Result<PV, Error>
[src]

Add some code and run it, returning the result.

SAFETY: Safe as long as code is well-formed.

pub fn eval_ast(&mut self, root: PV) -> Result<PV, Error>[src]

pub fn eval(&mut self, expr: &str) -> Result<PV, Error>[src]

pub fn push_ast(&mut self, v: &Value)[src]

pub unsafe fn pull_ast(&self, v: PV, src: &Source) -> Value[src]

pub fn expand(&mut self, ast: &Value) -> Option<Result<Value, Error>>[src]

pub fn set_macro(&mut self, macro_sym: SymID, fn_sym: SymID)[src]

pub fn defun(&mut self, sym: SymID, args: PV, ast: PV) -> Result<(), Error>[src]

pub fn sym_name(&self, sym: SymID) -> &str[src]

pub fn sym_id(&mut self, name: &str) -> SymID[src]

pub fn unset_breakpoint(&mut self, idx: usize) -> Result<(), RuntimeError>[src]

Restore a breakpoint to its original instruction.

Arguments

  • idx : The position of the breakpoint in program memory.

pub fn stack_unwind(&mut self, mut ip: usize, err: Error) -> Traceback[src]

Unwind the stack into a Traceback.

Arguments

  • ip : The instruction IP from which to unwind.
  • err : The error to initialize the Traceback with

pub fn dump_stack(&mut self)[src]

pub fn set_frame(&mut self, nargs: u16)[src]

pub fn call(&mut self, sym: SymID, args: &[PV]) -> Result<SPV<'a>, Error>[src]

Call a function, returning either the return value of the function or an error.

Arguments

  • sym : Symbol mapped to the function, see Arena::sym.
  • args : Arguments that should be passed.

pub fn raw_call(&mut self, sym: SymID, args: &[PV]) -> Result<PV, Error>[src]

pub fn call_s(&mut self, name: &str, args: &[PV]) -> Result<SPV<'a>, Error>[src]

pub fn print_stack(&self)[src]

pub fn get_code(&self) -> Vec<Op>[src]

pub fn dump_fn_code(&self, mut name: SymID) -> Result<(), Error>[src]

pub fn dump_macro_tbl(&self)[src]

pub fn dump_symbol_tbl(&self)[src]

pub fn dump_env_tbl(&self)[src]

pub fn get_funcs_with_prefix(&self, prefix: &str) -> Vec<SymID>[src]

pub fn code_sz(&self) -> usize[src]

pub fn dump_fn_tbl(&self)[src]

Trait Implementations

impl<'a> Debug for R8VM<'a>[src]

impl<'a> Default for R8VM<'a>[src]

impl SymDB for R8VM<'_>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for R8VM<'a>[src]

impl<'a> !Send for R8VM<'a>[src]

impl<'a> !Sync for R8VM<'a>[src]

impl<'a> Unpin for R8VM<'a>[src]

impl<'a> !UnwindSafe for R8VM<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.