Ejemplo n.º 1
0
        internal CodeGenContext(CodeGenContext context) {
            this.Assembly = context.Assembly;
            this.Method = context.Method;
            this.CLRLocals = context.CLRLocals;
            this.labels = context.labels;
            this.CurrentRubyClass = context.CurrentRubyClass;

            this.orig_func = context.orig_func;                 // BBTAG
            this.orig_func_formals = context.orig_func_formals; // BBTAG
            this.currentSkeleton = context.currentSkeleton;     // BBTAG
            this.postPassList = context.postPassList;           // BBTAG
            this.peFiles = context.peFiles;                     // BBTAG
        }
Ejemplo n.º 2
0
        internal CodeGenContext CreateModuleMethod(string name, PERWAPI.Type return_type, params Param[] parameters) {
            CodeGenContext newContext = new CodeGenContext(this);

            newContext.Method = Assembly.AddMethod(MethAttr.PublicStatic, ImplAttr.IL, name, return_type, parameters);

            newContext.CLRLocals = new List<Local>();

            newContext.Method.CreateCodeBuffer();

            newContext.buffer.OpenScope();

            return newContext;
        }
Ejemplo n.º 3
0
        internal CodeGenContext CreateMethod(ClassDef ParentClass, MethAttr attr, string name, PERWAPI.Type return_type, params Param[] parameters) {
            CodeGenContext newContext = new CodeGenContext(this);

            newContext.Method = ParentClass.AddMethod(attr, ImplAttr.IL, name, return_type, parameters);

            if ((attr & MethAttr.Static) == 0)
                newContext.Method.AddCallConv(CallConv.Instance);

            newContext.CLRLocals = new List<Local>();

            newContext.Method.CreateCodeBuffer();

            newContext.buffer.OpenScope();

            return newContext;
        }