Beispiel #1
0
        private void LoadClass(XmlReader xr, string name)
        {
            vClass c = new vClass(name);

            while (xr.Read() && xr.NodeType != XmlNodeType.EndElement)
            {
                if (xr.Name == "field")
                {
                    Field f = new Field();
                    f.name   = xr.GetAttribute("name");
                    f.access = (xr.GetAttribute("access") == "pub" ? true : false);
                    c.fields.Add(f);
                }
                else if (xr.Name == "function")
                {
                    vMethod m = new vMethod(xr.GetAttribute("name"), Convert.ToInt32(xr.GetAttribute("address")));
                    c.methods.Add(m);
                }
            }
            classes.Add(c);
        }
Beispiel #2
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.");
         }
     }
 }
Beispiel #3
0
 internal Instance(vClass b, vThread p)
 {
     type = b;
     fields = new Dictionary<string, object>();
     parent = p;
 }
Beispiel #4
0
 private void LoadClass(XmlReader xr,string name)
 {
     vClass c = new vClass(name);
     while (xr.Read() && xr.NodeType != XmlNodeType.EndElement)
     {
         if (xr.Name == "field")
         {
             Field f = new Field();
             f.name = xr.GetAttribute("name");
             f.access = (xr.GetAttribute("access") == "pub" ? true : false);
             c.fields.Add(f);
         }
         else if (xr.Name == "function")
         {
             vMethod m = new vMethod(xr.GetAttribute("name"), Convert.ToInt32(xr.GetAttribute("address")));
             c.methods.Add(m);
         }
     }
     classes.Add(c);
 }
Beispiel #5
0
 internal Instance(vClass b, vThread p)
 {
     type   = b;
     fields = new Dictionary <string, object>();
     parent = p;
 }