private void Evaluate(object obj) { var code = (IntermediateCode)obj; if (code is ICAssignment) { ICAssignment ica = (ICAssignment)code; // create OperationImpl instance ObjectHandle handle = Activator.CreateInstance("JOSPrototype", "JOSPrototype.Runtime.Operation." + ica.op + "OnKH", false, 0, null, new object[] { this, code, program }, null, null); Operation.Operation opImpl = (Operation.Operation)handle.Unwrap(); // execute the operation on KH opImpl.Run(); } else if (code is ICWhile) { ICWhile icw = (ICWhile)code; WhileOnKH op = new WhileOnKH(this, icw, program); op.Run(); } else { ICIfElse icie = (ICIfElse)code; IfElseOnKH op = new IfElseOnKH(this, icie, program); op.Run(); } }
private void Evaluate(Object state) { var helperState = (HelperThreadState)state; // create OperationImpl instance ObjectHandle handle = Activator.CreateInstance("JOSPrototype", "JOSPrototype.Runtime.Operation." + helperState.Operation + "OnHelper", false, 0, null, new object[] { this, helperState.Line }, null, null); Operation.Operation opImpl = (Operation.Operation)handle.Unwrap(); // execute the operation on Helper opImpl.Run(); }