private void CompileClassMethod(IBehavior cls, string text, Machine machine) { Parser parser = new Parser(text); cls.DefineClassMethod(parser.CompileClassMethod(cls)); }
private void DeserializeMethods(IBehavior behavior) { int nmethods = (int)this.Deserialize(); for (int k = 0; k < nmethods; k++) { string mthname = (string)this.Deserialize(); string mthsource = (string)this.Deserialize(); var method = this.compiler.CompileInstanceMethod(mthsource, behavior); behavior.DefineInstanceMethod(method); } int nclassmethods = (int)this.Deserialize(); for (int k = 0; k < nclassmethods; k++) { string mthname = (string)this.Deserialize(); string mthsource = (string)this.Deserialize(); var method = this.compiler.CompileClassMethod(mthsource, behavior); behavior.DefineClassMethod(method); } }