public int AddBinding(BasicContextValue variable) { if (!hasBindings) { bindings = new List <BindingPair>(); registry = new int[9]; hasBindings = true; } int registerPlace = this.bindings.Count; this.bindings.Add(new BindingPair(variable, RegisterFromInt(registerPlace))); return(registerPlace); }
public int BindingIndex(BasicContextValue variable) { if (this.bindings != null) { for (int i = 0; i < this.bindings.Count; ++i) { if (variable == this.bindings[i].gvalue) { return(i); } } } return(-1); }
public void SetRegister(BasicContextValue gvalue, int val) { SetRegister(bindings.Find(x => x.gvalue == gvalue).elementType, val); }
public BindingPair(BasicContextValue gvalue, ElementType elementType) { this.gvalue = gvalue; this.gword = 0; this.elementType = elementType; }
public BindingPair(int gword, ElementType elementType) { this.gvalue = BasicContextValue.GUMBOWORD; this.gword = gword; this.elementType = elementType; }
public int BindingIndex(BasicContextValue variable) { if (this.bindings != null) { for(int i=0; i<this.bindings.Count; ++i) { if (variable == this.bindings[i].gvalue) { return i; } } } return -1; }
public int AddBinding(BasicContextValue variable) { if (!hasBindings) { bindings = new List<BindingPair>(); registry = new int[9]; hasBindings = true; } int registerPlace = this.bindings.Count; this.bindings.Add(new BindingPair(variable, RegisterFromInt(registerPlace))); return registerPlace; }