예제 #1
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void errInfoSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     if (val != null)
     {
         RBasic b = rb.InstanceOf(val);
         if (b.IsKindOf(rb.eException) == false)
             throw new eTypeError("assigning non-exception to $!");
     }
     th.errInfo = (RException)val;
 }
예제 #2
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private void  iCaseSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     rb.cRegexp.IsIgnoreCase = RBasic.RTest(val);
 }
예제 #3
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private void kCodeSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
 }
예제 #4
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private object matchGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     object o = th.BackRef;
     matchBusy(o);
     return o;
 }
예제 #5
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private object lastParenGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     RMatchData m = (RMatchData)th.BackRef;
     if (m == null) return null;
     string s = m.Last;
     if (m.IsTainted)
         return new RString(rb, s, true);
     return s;
 }
예제 #6
0
파일: NETRuby.cs 프로젝트: emtees/old-code
     internal object GVarSet(GlobalEntry entry, object o)
     {
         RThread th = GetCurrentContext();
         /*if (th.safeLevel >= 4)
         {
             throw new SecurityException("Insecure: can't change global variable value");
         }*/
         lock (entry)
         {
             entry.SetValue(o, this);
         }
 // trace
         return o;
     }
예제 #7
0
파일: node.cs 프로젝트: emtees/old-code
 protected RNGAsgn(uint v, GlobalEntry e)
     : base(null, v, null)
 {
     ent = e;
 }
예제 #8
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static internal object lastLineGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     /*
     RThread th = rb.GetCurrentContext();
     if (th.scope.local_vars != null)
     {
         return th.scope.local_vars[0];
     }
     */
     return null;
 }
예제 #9
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void lastLineSetter(object val, uint i, GlobalEntry gb, NetRuby rb)
 {
     /*
     RThread th = rb.GetCurrentContext();
     if (th.scope.local_vars != null)
     {
         th.scope.local_vars[0] = val.ToString();
     }
     else
     {
     }
     */
 }
예제 #10
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object debugGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     return rb.debug;
 }
예제 #11
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void debugSetter(object val, uint i, GlobalEntry gb, NetRuby rb)
 {
     if (val == null) rb.debug = false;
     else if (val is bool) rb.debug = (bool)val;
     else rb.debug = true;
 }
예제 #12
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void verboseSetter(object val, uint i, GlobalEntry gb, NetRuby rb)
 {
     if (val == null) rb.verbose = false;
     else if (val is bool) rb.verbose = (bool)val;
     else rb.verbose = true;
 }
예제 #13
0
파일: NETRuby.cs 프로젝트: emtees/old-code
/*        
        static private object safeGetter(uint i, GlobalEntry gb, NetRuby rb)
        {
            return rb.GetCurrentContext().safeLevel;
        }
        static private void safeSetter(object val, uint i, GlobalEntry gb, NetRuby rb)
        {
            int level = RInteger.ToInt(rb, val);
            RThread th = rb.GetCurrentContext();
            if (level < th.safeLevel)
                throw new SecurityException(String.Format("tried to downgrade safe level from {0} to {1}", th.safeLevel, level));
            th.safeLevel = level;
        }
*/        
        static private object verboseGetter(uint i, GlobalEntry gb, NetRuby rb)
        {
            return rb.verbose;
        }
예제 #14
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object errInfoGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     return th.errInfo;
 }
예제 #15
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 internal void DefineVirtualVariable(string name, GlobalEntry.Getter gtr, GlobalEntry.Setter str)
 {
     DefineVariable(name, null, gtr, str);
 }
예제 #16
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object printGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     return rb.doPrint;
 }
예제 #17
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 internal void DefineReadonlyVariable(string name, object obj, GlobalEntry.Getter gtr)
 {
     GlobalEntry ent = global_entry(global_id(name));
     lock (ent)
     {
         ent.data = obj;
         ent.ReplaceGetter(gtr);
         ent.ReplaceSetter(new GlobalEntry.Setter(GlobalEntry.ReadonlySetter));
     }
 }
예제 #18
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object splitGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     return rb.doSplit;
 }
