本文整理汇总了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;
}
示例2: Parser
public Parser(NetRuby rb, RThread th, bool in_eval)
{
evalTree = null;
ruby = rb;
thread = th;
compile_for_eval = in_eval;
}
示例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;
*/
}
示例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(".");
/*
}
*/
}
示例5: RString
public RString(NetRuby rb, string s, bool taint) :
base(rb, rb.cString)
{
ptr = s;
if (taint)
flags |= FL.TAINT;
}
示例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;
}
示例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);
}
示例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));
}
}
示例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);
}
示例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);
}
示例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
}
示例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;
}
}
示例13: Create
internal static RArray Create(NetRuby rb, object[] args)
{
RArray a = new RArray(rb, args);
return a;
}
示例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);
}
示例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;
}