예제 #1
0
        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);
        }
예제 #2
0
 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);
 }
예제 #3
0
 public void SetRegister(BasicContextValue gvalue, int val)
 {
     SetRegister(bindings.Find(x => x.gvalue == gvalue).elementType, val);
 }
예제 #4
0
 public BindingPair(BasicContextValue gvalue, ElementType elementType)
 {
     this.gvalue      = gvalue;
     this.gword       = 0;
     this.elementType = elementType;
 }
예제 #5
0
 public BindingPair(int gword, ElementType elementType)
 {
     this.gvalue      = BasicContextValue.GUMBOWORD;
     this.gword       = gword;
     this.elementType = elementType;
 }
예제 #6
0
 public BindingPair(int gword, ElementType elementType)
 {
     this.gvalue = BasicContextValue.GUMBOWORD;
     this.gword = gword;
     this.elementType = elementType;
 }
예제 #7
0
 public BindingPair(BasicContextValue gvalue, ElementType elementType)
 {
     this.gvalue = gvalue;
     this.gword = 0;
     this.elementType = elementType;
 }
예제 #8
0
 public void SetRegister(BasicContextValue gvalue, int val)
 {
     SetRegister(bindings.Find(x => x.gvalue == gvalue).elementType, val);
 }
예제 #9
0
 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;
 }
예제 #10
0
 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;
 }