@Override public boolean equals(Object o) { if (!(o instanceof Description)) { return false; } Description d = (Description) o; if (!this.name.equals(d.name)) { return false; } if (this.elementHandle != d.elementHandle) { if (this.elementHandle == null || d.elementHandle == null) { return false; } if (this.elementHandle.getKind() != d.elementHandle.getKind()) { return false; } if (!this.elementHandle.equals(d.elementHandle)) { return false; } } return true; }
@SuppressWarnings("unchecked") /*package*/ void filterDeclarations(final Iterator in, final Collection out, final CsmDeclaration.Kind kinds[], final String strPrefix, final boolean match, final boolean returnUnnamedMembers) { while (in.hasNext()) { CsmDeclaration decl = (CsmDeclaration) in.next(); if (isKindOf(decl.getKind(), kinds)) { CharSequence name = decl.getName(); if (matchName(name, strPrefix, match) || (name.length() == 0 && returnUnnamedMembers)) { out.add(decl); } } } }
public static boolean canRegisterDeclaration(CsmDeclaration decl) { // WAS: don't put unnamed declarations assert decl != null; assert decl.getName() != null; if (decl.getName().length() == 0) { return false; } CsmScope scope = decl.getScope(); if (scope instanceof CsmCompoundClassifier) { return canRegisterDeclaration((CsmCompoundClassifier) scope); } return true; }
VisibilityInfo vInfo = getContextVisibility(containingClass, member, CsmVisibility.PROTECTED, INIT_INHERITANCE_LEVEL); if (matchVisibility((CsmMember) decl, vInfo.visibility)) { if (isKindOf(decl.getKind(), kinds)) { CharSequence memberName = decl.getName(); if ((matchName(memberName, strPrefix, match)) || (memberName.length() == 0 && returnUnnamedMembers)) { qname = ((CsmFunction) decl).getSignature(); } else { qname = decl.getQualifiedName();
private CharSequence getQualifiedNameWithoutScopeStructNameForC(CsmDeclaration decl) { Kind kind = decl.getKind(); if ((kind != CsmDeclaration.Kind.STRUCT && kind != CsmDeclaration.Kind.UNION) || CsmKindUtilities.isTemplate(decl)) { qualifiedNamePostfix = ((OffsetableDeclarationBase)decl).getQualifiedNamePostfix(); } else { qualifiedNamePostfix = decl.getName(); CsmScope scope = decl.getScope(); while (CsmKindUtilities.isClass(scope)) { CsmClass cls = (CsmClass) scope;
private CsmObject resolveInUsingDeclarations(CsmObject result, CsmNamespace containingNS, CharSequence nameToken, AtomicBoolean outVisibility) { if (result == null || !outVisibility.get()) { Collection<CsmDeclaration> decls = CsmUsingResolver.getDefault().findUsedDeclarations(containingNS, nameToken);//, nameToken); for (CsmDeclaration decl : decls) { if (CharSequences.comparator().compare(nameToken, decl.getName()) == 0) { if (CsmKindUtilities.isClassifier(decl) && needClassifiers()) { result = decl; break; } else if (CsmKindUtilities.isClass(decl) && needClasses()) { result = decl; break; } } } } return result; }
StringBuilder fqn = new StringBuilder(templateDecl.getUniqueName()); fqn.append('<'); // NOI18N specs = new ArrayList<>(((ProjectBase) proj).findDeclarationsByPrefix(fqn.toString())); if (CsmKindUtilities.isTemplate(cls)) { specs = new ArrayList<>(); CharSequence funName = templateDecl.getName(); Collection<CsmOffsetableDeclaration> specializations = getSpecializations(cls, contextFile, contextOffset); for (CsmOffsetableDeclaration specialization : specializations) {
CharSequence qn = decl.getQualifiedName(); changed |= removeClassifier(map, qn, uid);
System.out.println("UNIQUE NAME IS: " + ((CsmDeclaration) object).getUniqueName()); // NOI18N
addEnumerators(res, en, strPrefix, match, caseSensitive); } else if (CsmKindUtilities.isNamespaceDefinition(decl) && decl.getName().length()==0){ CsmNamespaceDefinition ns = (CsmNamespaceDefinition)decl; CsmFilter filter = createFilter(new CsmDeclaration.Kind[] {CsmDeclaration.Kind.ENUM}, (!context.isCpp() || decl.getName().length()==0)){ CsmClass cls = (CsmClass) decl; for (CsmMember member : cls.getMembers()) {
private CsmClassifier findOtherClassifier(CsmClassifier out) { CsmNamespace ns = BaseUtilitiesProviderImpl.getImpl()._getClassNamespace(out); CsmClassifier cls = null; if (ns != null) { CsmUID<?> uid = UIDs.get(out); CharSequence fqn = out.getQualifiedName(); Collection<CsmOffsetableDeclaration> col; if (ns instanceof NamespaceImpl) { col = ((NamespaceImpl)ns).getDeclarationsRange(fqn, new Kind[]{Kind.CLASS, Kind.UNION, Kind.STRUCT, Kind.ENUM, Kind.TYPEDEF, Kind.TYPEALIAS, Kind.TEMPLATE_DECLARATION, Kind.TEMPLATE_SPECIALIZATION, Kind.CLASS_FORWARD_DECLARATION, Kind.ENUM_FORWARD_DECLARATION}); } else { col = ns.getDeclarations(); } for (CsmDeclaration decl : col) { if (CsmKindUtilities.isClassifier(decl) && decl.getQualifiedName().equals(fqn)) { if (!UIDs.get(decl).equals(uid)) { cls = (CsmClassifier)decl; if (!ForwardClass.isForwardClass(cls)) { break; } } } } } return cls; }
if (element.getUniqueName().equals(functionUin)) { return (CsmFunction) element;
@Override public int hashCode() { int hash = 7; hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0); hash = 29 * hash + (this.elementHandle != null ? this.elementHandle.getKind().hashCode() : 0); return hash; }
@SuppressWarnings("unchecked") /*package*/ void filterDeclarations(final CsmNamespace ns, final Collection out, final CsmDeclaration.Kind[] kinds, final String strPrefix, final boolean match, final boolean returnUnnamedMembers) { CsmFilter filter = CsmContextUtilities.createFilter(kinds, strPrefix, match, caseSensitive, returnUnnamedMembers); Iterator it = CsmSelect.getDeclarations(ns, filter); while (it.hasNext()) { CsmDeclaration decl = (CsmDeclaration) it.next(); if (isKindOf(decl.getKind(), kinds)) { CharSequence name = decl.getName(); if (matchName(name, strPrefix, match) || (name.length() == 0 && returnUnnamedMembers)) { out.add(decl); } } } }
while (it.hasNext()) { CsmDeclaration elem = it.next(); if (CharSequences.comparator().compare(lastName,elem.getName())==0) { if (!CsmKindUtilities.isExternVariable(elem) && !CsmKindUtilities.isClassForwardDeclaration(elem)
private InheritanceImpl(CsmFile file, CsmScope scope, CsmType ancestorType, CsmVisibility visibility, boolean virtual, int startOffset, int endOffset) { super(file, startOffset, endOffset); this.scope = UIDCsmConverter.scopeToUID(scope); if (visibility == null) { this.visibility = ((CsmDeclaration)scope).getKind() == CsmDeclaration.Kind.STRUCT ? CsmVisibility.PUBLIC: CsmVisibility.PRIVATE; } else { this.visibility = visibility; } this.virtual = virtual; this.ancestorType = ancestorType; }
private void processDeclaration(CsmDeclaration decl, NameMatcher matcher) { checkCancelled(); switch (decl.getKind()) { case CLASS: case UNION: CsmClass cls = (CsmClass) decl; if (!CsmClassifierResolver.getDefault().isForwardClass(cls)) { if (matcher.accept(decl.getName().toString())) { if (CsmVisibilityQuery.isVisible(cls)) { addResult(cls); case ENUM: case TYPEDEF: if (matcher.accept(decl.getName().toString())) { if (CsmVisibilityQuery.isVisible(decl)) { addResult((CsmClassifier) decl);
CsmDeclaration decl = it.next(); if( CsmKindUtilities.isFunctionDefinition(decl) ) { if( getName().equals(decl.getName()) ) { CsmFunctionDefinition fun = (CsmFunctionDefinition) decl; if( getSignature().equals(fun.getSignature())) {
while (it.hasNext()) { CsmDeclaration decl = it.next(); if (CsmKindUtilities.isExternVariable(decl) && decl.getName().equals(getName())) { FileImpl aFile = (FileImpl) getContainingFile(); aFile.getProjectImpl(true).unregisterDeclaration(this);