Esempio n. 1
0
 public void Invoke(VirtualMachine.Runtime runtime)
 {
     if (Instruction != null)
     {
         Instruction.Invoke(runtime, Data);
     }
 }
Esempio n. 2
0
        public override void Invoke(VirtualMachine.Runtime runtime, object[] parms)
        {
            Debug.Assert(OnInvoke != null,
                         "Cant invoke nothing!");
            var res = OnInvoke(runtime, parms);

            runtime.Stack.Push(res);
        }
Esempio n. 3
0
        public override void Invoke(VirtualMachine.Runtime runtime, object[] parms)
        {
            runtime.PushBlock();
            int parmC = parms.Length;

            // TODO: set these as variables in the block!
            for (int p = 0; p < Parameters.Length; ++p)
            {
                if (p < parmC)
                {
                    runtime.SetValue(Parameters[p].Name, parms[p]);
                }
                else
                {
                    runtime.SetValue(Parameters[p].Name, Parameters[p].Default);
                }
            }
            runtime.Stack.Push(runtime.ProgramCounter);
            runtime.Jump(Name + "_start");
        }
Esempio n. 4
0
 public abstract void Invoke(VirtualMachine.Runtime runtime, object[] parms);