Example #1
0
        internal static object eval_under(Class klass, object self, String src, IContext scope, string file, int line, Frame caller) {
            //System.Console.WriteLine("eval({0})", src.value);
            Frame frame = scope.Frame();
            //frame.caller = caller;      // BBTAG

            Compiler.AST.EVAL tree = (Compiler.AST.EVAL)Compiler.Parser.ParseString(caller, frame, file, src, line);
            PERWAPI.PEFile assembly = tree.GenerateCode(null);

            //Compiler.CodeGenContext.WriteToFile(assembly);
            return tree.ExecuteInit(assembly, klass, scope.Self(), caller, frame);
            //throw new System.Exception("testing");
        }
Example #2
0
        // ------------------------------------------------------------------------------


        internal static object eval(object self, String src, IContext scope, string file, int line, Frame caller) {
            //System.Console.WriteLine("eval({0})", src.value);
            Frame frame = scope.Frame();
            //frame.caller = caller;      // BBTAG

            Compiler.AST.EVAL tree = (Compiler.AST.EVAL)Compiler.Parser.ParseString(caller, frame, file, src, line);
            PERWAPI.FieldRef surroundingClass = Compiler.CodeGenContext.FindParentClassField(frame.GetType());
            PERWAPI.PEFile assembly = tree.GenerateCode(surroundingClass);

            //assembly.WritePEFile(false);
            return tree.ExecuteInit(assembly, null, scope.Self(), caller, frame);
            //throw new System.Exception("testing");
        }