Beispiel #1
0
 internal void CALL(string name)
 {
     if (name.Contains('.'))
     {
         try
         {
             if (globalvars.ContainsKey(name.Split('.')[0]))
             {
                 if (globalvars[name.Split('.')[0]] is Instance)
                 {
                     (globalvars[name.Split('.')[0]] as Instance).Call(name.Substring(name.IndexOf('.') + 1));
                 }
                 else
                 {
                     parent.Error("Var not found!", "Could not find variable: " + name + " in globalvars of thread: " + this.Name);
                 }
             }
             else if (ContainsClass(name.Split('.')[0]))
             {
                 GetClass(name.Split('.')[0]).Call(name.Substring(name.IndexOf('.') + 1), this);
             }
         }
         catch
         {
         }
     }
     else
     {
         if (globalvars.ContainsKey(name))
         {
             if (globalvars[name] is FuncPtr)
             {
                 int   adrs = (globalvars[name] as FuncPtr).address;
                 vCall c    = new vCall();
                 c.startaddress = adrs;
                 c.retaddress   = instructionIndex;
                 c.referance    = new vMethod("Temp", adrs);
                 callstack.Push(c);
                 c.Run(this);
             }
         }
         else
         {
             vMethod m = GetMethod(name);
             if (m != null)
             {
                 vCall c = new vCall();
                 c.startaddress = m.GetAddress();
                 c.retaddress   = instructionIndex;
                 c.referance    = m;
                 callstack.Push(c);
                 c.Run(this);
             }
             else
             {
                 parent.Error("Method not found!", "Could not find method: " + name + " in global method list.");
             }
         }
     }
 }
Beispiel #2
0
        internal void Call(string p, vThread from)
        {
            vMethod m = getMethod(p);

            if (m != null)
            {
                vCall c = new vCall();
                c.referance    = m;
                c.retaddress   = from.instructionIndex;
                c.startaddress = m.GetAddress();
                from.callstack.Push(c);
                from.callstack.Peek().Run(from);
            }
        }
Beispiel #3
0
 internal void Call(string name)
 {
     if (name.Contains('.'))
     {
         try
         {
             if (fields.ContainsKey(name.Split('.')[0]))
             {
                 if (fields[name.Split('.')[0]] is Instance)
                 {
                     (fields[name.Split('.')[0]] as Instance).Call(name.Substring(name.IndexOf('.') + 1));
                 }
                 else
                 {
                     parent.parent.Error("Var not found!", "Could not find var: " + name.Split('.')[0] + " in class: " + type.getName());
                 }
             }
         }
         catch
         {
         }
     }
     else
     {
         vMethod m = GetMethod(name);
         if (m != null)
         {
             vCall c = new vCall();
             c.startaddress = m.GetAddress();
             c.retaddress   = parent.instructionIndex;
             c.referance    = m;
             parent.callstack.Push(c);
             parent.SaveGlobalVars();
             parent.SetGlobalVars(fields);
             c.Run(parent);
         }
         else
         {
             parent.parent.Error("Method not found!", "Could not find method: " + name + " in class: " + type.getName());
         }
     }
 }
Beispiel #4
0
 internal void CALLSTATIC(string name)
 {
     if (name.Contains('.'))
     {
         try
         {
             string[] cn = name.Split('.');
             vClass   c  = GetClass(cn[0]);
             vMethod  m  = c.getMethod(name.Substring(name.IndexOf('.') + 1));
             vCall    ca = new vCall();
             ca.referance    = m;
             ca.retaddress   = instructionIndex;
             ca.startaddress = m.GetAddress();
             callstack.Push(ca);
             ca.Run(this);
         }
         catch
         {
         }
     }
     else
     {
         vMethod m = GetMethod(name);
         if (m != null)
         {
             vCall c = new vCall();
             c.startaddress = m.GetAddress();
             c.retaddress   = instructionIndex;
             c.referance    = m;
             callstack.Push(c);
             c.Run(this);
         }
         else
         {
             parent.Error("Method not found!", "Could not find method: " + name + " in global method list.");
         }
     }
 }