示例#1
0
 /*
  * Define a new local field array. The type may be null, which
  * is equivalent to XType.OBJECT.
  */
 internal void DefLocalFieldArray(string name, int len, XType ltype)
 {
     if (len <= 0)
     {
         throw new Exception(string.Format("invalid local array length: {0}", len));
     }
     if (Auto)
     {
         ContainerFieldArray cfa =
             new ContainerFieldArray(name, len, ltype);
         AddLocal(name + "@",
                  new LocalAccessorInterpreterFieldArrayGet(
                      this, cfa));
         AddLocal("->" + name + "@",
                  new LocalAccessorInterpreterFieldArrayPut(
                      this, cfa));
     }
     else
     {
         int off = numLocalFields;
         numLocalFields += len;
         fieldMapping.Add(off);
         AddLocal(name + "@",
                  new LocalAccessorFieldArrayGet(
                      this, off, len));
         AddLocal("->" + name + "@",
                  new LocalAccessorFieldArrayPut(
                      this, off, len, ltype));
     }
 }
示例#2
0
 internal LocalAccessorInterpreterFieldArrayPut(
     FunctionBuilder owner, ContainerFieldArray cfa)
     : base(owner)
 {
     this.cfa = cfa;
 }