AjTalk.Language.Method.Execute C# (CSharp) Метод

Execute() публичный Метод

public Execute ( System.Machine machine, IObject self, object args ) : object
machine System.Machine
self IObject
args object
Результат object
        public object Execute(Machine machine, IObject self, object[] args)
        {
            return (new Interpreter(new ExecutionContext(machine, self, this, args))).Execute();
        }

Same methods

Method::Execute ( System.Machine machine, object args ) : object

Usage Example

Пример #1
0
        public void CompileAndRun()
        {
            Machine machine = new Machine();
            IClass cls = machine.CreateClass("TestClass");
            cls.DefineInstanceVariable("x");

            Method mth;

            mth = new Method(cls, "x:");
            mth.CompileArgument("newX");
            mth.CompileGet("newX");
            mth.CompileSet("x");

            cls.DefineInstanceMethod(mth);

            IObject obj = (IObject)cls.NewObject();

            mth.Execute(machine, obj, new object[] { 10 });

            Assert.AreEqual(10, obj[0]);
        }
All Usage Examples Of AjTalk.Language.Method::Execute