1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 20:35:38 +02:00

Bug 184500 - Fixed up CCE by adding ICPPInternalFunction to PDOMCPPFunction.

This commit is contained in:
Doug Schaefer 2007-05-03 20:05:51 +00:00
parent e090629a8b
commit 716c2e20a6
2 changed files with 62 additions and 2 deletions

View file

@ -16,13 +16,21 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IParameter;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction;
import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil;
import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database;
@ -37,7 +45,8 @@ import org.eclipse.core.runtime.CoreException;
* @author Doug Schaefer
*
*/
class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverloader {
class PDOMCPPFunction extends PDOMCPPBinding
implements ICPPFunction, ICPPInternalFunction, IPDOMOverloader {
/**
* Offset of total number of function parameters (relative to the
@ -233,4 +242,55 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
}
return 0;
}
// Internal binding stuff, not implemented/needed
public void addDeclaration(IASTNode node) {
// Do nothing
}
public void addDefinition(IASTNode node) {
// Do nothing
}
public ICPPDelegate createDelegate(IASTName name) {
throw new PDOMNotImplementedError(getClass().toString());
}
public IASTNode[] getDeclarations() {
return null;
}
public IASTNode getDefinition() {
return null;
}
public void removeDeclaration(IASTNode node) {
// Do nothing
}
// ICPPInternalFunction
public boolean isStatic(boolean resolveAll) {
try {
return isStatic();
} catch (DOMException e) {
return false;
}
}
public IBinding resolveParameter(IASTParameterDeclaration param) {
try {
for (PDOMCPPParameter pp = getFirstParameter(); pp != null; pp = pp.getNextParameter()) {
if (CharArrayUtils.equals(param.getDeclarator().getName().toCharArray(),
pp.getNameCharArray()))
return pp;
}
} catch (CoreException e) {
CCorePlugin.log(e);
}
// TODO - this points to a problem with overloads, I think...
return new CPPParameter(param.getDeclarator().getName());
}
}

View file

@ -178,7 +178,7 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IIndexFra
}
public IScope getScope() throws DOMException {
throw new PDOMNotImplementedError();
return null;
}
public Object getAdapter(Class adapter) {