public MethodVariabel(MethodContainer method, ObjectVariabel obj, VariabelDatabase extra) : base(null) { this.method = method; this.obj = obj; extraVariabelDatabase = extra; }
public CVar call(ObjectVariabel obj, VariabelDatabase db, CVar[] stack, EnegyData data, Posision pos) { //interprenter.setObject(obj); Interprenter.parse(new TokenCache(Body, data, db), data, db); return data.getReturn(); }
public static bool instanceof(ClassVariabel c, ObjectVariabel obj) { if (c.Name == obj.Name) return true;//direct control is success :) foreach (ClassVariabel extends in obj.GetExtends) { if (c.Name == extends.Name) return true; } return false; }
private static bool controlMethod(ObjectVariabel obj, string name, int agumentSize) { if(!obj.containsItem(name)) { return false; } //control the method size if (((MethodVariabel)obj.get(name)).agumentSize() != agumentSize) { return false; } return true; }
public ObjectVariabel createNew(VariabelDatabase db, EnegyData data, CVar[] call, Posision pos) { //wee create a new object and return the object to the system :) ObjectVariabel obj = new ObjectVariabel(this, Container.Pointer, Container.Methods, Container.ExtraVariabelDatabase, Container.Extends); if (hasConstructor()) { VariabelDatabase vd = db.createShadow(obj); if (Container.Constructor.SetVariabel) { for (int i = 0; i < Container.Constructor.Agument.size(); i++) vd.push(Container.Constructor.Agument.get(i).Name, call[i], data); } CallConstructor(vd, call, data, pos, obj); } return obj; }
public VariabelDatabase createShadow(ObjectVariabel obj) { return new VariabelDatabase(global, types, obj); }
public VariabelDatabase(Dictionary<string, CVar> global, ArrayList types, ObjectVariabel obj) { this.global = global; this.types = types; Object = obj; }
private void CallConstructor(VariabelDatabase db, CVar[] call, EnegyData data, Posision pos, ObjectVariabel obj) { new MethodVariabel(Container.Constructor, obj, Container.ExtraVariabelDatabase).call(call, db, data, pos); }