Example #1
0
 public Xobject Index(Xobject i) {
   if (type.isArray() || value.code == Xcode.VAR_ADDR || value.code == Xcode.ARRAY_ADDR)
     return Xcons.PointerRef(Xcons.binaryOp(Xcode.PLUS_EXPR, Ref(), i));
   if (type.isPointer()) return Xcons.PointerRef(Xcons.binaryOp(Xcode.PLUS_EXPR, value, i));
   XmLog.fatal("Index: not Pointer");
   return null;
 }
Example #2
0
 // return value for refernce 'id'
 public Xobject Ref() {
   if (getStorageClass() == StorageClass.REG) return Xcons.Int(Xcode.REG, type, num);
   if (type.isFunction()) return value;
   if (value == null) {
     XmLog.fatal("value is null : " + toString());
   }
   return Xcons.PointerRef(value);
 }