public Parrot() { IntPtr interp_raw; int result = Parrot_api_make_interpreter(IntPtr.Zero, 0, IntPtr.Zero, out interp_raw); if (result != 1) this.GetErrorResult(); this.Interp = new Parrot_PMC(this, interp_raw); }
public void GetErrorResult() { int is_error = 0; IntPtr exception_raw = IntPtr.Zero; int exit_code = 0; IntPtr errmsg_raw = IntPtr.Zero; int result = Parrot_api_get_result(this.Interp.RawPointer, out is_error, out exception_raw, out exit_code, out errmsg_raw); if (result == 0) throw new ParrotException(this, "Catastrophic failure. Could not get result."); Parrot_PMC exception = new Parrot_PMC(this, exception_raw); throw new ParrotException(this, exception); }
public void RunBytecode(Parrot_PMC bytecode, Parrot_PMC args) { int result = Parrot_api_run_bytecode(this.RawPointer, bytecode.RawPointer, args.RawPointer); if (result != 1) this.GetErrorResult(); }