@Override public CsmClassifier getClassifier() { return type.getClassifier(); }
@Override public CsmClassifier getClassifier() { return delegate.getClassifier(); }
@Override public CsmClassifier getClassifier() { return type.getClassifier(); }
private CsmClassifier getTypeClassifier(CsmType type){ if (isRecursionOnResolving(INFINITE_RECURSION)) { return null; } return type.getClassifier(); }
@Override public boolean check(CsmType value) { CsmClassifier cls = value.getClassifier(); return CsmKindUtilities.isTemplate(cls); }
private static String formatType(CsmType type, boolean useFullName, boolean appendDblComma, boolean appendStar) { StringBuilder sb = new StringBuilder(); if (type != null && type.getClassifier() != null) { // sb.append(type.format(useFullName)); sb.append(useFullName ? type.getClassifier().getQualifiedName() : type.getClassifier().getName()); } if (appendDblComma) { sb.append(CsmCompletion.SCOPE); } if (appendStar) { sb.append('*'); //NOI18N } return sb.toString(); }
@Override public CsmClassifier getClassifier() { if (resolvedClassifier == null) { CsmType t= getAncestorType(); resolvedClassifier = t.getClassifier(); } return resolvedClassifier; }
private boolean isCopyConstructor(CsmClass cls, CsmConstructor constructor) { Collection<CsmParameter> parameters = constructor.getParameters(); if (parameters.size() == 1) { CsmParameter p = parameters.iterator().next(); CsmType paramType = p.getType(); if (paramType.isReference()) { if (cls.equals(paramType.getClassifier())) { return true; } } } return false; } }
private boolean isCopyConstructor(CsmClass cls, CsmConstructor constructor) { Collection<CsmParameter> parameters = constructor.getParameters(); if (parameters.size() == 1) { CsmParameter p = parameters.iterator().next(); CsmType paramType = p.getType(); if (paramType.isReference()) { if (cls.equals(paramType.getClassifier())) { return true; } } } return false; } }
private boolean isCopyConstructor(CsmClass cls, CsmConstructor constructor) { Collection<CsmParameter> parameters = constructor.getParameters(); if (parameters.size() == 1) { CsmParameter p = parameters.iterator().next(); CsmType paramType = p.getType(); if (paramType.isReference()) { if (cls.equals(paramType.getClassifier())) { return true; } } } return false; } }
private static CsmClassifier getClassifier(CsmType type, CsmFile contextFile, boolean resolveTypeChain) { CsmClassifier cls = type.getClassifier(); if (resolveTypeChain && contextFile != null && CsmBaseUtilities.isValid(cls)) { cls = CsmBaseUtilities.getOriginalClassifier(cls, contextFile); } return cls; }
public int compareTo(Object o) { if (this == o) { return 0; } CsmType t = (CsmType) o; int order = clazz.getQualifiedName().toString().compareTo(t.getClassifier().getQualifiedName().toString()); if (order == 0) { order = arrayDepth - t.getArrayDepth(); } return order; }
@Override public CsmClassifier getClassifier() { if (!CsmBaseUtilities.isValid(resolvedClassifier)) { resolvedClassifier = getAncestorType().getClassifier(); } return resolvedClassifier; }
@Override protected CsmClassifier _getClassifier() { CsmType type = resolve(); CsmClassifier classifier = type != null ? type.getClassifier() : null; if (classifier == null) { classifier = BuiltinTypes.getBuiltIn(DECLTYPE); // Unresolved? } return classifier; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof CsmType) { CsmType t = (CsmType) o; return clazz.equals(t.getClassifier()) && arrayDepth == t.getArrayDepth() && pointerDepth == t.getPointerDepth() && _const == t.isConst(); } return false; }
private static boolean getStateBit(Object object){ if (object instanceof CsmTypedef){ CsmTypedef typedef = (CsmTypedef) object; if (((CsmTypedef)object).isTypeUnnamed()){ CsmClassifier cls = typedef.getType().getClassifier(); if (cls != null && cls.getName().length()==0 && CsmKindUtilities.isCompoundClassifier(cls)) { return true; } } } return false; }
private static boolean canBePointer(CsmType type) { if (type instanceof CsmCompletion.OffsetableType) { CsmClassifier typeCls = type.getClassifier(); return CsmCompletion.isPrimitiveClass(typeCls) && CsmCompletion.INT_CLASS.getName().equals(typeCls.getName()) && ((CsmCompletion.OffsetableType) type).isZeroConst(); } return false; }
private final static CsmInstantiation tryGetInstantiation(CsmType type) { // This is a hack to detect class BaseType if (!type.isInstantiation() && type.getStartPosition() == null && type.getEndPosition() == null) { CsmClassifier cls = type.getClassifier(); return CsmKindUtilities.isInstantiation(cls) ? (CsmInstantiation) cls : null; } return null; }
private static CsmFunctionPointerType tryGetFunctionPointerType(CsmType type) { int iteration = MAX_DEPTH; while (type != null && iteration != 0) { if (CsmKindUtilities.isFunctionPointerType(type)) { return (CsmFunctionPointerType) type; } CsmClassifier cls = type.getClassifier(); if (CsmKindUtilities.isTypedef(cls) || CsmKindUtilities.isTypeAlias(cls)) { CsmTypedef td = (CsmTypedef) cls; type = td.getType(); } else { break; } iteration--; } return null; }
public static int getSizeOfType(CsmType type, CsmFile context) { if (!CsmBaseUtilities.isValid(type)) { return SIZEOF_UNKNOWN; } if (type.isReference()) { return getSizeOfReference(type.getContainingFile()); } else if (type.isPointer()) { return getSizeOfPointer(type.getContainingFile()); } else if (type.getArrayDepth() > 0) { // TODO: all arrays have size of classifier*2 until TypeImpl will store its array definition expression CsmClassifier cls = type.getClassifier(); return getSizeOfClassifier(cls, type.getContainingFile()); } else { CsmClassifier cls = type.getClassifier(); return getSizeOfClassifier(cls, type.getContainingFile()); } }