예제 #19
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 internal object GVarGet(GlobalEntry entry)
 {
     return entry.GetValue(this);
 }
예제 #20
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object lineGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     return rb.doLine;
 }
예제 #21
0
파일: node.cs 프로젝트: emtees/old-code
 internal RNGVar(uint v, GlobalEntry ent) :
     base(v, ent)
 {
 }
예제 #22
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private object argvGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     return rb.argv;
 }
예제 #23
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private void matchSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     rb.CheckType(val, typeof(RMatchData));
     RThread th = rb.GetCurrentContext();
     th.BackRef = val;
 }
예제 #24
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void SetArg0(object val, uint i, GlobalEntry gb, NetRuby rb)
 {
 }
예제 #25
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private object iCaseGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     return rb.cRegexp.ignoreCase;
 }
예제 #26
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 internal GlobalEntry global_entry(uint id)
 {
     object o;
     GlobalEntry ret = null;
     lock (global_tbl.SyncRoot)
     {
         if (global_tbl.lookup(id, out o))
             ret = (GlobalEntry)o;
         else
         {
             ret = new GlobalEntry(id);
             global_tbl.Add(id, ret);
         }
     }
     return ret;
 }
예제 #27
0
파일: Regexp.cs 프로젝트: emtees/old-code
 static private object kCodeGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     return "none";
 }
예제 #28
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 /*
 internal void CloneGenericIVar(RBasic clone, RBasic obj)
 {
     if (generic_iv_tbl == null) return;
     lock (generic_iv_tbl.SyncRoot)
     {
         if (generic_iv_tbl.ContainsKey(obj))
         {
             st_table tbl = (st_table)generic_iv_tbl[obj];
             generic_iv_tbl[clone] = tbl.Clone();
         }
     }
 }
 internal bool IsGenericIVarDefined(RBasic obj, uint id)
 {
     if (generic_iv_tbl == null) return false;
     st_table tbl = null;
     if (generic_iv_tbl.lookup(obj, out tbl) == false) return false;
     object val;
     return tbl.lookup(id, out val);
 }
 internal object GenericIVarGet(RBasic obj, uint id)
 {
     if (generic_iv_tbl == null) return null;
     st_table tbl = null;
     if (generic_iv_tbl.lookup(obj, out tbl) == false) return null;
     object val;
     if (tbl.lookup(id, out val)) return val;
     return null;
 }
 internal void GenericIVarSet(RBasic obj, uint id, object val)
 {
     if (generic_iv_tbl == null)
     {
         lock (this)
         {
             if (generic_iv_tbl == null)
             {
                 generic_iv_tbl = new st_table();
             }
         }
     }
     st_table tbl = null;
     lock (generic_iv_tbl.SyncRoot)
     {
         if (generic_iv_tbl.lookup(obj, out tbl) == false)
         {
             tbl = new st_table();
             generic_iv_tbl[obj] = tbl;
         }
         tbl[id] = val;
     }
 }
 internal object GenericIVarRemove(RBasic obj, uint id)
 {
     if (generic_iv_tbl == null) return null;
     st_table tbl;
     if (generic_iv_tbl.lookup(obj, out tbl) == false) return null;
     object val = tbl[id];
     lock (tbl.SyncRoot)
     {
         tbl.Remove(id);
         if (tbl.Count == 0)
         {
             generic_iv_tbl.Remove(obj);
         }
     }
     return val;
 }
 */
 public void DefineVariable(string name, object obj, GlobalEntry.Getter gtr, GlobalEntry.Setter str)
 {
     GlobalEntry ent = global_entry(global_id(name));
     lock (ent)
     {
         ent.data = obj;
         ent.ReplaceGetter(gtr);
         ent.ReplaceSetter(str);
     }
 }
예제 #29
0
 public void Write(GlobalEntry n)
 {
     Write("<GlobalEntry>");
 }
예제 #30
0
파일: NETRuby.cs 프로젝트: emtees/old-code
 static private void errAtSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     if (th.errInfo == null)
     {
         throw new ArgumentException("$! not set");
     }
     RException.exc_set_backtrace(th.errInfo, val);
 }