Пример #1
0
  @Override
  public boolean isSameType(IType t) {
    if (t == this) return true;

    if (t instanceof ITypedef) return type.isSameType(((ITypedef) t).getType());
    return type.isSameType(t);
  }
Пример #2
0
  @Override
  public boolean isSameType(IType type) {
    IType myrtype = getType();
    if (myrtype == null) return false;

    if (type instanceof ITypedef) {
      type = ((ITypedef) type).getType();
    }
    return myrtype.isSameType(type);
  }
Пример #3
0
  @Override
  public boolean isSameType(IType obj) {
    if (obj == this) return true;
    if (obj instanceof ITypedef) return ((ITypedef) obj).isSameType(this);

    if (obj instanceof ICPPParameterPackType) {
      final ICPPParameterPackType rhs = (ICPPParameterPackType) obj;
      IType t1 = getType();
      IType t2 = rhs.getType();
      return t1 != null && t1.isSameType(t2);
    }
    return false;
  }
Пример #4
0
  @Override
  public boolean isSameType(IType type) {
    if (type == this) return true;
    if (type instanceof ITypedef) return type.isSameType(this);

    return false;
  }
  @Override
  public boolean isSameType(IType type) {
    if (type instanceof ITypedef) {
      return type.isSameType(this);
    }

    if (type instanceof PDOMNode) {
      PDOMNode node = (PDOMNode) type;
      if (node.getPDOM() == getPDOM()) {
        return node.getRecord() == getRecord();
      }
    }

    if (type instanceof IEnumeration) {
      IEnumeration etype = (IEnumeration) type;
      char[] nchars = etype.getNameCharArray();
      if (nchars.length == 0) {
        nchars = ASTTypeUtil.createNameForAnonymous(etype);
      }
      if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray())) return false;

      return SemanticUtil.haveSameOwner(this, etype);
    }
    return false;
  }
  @Override
  public boolean isSameType(IType type) {
    if (type instanceof ITypedef) {
      return type.isSameType(this);
    }

    if (!(type instanceof ICPPTemplateTypeParameter)) return false;

    return getParameterID() == ((ICPPTemplateParameter) type).getParameterID();
  }
  @Override
  public boolean isSameType(IType type) {
    if (type == this) return true;
    if (type instanceof ITypedef) return type.isSameType(this);

    if (type instanceof ICPPClassTemplatePartialSpecializationSpecialization) {
      return CPPClassTemplatePartialSpecialization.isSamePartialClassSpecialization(
          this, (ICPPClassTemplatePartialSpecializationSpecialization) type);
    }
    return false;
  }
Пример #8
0
 @Override
 public C99ArrayType clone() {
   C99ArrayType clone = null;
   try {
     clone = (C99ArrayType) super.clone();
     clone.type = (IType) type.clone();
   } catch (CloneNotSupportedException e) {
     assert false; // not going to happen
   }
   return clone;
 }
Пример #9
0
 @Override
 public C99Typedef clone() {
   try {
     C99Typedef clone = (C99Typedef) super.clone();
     clone.type = (IType) type.clone();
     return clone;
   } catch (CloneNotSupportedException e) {
     assert false;
     return null;
   }
 }
Пример #10
0
 public EvalFixed(IType type, ValueCategory cat, IValue value) {
   if (type instanceof CPPBasicType) {
     Long num = value.numericalValue();
     if (num != null) {
       CPPBasicType t = (CPPBasicType) type.clone();
       t.setAssociatedNumericalValue(num);
       type = t;
     }
   }
   fType = type;
   fValueCategory = cat;
   fValue = value;
 }
Пример #11
0
 public boolean isSameType(IType t) {
   if (t == this) return true;
   if (t instanceof ITypedef) return t.isSameType(this);
   if (t instanceof ICArrayType) {
     ICArrayType at = (ICArrayType) t;
     if (at.isConst() == isConst
         && at.isRestrict() == isRestrict
         && at.isStatic() == isStatic
         && at.isVolatile() == isVolatile
         && at.isVariableLength() == isVariableLength) {
       return at.isSameType(type);
     }
   }
   return false;
 }
Пример #12
0
  @Override
  public boolean isSameType(IType type) {
    if (type == this) return true;

    if (type instanceof ITypedef) return type.isSameType(this);

    if (type instanceof PDOMNode) {
      PDOMNode node = (PDOMNode) type;
      if (node.getPDOM() == getPDOM()) {
        return node.getRecord() == getRecord();
      }
    }

    // require a class specialization
    if (!(type instanceof ICPPClassSpecialization)) return false;

    return CPPClassSpecialization.isSameClassSpecialization(this, (ICPPClassSpecialization) type);
  }
Пример #13
0
 @Override
 public boolean isSameType(IType other) {
   return type.isSameType(other);
 }
Пример #14
0
 @Override
 public String toString() {
   if (fValue != null) return fValue.toString();
   return fType.toString();
 }
Пример #15
0
 public boolean isSameValue(ICPPTemplateArgument arg) {
   if (fValue != null) {
     return fValue.equals(arg.getNonTypeValue());
   }
   return fType.isSameType(arg.getTypeValue());
 }