当前位置: 首页>>代码示例>>C#>>正文


C# NETRuby.NetRuby类代码示例

本文整理汇总了C#中NETRuby.NetRuby的典型用法代码示例。如果您正苦于以下问题:C# NetRuby类的具体用法?C# NetRuby怎么用?C# NetRuby使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NetRuby类属于NETRuby命名空间,在下文中一共展示了NetRuby类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Scope

 public Scope(NetRuby r) :
     base(r, null)
 {
     flag = 0;
     local_tbl = null;
     local_vars = null;
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:Thread.cs

示例2: Parser

 public Parser(NetRuby rb, RThread th, bool in_eval)
 {
     evalTree = null;
     ruby = rb;
     thread = th;
     compile_for_eval = in_eval;
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:parse.cs

示例3: CreateBlock

        private void CreateBlock(NetRuby rb)
        {
/*        
            RThread th = rb.GetCurrentContext();
            block = th.block.Clone();
            block.origThread = th;
            block.wrapper = th.wrapper;
            block.iter = (block.prev != null) ?  ITER.PRE : ITER.NOT;
            block.frame = block.frame.Dup();
            if (th.frame.prev != null)
            {
                block.frame.lastFunc = th.frame.prev.lastFunc;
                block.frame.lastClass = th.frame.prev.lastClass;
            }
            if (block.iter != 0)
            {
                block.DupPrev();
            }
            else
            {
                block.prev = null;
            }
            block.scope.Dup();
            safeLevel = th.safeLevel;
*/            
        }
开发者ID:emtees,项目名称:old-code,代码行数:26,代码来源:Proc.cs

示例4: Loader

        private Loader(NetRuby rb)
        {
            ruby = rb;
            loadPath = new RArray(rb, true);
            features = new RArray(rb, true);

            string baseDir = AppDomain.CurrentDomain.BaseDirectory;
            loadPath.Add(baseDir);
            loadPath.Add(Path.Combine(baseDir, "lib"));
            loadPath.Add(AppDomain.CurrentDomain.BaseDirectory);
            string lp = Environment.GetEnvironmentVariable("RUBYLIB");
            if (lp != null)
            {
                string[] sp = lp.Split(new char[] { Path.PathSeparator });
                for (int i = 0; i < sp.Length; i++)
                {
                    loadPath.Add(Environment.ExpandEnvironmentVariables(sp[i]));
                }
            }
            /*
            if (rb.SafeLevel == 0)
            {
            */
                loadPath.Add(".");
            /*
            }
            */
        }
开发者ID:emtees,项目名称:old-code,代码行数:28,代码来源:Loader.cs

示例5: RString

 public RString(NetRuby rb, string s, bool taint) :
     base(rb, rb.cString)
 {
     ptr = s;
     if (taint)
         flags |= FL.TAINT;
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:String.cs

示例6: RBignum

 internal RBignum(NetRuby rb, uint u, bool sgn)
     : base(rb, rb.cBignum)
 {
     sign = sgn;
     len = 1;
     digits = new uint[1];
     digits[0] = u;
 }
开发者ID:emtees,项目名称:old-code,代码行数:8,代码来源:Bignum.cs

示例7: Init

 static internal void Init(NetRuby rb)
 {
     RClass sym = rb.DefineClass("Symbol", rb.cObject);
     rb.cSymbol = sym;
     rb.oSymbol = new Symbol(rb);
     sym.DefineMethod("to_i", new RMethod(to_i), 0);
     sym.DefineMethod("to_int", new RMethod(to_i), 0);
     sym.DefineMethod("inspect", new RMethod(inspect), 0);
     sym.DefineMethod("to_s", new RMethod(to_s), 0);
     sym.DefineMethod("id2name", new RMethod(to_s), 0);
 }
开发者ID:emtees,项目名称:old-code,代码行数:11,代码来源:Symbol.cs

示例8: RMetaObject

 internal RMetaObject(NetRuby rb, string name, RMetaObject sp, RMetaObject meta)
     : base(rb, meta)
 {
     super = sp;
     m_tbl = new st_table();
     if (name != null)
     {
         uint id = rb.intern(name);
         IVarSet("__classid__", Symbol.ID2SYM(id));
     }
 }
开发者ID:emtees,项目名称:old-code,代码行数:11,代码来源:Class.cs

示例9: Init

        internal static void Init(NetRuby rb)
        {
            REnumerable en = new REnumerable(rb);
            rb.mEnumerable = en;

            en.DefineMethod("find_all", new RMethod(find_all), 0);
            en.DefineMethod("select", new RMethod(find_all), 0);
        
            en.DefineMethod("collect", new RMethod(collect), 0);
            en.DefineMethod("map", new RMethod(collect), 0);
        }
开发者ID:emtees,项目名称:old-code,代码行数:11,代码来源:Enum.cs

示例10: Init

        internal static void Init(NetRuby rb)
        {
            RIOClass io = new RIOClass(rb);
            io.DefineClass("IO", rb.cObject);
            rb.cIO = io;
        
            rb.DefineGlobalFunction("printf", new RMethod(io.ruby_printf), -1);
            rb.DefineGlobalFunction("print", new RMethod(io.ruby_print), -1);
        
            rb.DefineGlobalFunction("p", new RMethod(io.ruby_p), -1);

        }
开发者ID:emtees,项目名称:old-code,代码行数:12,代码来源:IO.cs

示例11: RBasic

 /*
 internal RBasic(NetRuby rb)
 {
 }
 */
 internal RBasic(NetRuby rb, RMetaObject meta)
 {
     klass = meta;
     ruby = rb;
     /*
     if (rb.SafeLevel >= 3)
     {
         flags |= FL.TAINT;
     }
     */
     GetHashCode();        // define ID
 }
开发者ID:emtees,项目名称:old-code,代码行数:17,代码来源:Object.cs

示例12: RArray

 public RArray(NetRuby rb, ArrayList a, bool clone) :
     base(rb, rb.cArray)
 {
     if (clone)
     {
         // but it creates only a shallow copy.
         ptr = (ArrayList)a.Clone();
     }
     else
     {
         ptr = a;
     }
 }
开发者ID:emtees,项目名称:old-code,代码行数:13,代码来源:Array.cs

示例13: Create

 internal static RArray Create(NetRuby rb, object[] args)
 {
     RArray a = new RArray(rb, args);
     return a;
 }
开发者ID:emtees,项目名称:old-code,代码行数:5,代码来源:Array.cs

示例14: AssocNew

 static public RArray AssocNew(NetRuby ruby, object car, object cdr)
 {
     ArrayList ar = new ArrayList();
     ar.Add(car);
     ar.Add(cdr);
     return new RArray(ruby, ar);
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:Array.cs

示例15: RThread

        internal RThread(NetRuby rb, RThread th) :
            base(rb, rb.cThread)
        {
            result = null;
            ////safeLevel = th.safeLevel;
            gid = th.gid;
            abortOnException = rb.cThread.abortOnException;
            threadId = AppDomain.GetCurrentThreadId();
            thread = Thread.CurrentThread;
            vMode = Scope.ScopeMode.Private;
        
            ////frame = (Frame)rb.topFrame.Dup();
            ////frame.self = rb.topSelf;
            ////frame.cBase = rb.topCRef;
            scopes = new Stack();
            scope = new Scope(rb);
            dyna_vars = null;
            ////iter = new Stack();
            ////iter.Push(ITER.NOT);
            ////protTag = new Stack();
            ////    protTag.Push(null);

            ////block = null;
            lvtbl = null;

            rClass = rb.cObject;
            wrapper = null;
            ////cRef = rb.topCRef;

            file = "ruby";
            line = 0;
            inEval = 0;
            tracing = false;
            errInfo = null;
            lastCallStat = CALLSTAT.PUBLIC;

            locals = null;
        }
开发者ID:emtees,项目名称:old-code,代码行数:38,代码来源:Thread.cs


注:本文中的NETRuby.NetRuby类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。