mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 177917 - Implement delegates so that using types and such work.
This commit is contained in:
parent
97504b356a
commit
fbb25215d4
16 changed files with 154 additions and 20 deletions
|
@ -49,8 +49,8 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl
|
|||
private ICPPDelegate [] createDelegates( IBinding [] bindings ){
|
||||
ICPPDelegate [] result = null;
|
||||
for( int i = 0; i < bindings.length; i++ ){
|
||||
if( bindings[i] instanceof ICPPInternalBinding ){
|
||||
ICPPDelegate delegate = ((ICPPInternalBinding)bindings[i]).createDelegate( name );
|
||||
if( bindings[i] instanceof ICPPDelegateCreator){
|
||||
ICPPDelegate delegate = ((ICPPDelegateCreator)bindings[i]).createDelegate( name );
|
||||
result = (ICPPDelegate[]) ArrayUtil.append( ICPPDelegate.class, result, delegate );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2007 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
**********************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
|
||||
/**
|
||||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
public interface ICPPDelegateCreator {
|
||||
|
||||
ICPPDelegate createDelegate( IASTName name );
|
||||
|
||||
}
|
|
@ -14,23 +14,19 @@
|
|||
*/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
|
||||
/**
|
||||
* @author aniefer
|
||||
*/
|
||||
public interface ICPPInternalBinding extends ICPPBinding {
|
||||
public interface ICPPInternalBinding extends ICPPBinding, ICPPDelegateCreator {
|
||||
//methods required by the CPPVisitor but not meant for the public interface
|
||||
|
||||
//implementors should keep the node with the lowest offset in declarations[0]
|
||||
IASTNode [] getDeclarations();
|
||||
IASTNode getDefinition();
|
||||
|
||||
ICPPDelegate createDelegate( IASTName name );
|
||||
|
||||
/**
|
||||
* @param declarator
|
||||
*/
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredClassInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -54,8 +55,9 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Bryan Wilkinson
|
||||
*
|
||||
*/
|
||||
class PDOMCPPClassTemplate extends PDOMCPPClassType implements
|
||||
ICPPClassTemplate, ICPPInternalTemplateInstantiator, ICPPTemplateScope {
|
||||
class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||
implements ICPPClassTemplate, ICPPInternalTemplateInstantiator,
|
||||
ICPPTemplateScope, ICPPDelegateCreator {
|
||||
|
||||
private static final int PARAMETERS = PDOMCPPClassType.RECORD_SIZE + 0;
|
||||
private static final int INSTANCES = PDOMCPPClassType.RECORD_SIZE + 4;
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
|||
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.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
|
@ -41,6 +42,8 @@ import org.eclipse.cdt.internal.core.Util;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||
|
@ -58,7 +61,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
*
|
||||
*/
|
||||
class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||
ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
|
||||
ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope, ICPPDelegateCreator {
|
||||
|
||||
private static final int FIRSTBASE = PDOMCPPBinding.RECORD_SIZE + 0;
|
||||
private static final int KEY = PDOMCPPBinding.RECORD_SIZE + 4; // byte
|
||||
|
@ -407,4 +410,9 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
|
|||
public IIndexBinding getScopeBinding() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPClassTypeDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,11 +15,15 @@ import java.util.ArrayList;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||
|
@ -30,7 +34,8 @@ import org.eclipse.core.runtime.CoreException;
|
|||
/**
|
||||
* @author Doug Schaefer
|
||||
*/
|
||||
class PDOMCPPEnumeration extends PDOMCPPBinding implements IEnumeration, IIndexType, ICPPBinding {
|
||||
class PDOMCPPEnumeration extends PDOMCPPBinding
|
||||
implements IEnumeration, IIndexType, ICPPBinding, ICPPDelegateCreator {
|
||||
|
||||
private static final int FIRST_ENUMERATOR = PDOMBinding.RECORD_SIZE + 0;
|
||||
|
||||
|
@ -124,5 +129,9 @@ class PDOMCPPEnumeration extends PDOMCPPBinding implements IEnumeration, IIndexT
|
|||
public Object clone() {
|
||||
throw new PDOMNotImplementedError();
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPEnumerationDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,9 +13,13 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumerator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
|
@ -25,7 +29,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBinding {
|
||||
class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBinding, ICPPDelegateCreator {
|
||||
|
||||
private static final int ENUMERATION = PDOMBinding.RECORD_SIZE + 0;
|
||||
private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4;
|
||||
|
@ -70,4 +74,8 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi
|
|||
}
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPEnumerator.CPPEnumeratorDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,9 +13,13 @@
|
|||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -24,7 +28,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPField extends PDOMCPPVariable implements ICPPField {
|
||||
class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCreator {
|
||||
|
||||
public PDOMCPPField(PDOM pdom, PDOMNode parent, ICPPField field)
|
||||
throws CoreException {
|
||||
|
@ -84,4 +88,9 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField {
|
|||
public ICompositeType getCompositeTypeOwner() {
|
||||
return getClassOwner();
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPField.CPPFieldDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,13 +16,17 @@ 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.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.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
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 +41,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverloader {
|
||||
class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverloader, ICPPDelegateCreator {
|
||||
|
||||
/**
|
||||
* Offset of total number of function parameters (relative to the
|
||||
|
@ -233,4 +237,9 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPFunction.CPPFunctionDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
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.ICPPFunctionTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
|
@ -30,8 +31,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
|||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredFunctionInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -47,7 +50,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
*/
|
||||
class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||
ICPPFunctionTemplate, ICPPInternalTemplateInstantiator,
|
||||
IPDOMMemberOwner, ICPPTemplateScope, IIndexScope {
|
||||
IPDOMMemberOwner, ICPPTemplateScope, IIndexScope, ICPPDelegateCreator {
|
||||
|
||||
private static final int TEMPLATE_PARAMS = PDOMCPPFunction.RECORD_SIZE + 0;
|
||||
private static final int INSTANCES = PDOMCPPFunction.RECORD_SIZE + 4;
|
||||
|
@ -221,4 +224,9 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
|||
public IIndexBinding getScopeBinding() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
|||
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.ICPPDeferredTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
|
@ -50,6 +51,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
|
@ -522,6 +524,17 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
return result;
|
||||
}
|
||||
|
||||
if (binding instanceof ICPPUsingDeclaration) {
|
||||
try {
|
||||
ICPPDelegate[] delegates = ((ICPPUsingDeclaration)binding).getDelegates();
|
||||
if (delegates.length == 0)
|
||||
return null;
|
||||
// TODO - if there are more than one delegate, we have no way of knowing which one...
|
||||
return adaptBinding(delegates[0].getBinding());
|
||||
} catch (DOMException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
PDOMNode parent = getAdaptedParent(binding, false, false);
|
||||
if (parent == this) {
|
||||
result= CPPFindBinding.findBinding(getIndex(), this, binding);
|
||||
|
|
|
@ -16,10 +16,14 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
|
@ -31,7 +35,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
|
||||
class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateCreator {
|
||||
|
||||
/**
|
||||
* Offset of remaining annotation information (relative to the beginning of
|
||||
|
@ -134,4 +138,9 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
|
|||
public boolean isVolatile() {
|
||||
return getBit(getByte(record + ANNOTATION1), PDOMCAnnotation.VOLATILE_OFFSET + CV_OFFSET);
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPMethod.CPPMethodDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,11 +23,14 @@ 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.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNamespace;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -42,7 +45,8 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPNamespace extends PDOMCPPBinding implements ICPPNamespace, ICPPNamespaceScope, IIndexScope {
|
||||
class PDOMCPPNamespace extends PDOMCPPBinding
|
||||
implements ICPPNamespace, ICPPNamespaceScope, IIndexScope, ICPPDelegateCreator {
|
||||
|
||||
private static final int INDEX_OFFSET = PDOMBinding.RECORD_SIZE + 0;
|
||||
|
||||
|
@ -185,4 +189,9 @@ class PDOMCPPNamespace extends PDOMCPPBinding implements ICPPNamespace, ICPPName
|
|||
public IIndexBinding getScopeBinding() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPNamespace.CPPNamespaceDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,11 +15,15 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
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.ICPPParameter;
|
||||
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.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragment;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -34,7 +38,8 @@ import org.eclipse.core.runtime.CoreException;
|
|||
*
|
||||
* @author Doug Schaefer
|
||||
*/
|
||||
class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IIndexFragmentBinding {
|
||||
class PDOMCPPParameter extends PDOMNamedNode
|
||||
implements ICPPParameter, IIndexFragmentBinding, ICPPDelegateCreator {
|
||||
|
||||
/**
|
||||
* Offset of pointer to the next parameter (relative to the
|
||||
|
@ -233,4 +238,9 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IIndexFra
|
|||
public int getBindingConstant() {
|
||||
return getNodeType();
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPParameter.CPPParameterDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,10 +13,14 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -27,7 +31,8 @@ import org.eclipse.core.runtime.CoreException;
|
|||
/**
|
||||
* @author Doug Schaefer
|
||||
*/
|
||||
class PDOMCPPTypedef extends PDOMCPPBinding implements ITypedef, ITypeContainer, IIndexType {
|
||||
class PDOMCPPTypedef extends PDOMCPPBinding
|
||||
implements ITypedef, ITypeContainer, IIndexType, ICPPDelegateCreator {
|
||||
|
||||
private static final int TYPE = PDOMBinding.RECORD_SIZE + 0;
|
||||
|
||||
|
@ -88,4 +93,9 @@ class PDOMCPPTypedef extends PDOMCPPBinding implements ITypedef, ITypeContainer,
|
|||
public Object clone() {
|
||||
return new CPPTypedefClone(this);
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPTypedef.CPPTypedefDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,9 +15,13 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
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.ICPPVariable;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||
|
@ -29,7 +33,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @author Doug Schaefer
|
||||
*
|
||||
*/
|
||||
class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable {
|
||||
class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelegateCreator {
|
||||
|
||||
/**
|
||||
* Offset of pointer to type information for this parameter
|
||||
|
@ -110,4 +114,9 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable {
|
|||
public boolean isStatic() throws DOMException {
|
||||
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
|
||||
}
|
||||
|
||||
public ICPPDelegate createDelegate(IASTName name) {
|
||||
return new CPPVariable.CPPVariableDelegate(name, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue