• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NETRuby.NetRuby类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Init

 internal static void Init(NetRuby rb)
 {
     RThreadGroupClass t = new RThreadGroupClass(rb);
     t.DefineClass("ThreadGroup", rb.cObject);
     rb.cThreadGroup = t;
     t.DefineSingletonMethod("new", new RMethod(tg_new), -1);
     t.DefineMethod("list", new RMethod(list), 0);
     t.DefineMethod("add", new RMethod(add), 1);
     RThreadGroup rg = (RThreadGroup)tg_new(t);
     t.ConstSet(rb.intern("Default"), rg);
     rg.Add(rb.GetCurrentContext());
 }
开发者ID:emtees,项目名称:old-code,代码行数:12,代码来源:Thread.cs


示例17: Init

        static internal void Init(NetRuby rb)
        {
            BindingFlags bf = BindingFlags.InvokeMethod
                | BindingFlags.Static | BindingFlags.Public
                | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy
                | BindingFlags.Instance;
            RClass ary = rb.DefineClass("Array", rb.cObject);
            RMetaObject.IncludeModule(ary, rb.mEnumerable);
            rb.cArray = ary;
            Type obj = typeof(RArray);
            ary.DefineSingletonMethod("new", new RMethod(s_new), -1);
            ary.DefineSingletonMethod("[]", obj.GetMethod("Create", bf));
        
            ary.DefineMethod("initialize", obj.GetMethod("Initialize", bf));

            ary.DefineMethod("to_ary", obj.GetMethod("ToArray", bf));
            ary.DefineMethod("==", obj.GetMethod("ArrayEqual", bf));
            ary.DefineMethod("eql?", obj.GetMethod("ArrayEql", bf));

            ary.DefineMethod("[]", obj.GetMethod("ARef", bf));
            ary.DefineMethod("[]=", obj.GetMethod("ASet", bf));
            ary.DefineMethod("at", obj.GetMethod("At", bf));
            ary.DefineMethod("first", obj.GetMethod("get_First", bf));
            ary.DefineMethod("last", obj.GetMethod("get_Last", bf));
            ary.DefineMethod("concat", obj.GetMethod("Concat", bf));
            ary.DefineMethod("<<", obj.GetMethod("Push", bf));
            ary.DefineMethod("push", obj.GetMethod("Push", bf));
            ary.DefineMethod("pop", obj.GetMethod("Pop", bf));
            ary.DefineMethod("shift", obj.GetMethod("Shift", bf));
            ary.DefineMethod("unshift", obj.GetMethod("Unshift", bf));
            ary.DefineMethod("each", obj.GetMethod("Each", bf));
            ary.DefineMethod("each_index", obj.GetMethod("EachIndex", bf));
            ary.DefineMethod("reverse_each", obj.GetMethod("ReverseEach", bf));
            ary.DefineMethod("length", obj.GetMethod("get_Count", bf));
            ary.DefineAlias("size", "length");
            ary.DefineMethod("empty?", obj.GetMethod("get_IsEmpty", bf));
            ary.DefineMethod("index", obj.GetMethod("Index", bf));
            ary.DefineMethod("rindex", obj.GetMethod("RIndex", bf));
        
            ary.DefineMethod("clone", obj.GetMethod("Clone", bf));
            ary.DefineMethod("join", obj.GetMethod("JoinMethod", bf));

            ary.DefineMethod("reverse", obj.GetMethod("Reverse", bf));
            ary.DefineMethod("reverse!", obj.GetMethod("ReverseAt", bf));
            ary.DefineMethod("sort", obj.GetMethod("Sort", bf));
            ary.DefineMethod("sort!", obj.GetMethod("SortAt", bf));
            ary.DefineMethod("collect", obj.GetMethod("Collect", bf));
            ary.DefineMethod("collect!", obj.GetMethod("CollectAt", bf));

            ary.DefineMethod("delete", obj.GetMethod("Delete", bf));
            ary.DefineMethod("delete_at", obj.GetMethod("DeleteAt", bf));
        
            ary.DefineMethod("clear", obj.GetMethod("Clear2", bf));
            ary.DefineMethod("fill", obj.GetMethod("Fill", bf));
            ary.DefineMethod("include", obj.GetMethod("Contains", bf));
        }
开发者ID:emtees,项目名称:old-code,代码行数:56,代码来源:Array.cs


示例18: RThreadGroup

 internal RThreadGroup(NetRuby rb, RMetaObject meta) :
     base(rb, meta)
 {
     gid = GetHashCode();
 }
开发者ID:emtees,项目名称:old-code,代码行数:5,代码来源:Thread.cs


示例19: EmitContext

 public EmitContext(NetRuby r, string name, string fn)
 {
     filename = fn;
     save = filename != null;
     
     ruby = r;
     
     AppDomain domain = AppDomain.CurrentDomain;
     
     AssemblyName assembly_name = new AssemblyName();
     assembly_name.Name = name;
     
     assembly_builder = domain.DefineDynamicAssembly(assembly_name, 
                 save ? AssemblyBuilderAccess.RunAndSave : AssemblyBuilderAccess.Run);
     
     string module_name = name + "Module";
     
     if(save) {
         module_builder = assembly_builder.DefineDynamicModule(module_name, filename);
     } else {
         module_builder = assembly_builder.DefineDynamicModule(module_name);
     }
 }
开发者ID:emtees,项目名称:old-code,代码行数:23,代码来源:codegen.cs


示例20: RThreadGroupClass

 private RThreadGroupClass(NetRuby rb) :
     base(rb, "ThreadGroup", rb.cObject)
 {
 }
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:Thread.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NETRuby.RBasic类代码示例发布时间:2022-05-26
下一篇:
C# NCalc.Expression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap