mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Added isGloballyQualified method to avoid PDOMNotImplementedError.
This commit is contained in:
parent
4109b34df6
commit
4619d45eef
1 changed files with 30 additions and 24 deletions
|
@ -24,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
|
@ -51,7 +52,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bryan Wilkinson
|
* @author Bryan Wilkinson
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
ICPPClassType, ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
|
ICPPClassType, ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
|
||||||
|
@ -137,7 +137,8 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
if (!ct1.isSameType(ct2))
|
if (!ct1.isSameType(ct2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ObjectMap m1 = getArgumentMap(), m2 = ((ICPPTemplateInstance)type).getArgumentMap();
|
ObjectMap m1 = getArgumentMap();
|
||||||
|
ObjectMap m2 = ((ICPPTemplateInstance) type).getArgumentMap();
|
||||||
if (m1 == null || m2 == null || m1.size() != m2.size())
|
if (m1 == null || m2 == null || m1.size() != m2.size())
|
||||||
return false;
|
return false;
|
||||||
for (int i = 0; i < m1.size(); i++) {
|
for (int i = 0; i < m1.size(); i++) {
|
||||||
|
@ -165,6 +166,11 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
|
return ((ICPPBinding) getSpecializedBinding()).isGloballyQualified();
|
||||||
|
}
|
||||||
|
|
||||||
//ICPPClassType unimplemented
|
//ICPPClassType unimplemented
|
||||||
public IField findField(String name) throws DOMException { fail(); return null; }
|
public IField findField(String name) throws DOMException { fail(); return null; }
|
||||||
public ICPPMethod[] getAllDeclaredMethods() throws DOMException { fail(); return null; }
|
public ICPPMethod[] getAllDeclaredMethods() throws DOMException { fail(); return null; }
|
||||||
|
@ -211,8 +217,7 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
result[i] = specialization;
|
result[i] = specialization;
|
||||||
} else {
|
} else {
|
||||||
result[i] = CPPTemplates.createSpecialization(
|
result[i] = CPPTemplates.createSpecialization(
|
||||||
PDOMCPPClassInstance.this, (IBinding) specMap
|
PDOMCPPClassInstance.this, (IBinding) specMap.keyAt(i), getArgumentMap());
|
||||||
.keyAt(i), getArgumentMap());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -234,8 +239,8 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IBinding[] specialized = ((ICPPClassType) getTemplateDefinition())
|
IScope scope = ((ICPPClassType) getTemplateDefinition()).getCompositeScope();
|
||||||
.getCompositeScope().getBindings(name, resolve, false);
|
IBinding[] specialized = scope.getBindings(name, resolve, false);
|
||||||
SpecializationFinder visitor = new SpecializationFinder(specialized);
|
SpecializationFinder visitor = new SpecializationFinder(specialized);
|
||||||
accept(visitor);
|
accept(visitor);
|
||||||
return CPPSemantics.resolveAmbiguities(name, visitor.getSpecializations());
|
return CPPSemantics.resolveAmbiguities(name, visitor.getSpecializations());
|
||||||
|
@ -246,7 +251,8 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
|
||||||
|
throws DOMException {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
try {
|
try {
|
||||||
if ((!prefixLookup && getDBName().compare(name.toCharArray(), true) == 0)
|
if ((!prefixLookup && getDBName().compare(name.toCharArray(), true) == 0)
|
||||||
|
@ -256,8 +262,8 @@ class PDOMCPPClassInstance extends PDOMCPPInstance implements
|
||||||
result = (IBinding[]) ArrayUtil.append(IBinding.class, result, this);
|
result = (IBinding[]) ArrayUtil.append(IBinding.class, result, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
IBinding[] specialized = ((ICPPClassType) getTemplateDefinition())
|
IScope scope = ((ICPPClassType) getTemplateDefinition()).getCompositeScope();
|
||||||
.getCompositeScope().getBindings(name, resolve, prefixLookup);
|
IBinding[] specialized = scope.getBindings(name, resolve, prefixLookup);
|
||||||
SpecializationFinder visitor = new SpecializationFinder(specialized);
|
SpecializationFinder visitor = new SpecializationFinder(specialized);
|
||||||
accept(visitor);
|
accept(visitor);
|
||||||
result = (IBinding[]) ArrayUtil.addAll(IBinding.class, result, visitor.getSpecializations());
|
result = (IBinding[]) ArrayUtil.addAll(IBinding.class, result, visitor.getSpecializations());
|
||||||
|
|
Loading…
Add table
Reference in a new issue