diff options
author | Markus Schorn | 2008-01-31 17:28:39 +0000 |
---|---|---|
committer | Markus Schorn | 2008-01-31 17:28:39 +0000 |
commit | 01ed5f91334affa4fd5ed36fc64fb7ffca9474c1 (patch) | |
tree | 9a07129cc0a95a57f0c760e69dd43c01a37bcd58 /core/org.eclipse.cdt.core/parser/org | |
parent | 20a43f994bb740e2d78317de373a483bb19c1909 (diff) | |
download | org.eclipse.cdt-01ed5f91334affa4fd5ed36fc64fb7ffca9474c1.tar.gz org.eclipse.cdt-01ed5f91334affa4fd5ed36fc64fb7ffca9474c1.tar.xz org.eclipse.cdt-01ed5f91334affa4fd5ed36fc64fb7ffca9474c1.zip |
Removed dependency of CPPDelegate on IASTName, bug 217271.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org')
63 files changed, 302 insertions, 335 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java index 701fea215fd..3b462f0dd85 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.IField; import org.eclipse.cdt.core.dom.ast.IScope; @@ -28,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -167,8 +167,8 @@ public class CPPClassInstance extends CPPInstance implements ICPPClassType, ICPP /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassType.CPPClassTypeDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassType.CPPClassTypeDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java index 8d8889dd01f..428b3f3d86f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -9,9 +9,6 @@ * IBM - Initial API and implementation * Bryan Wilkinson (QNX) *******************************************************************************/ -/* - * Created on Apr 29, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -37,6 +34,7 @@ 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.dom.ast.cpp.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ObjectMap; @@ -247,8 +245,8 @@ public class CPPClassSpecialization extends CPPSpecialization implements /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassType.CPPClassTypeDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassType.CPPClassTypeDelegate( usingDecl, this ); } public Object clone() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java index 1adca731eeb..58c53135666 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -41,6 +41,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.internal.core.index.IIndexType; @@ -53,8 +54,8 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost { public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate implements ICPPClassTemplate, ICPPInternalClassTemplate { - public CPPClassTemplateDelegate( IASTName name, ICPPClassType cls ) { - super( name, cls ); + public CPPClassTemplateDelegate( ICPPUsingDeclaration usingDecl, ICPPClassType cls ) { + super( usingDecl, cls ); } public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() throws DOMException { return ((ICPPClassTemplate)getBinding()).getPartialSpecializations(); @@ -229,8 +230,8 @@ ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTempla return partialSpecializations; } - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPClassTemplateDelegate( name, this ); + public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) { + return new CPPClassTemplateDelegate( usingDecl, this ); } /* */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java index 07a6e3552a2..33aa975d2ab 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -44,6 +44,7 @@ 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.ICPPFunctionScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.CharArrayUtils; @@ -58,9 +59,9 @@ import org.eclipse.core.runtime.PlatformObject; * @author aniefer */ public class CPPClassType extends PlatformObject implements ICPPInternalClassTypeMixinHost, ICPPClassType, ICPPInternalClassType { - public static class CPPClassTypeDelegate extends CPPDelegate implements ICPPClassType, ICPPInternalClassType { - public CPPClassTypeDelegate( IASTName name, ICPPClassType cls ){ - super( name, cls ); + public static class CPPClassTypeDelegate extends CPPDelegate implements ICPPClassType { + public CPPClassTypeDelegate( ICPPUsingDeclaration usingDecl, ICPPClassType cls ){ + super( usingDecl, cls ); } public ICPPBase[] getBases() throws DOMException { return ((ICPPClassType)getBinding()).getBases(); @@ -95,14 +96,6 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp public IScope getCompositeScope() throws DOMException { return ((ICPPClassType)getBinding()).getCompositeScope(); } - public Object clone() { - CPPClassTypeDelegate d = null; - try { - d = (CPPClassTypeDelegate) super.clone(); - } catch ( CloneNotSupportedException e ) { - } - return d; - } public ICPPMethod[] getConversionOperators() throws DOMException { IBinding binding = getBinding(); if( binding instanceof ICPPInternalClassType ) @@ -411,8 +404,8 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp return true; } - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPClassTypeDelegate( name, this ); + public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) { + return new CPPClassTypeDelegate( usingDecl, this ); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java index a5914edf40e..39f85a9871e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -8,13 +8,9 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -/* - * Created on Apr 14, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.IField; import org.eclipse.cdt.core.dom.ast.IScope; @@ -28,6 +24,7 @@ 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.dom.ast.cpp.ICPPTemplateInstance; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; /** @@ -118,7 +115,7 @@ public class CPPDeferredClassInstance extends CPPInstance implements /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredFunctionInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredFunctionInstance.java index fc0cb416e00..4e5786420ee 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredFunctionInstance.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredFunctionInstance.java @@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; -import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IFunction; @@ -27,6 +26,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -171,7 +171,7 @@ public class CPPDeferredFunctionInstance extends CPPInstance implements ICPPFunc /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDelegate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDelegate.java index f324d6f7287..e1218f25e57 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDelegate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -7,21 +7,18 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ - -/* - * Created on Mar 17, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; 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.IScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.core.runtime.PlatformObject; @@ -29,30 +26,29 @@ import org.eclipse.core.runtime.PlatformObject; * @author aniefer */ public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInternalBinding { - private IBinding binding = null; - private int type = 0; - private IASTName name = null; + private final IBinding originalBinding; + private ICPPUsingDeclaration usingDeclaration; /** * */ - public CPPDelegate( IASTName name, IBinding binding ) { - this.binding = binding; - this.name = name; + public CPPDelegate(ICPPUsingDeclaration usingDecl, IBinding original ) { + this.originalBinding = original; + this.usingDeclaration = usingDecl; } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getDelegateType() */ public int getDelegateType() { - return type; + return USING_DECLARATION; } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding() */ public IBinding getBinding() { - return binding; + return originalBinding; } /* (non-Javadoc) @@ -86,75 +82,72 @@ public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInt * @see org.eclipse.cdt.core.dom.ast.IBinding#getName() */ public String getName() { - return name.toString(); + return usingDeclaration.getName(); } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray() */ public char[] getNameCharArray() { - return name.toCharArray(); + return usingDeclaration.getNameCharArray(); } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBinding#getScope() */ - public IScope getScope() { - return CPPVisitor.getContainingScope( name.getParent() ); + public IScope getScope() throws DOMException { + return usingDeclaration.getScope(); } /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations() */ public IASTNode[] getDeclarations() { - return null; + if (usingDeclaration instanceof ICPPInternalBinding) { + return ((ICPPInternalBinding) usingDeclaration).getDeclarations(); + } + return IASTNode.EMPTY_NODE_ARRAY; } /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDefinition() */ public IASTNode getDefinition() { - if( binding instanceof ICPPInternalBinding ) - return ((ICPPInternalBinding)binding).getDefinition(); - return name; - } - - public void setName( IASTName name ){ - this.name = name; + return null; } /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName n ) { - CPPDelegate delegate = null; - try { - delegate = (CPPDelegate) clone(); - } catch ( CloneNotSupportedException e ) { - } - - delegate.setName( n ); + public ICPPDelegate createDelegate( ICPPUsingDeclaration decl ) { + CPPDelegate delegate= (CPPDelegate) clone(); + delegate.usingDeclaration= decl; return delegate; } + @Override + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException e) { + // cannot be thrown because we implement Clonable + } + return null; + } + /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode) */ public void addDefinition(IASTNode node) { - // TODO Auto-generated method stub - } /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode) */ public void addDeclaration(IASTNode node) { - // TODO Auto-generated method stub - } public void removeDeclaration(IASTNode node) { - } public ILinkage getLinkage() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java index 83af1bedde0..8817af98a03 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -10,10 +10,6 @@ * Markus Schorn (Wind River Systems) * Sergey Prigogin (Google) *******************************************************************************/ - -/* - * Created on Dec 14, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -28,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.core.runtime.PlatformObject; @@ -37,23 +34,15 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPPInternalBinding { public static class CPPEnumerationDelegate extends CPPDelegate implements IEnumeration { - public CPPEnumerationDelegate( IASTName name, IEnumeration binding ) { + public CPPEnumerationDelegate( ICPPUsingDeclaration name, IEnumeration binding ) { super( name, binding ); } public IEnumerator[] getEnumerators() throws DOMException { return ((IEnumeration)getBinding()).getEnumerators(); } - public Object clone() { - try { - return super.clone(); - } catch ( CloneNotSupportedException e ) { - } - return null; - } public boolean isSameType( IType type ) { return ((IEnumeration)getBinding()).isSameType( type ); } - } private IASTName enumName; /** @@ -159,8 +148,8 @@ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPP /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPEnumerationDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPEnumerationDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java index 3923c386048..079ca28744b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -8,10 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - -/* - * Created on Dec 14, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -26,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.core.runtime.PlatformObject; @@ -34,7 +31,7 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPInternalBinding { public static class CPPEnumeratorDelegate extends CPPDelegate implements IEnumerator { - public CPPEnumeratorDelegate( IASTName name, IEnumerator binding ) { + public CPPEnumeratorDelegate( ICPPUsingDeclaration name, IEnumerator binding ) { super( name, binding ); } public IType getType() throws DOMException { @@ -134,8 +131,8 @@ public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPIn /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPEnumeratorDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPEnumeratorDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java index aaf84ac572a..77db76e8743 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java @@ -27,6 +27,7 @@ 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.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -35,7 +36,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; */ public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBinding { public static class CPPFieldDelegate extends CPPVariable.CPPVariableDelegate implements ICPPField { - public CPPFieldDelegate( IASTName name, ICPPField binding ) { + public CPPFieldDelegate( ICPPUsingDeclaration name, ICPPField binding ) { super( name, binding ); } public int getVisibility() throws DOMException { @@ -171,8 +172,8 @@ public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBind /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPFieldDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPFieldDelegate( usingDecl, this ); } public ICompositeType getCompositeTypeOwner() throws DOMException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java index a1a03f7c4c3..2cb2acb1767 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -9,13 +9,9 @@ * IBM - Initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Mar 29, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.ICompositeType; import org.eclipse.cdt.core.dom.ast.IType; @@ -23,6 +19,7 @@ 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.core.dom.ast.cpp.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField.CPPFieldDelegate; @@ -83,8 +80,8 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie return false; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFieldDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFieldDelegate( usingDecl, this ); } public ICompositeType getCompositeTypeOwner() throws DOMException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java index 5cac7796f5f..3c5bd9b3d14 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java @@ -36,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope; 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.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -49,8 +50,8 @@ import org.eclipse.core.runtime.PlatformObject; public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInternalFunction { public static class CPPFunctionDelegate extends CPPDelegate implements ICPPFunction, ICPPInternalFunction { - public CPPFunctionDelegate( IASTName name, ICPPFunction binding ) { - super( name, binding ); + public CPPFunctionDelegate( ICPPUsingDeclaration usingDecl, ICPPFunction binding ) { + super( usingDecl, binding ); } public IParameter[] getParameters() throws DOMException { @@ -94,7 +95,11 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt } } public IBinding resolveParameter( IASTParameterDeclaration param ) { - return ((ICPPInternalFunction)getBinding()).resolveParameter( param ); + final IBinding binding = getBinding(); + if (binding instanceof ICPPInternalFunction) { + return ((ICPPInternalFunction)binding).resolveParameter( param ); + } + return null; } } public static class CPPFunctionProblem extends ProblemBinding implements ICPPFunction { @@ -505,8 +510,8 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPFunctionDelegate( name, this ); + public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) { + return new CPPFunctionDelegate( usingDecl, this ); } static public boolean hasStorageClass( ICPPInternalFunction function, int storage){ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionInstance.java index ef0e8df5268..5a281f1d239 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionInstance.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionInstance.java @@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.parser.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.IASTParameterDeclaration; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IFunctionType; @@ -26,6 +25,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -48,8 +48,8 @@ public class CPPFunctionInstance extends CPPInstance implements ICPPFunction, IC /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunction.CPPFunctionDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunction.CPPFunctionDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java index 0271f3085f5..2cab96ea53d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java @@ -10,9 +10,6 @@ * Bryan Wilkinson (QNX) * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Apr 22, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -31,6 +28,7 @@ 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.ICPPParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.CPPFunctionDelegate; @@ -156,8 +154,8 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP return false; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunctionDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunctionDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java index 80e228c2bb0..3cdc08be3fb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java @@ -34,6 +34,7 @@ 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; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; /** @@ -94,7 +95,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu } } public static class CPPFunctionTemplateDelegate extends CPPFunction.CPPFunctionDelegate implements ICPPFunctionTemplate, ICPPInternalTemplate { - public CPPFunctionTemplateDelegate( IASTName name, ICPPFunction binding ) { + public CPPFunctionTemplateDelegate( ICPPUsingDeclaration name, ICPPFunction binding ) { super( name, binding ); } public ICPPTemplateParameter[] getTemplateParameters() throws DOMException { @@ -427,8 +428,8 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPFunctionTemplateDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPFunctionTemplateDelegate( usingDecl, this ); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplateSpecialization.java index e74fa878adc..ab098eba424 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplateSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplateSpecialization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -7,15 +7,10 @@ * * Contributors: * IBM - Initial API and implementation - * / *******************************************************************************/ -/* - * Created on Apr 29, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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; @@ -24,6 +19,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; /** @@ -44,7 +40,7 @@ public class CPPFunctionTemplateSpecialization extends CPPFunctionSpecialization return template.getTemplateParameters(); } - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitTypedef.java index 41b2a6a95e1..153bbae7ad6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitTypedef.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -11,12 +11,12 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.IScope; 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.core.dom.ast.cpp.ICPPUsingDeclaration; /** * The CPPImplicitTypedef is used to represent implicit typedefs that exist on the translation @@ -114,8 +114,8 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName aName) { - return new CPPTypedefDelegate( aName, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPTypedefDelegate( usingDecl, this ); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java index fb4851e07ac..3f2a4329aea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -9,10 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ - -/* - * Created on Jan 14, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -22,6 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.ILabel; import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.core.runtime.PlatformObject; @@ -122,7 +119,7 @@ public class CPPLabel extends PlatformObject implements ILabel, ICPPInternalBind /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java index 464097b1f28..bd19e8c85f5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java @@ -9,9 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Dec 1, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -33,6 +30,7 @@ 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.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -41,7 +39,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; */ public class CPPMethod extends CPPFunction implements ICPPMethod { public static class CPPMethodDelegate extends CPPFunction.CPPFunctionDelegate implements ICPPMethod { - public CPPMethodDelegate( IASTName name, ICPPMethod binding ) { + public CPPMethodDelegate( ICPPUsingDeclaration name, ICPPMethod binding ) { super( name, binding ); } public int getVisibility() throws DOMException { @@ -234,8 +232,8 @@ public class CPPMethod extends CPPFunction implements ICPPMethod { /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPMethodDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPMethodDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java index e01e4e4716c..ed8b625fa69 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -9,9 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Dec 1, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -36,6 +33,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration; 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.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.ObjectSet; @@ -49,7 +47,7 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPInternalBinding { public static class CPPNamespaceDelegate extends CPPDelegate implements ICPPNamespace { - public CPPNamespaceDelegate( IASTName name, ICPPNamespace binding ) { + public CPPNamespaceDelegate( ICPPUsingDeclaration name, ICPPNamespace binding ) { super( name, binding ); } public ICPPNamespaceScope getNamespaceScope() throws DOMException { @@ -305,8 +303,8 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPNamespaceDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPNamespaceDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java index 36c252f7811..0503a431c0e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -9,10 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ - -/* - * Created on Mar 15, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -26,6 +22,7 @@ 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.ICPPNamespaceAlias; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.core.runtime.PlatformObject; @@ -131,7 +128,7 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java index efebd2ccd73..6124835a080 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -9,9 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Dec 10, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -29,6 +26,7 @@ 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.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.parser.ASTNode; @@ -40,7 +38,7 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPInternalBinding { public static class CPPParameterDelegate extends CPPDelegate implements ICPPParameter { - public CPPParameterDelegate( IASTName name, IParameter binding ) { + public CPPParameterDelegate( ICPPUsingDeclaration name, IParameter binding ) { super( name, binding ); } public IType getType() throws DOMException { @@ -245,8 +243,8 @@ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPI /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPParameterDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPParameterDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java index 2d1857ce83b..3495ddb9f48 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -9,17 +9,14 @@ * IBM - Initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Mar 29, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.ICPPParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter.CPPParameterDelegate; @@ -91,8 +88,8 @@ public class CPPParameterSpecialization extends CPPSpecialization implements ICP return getParameter().hasDefaultValue(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPParameterDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPParameterDelegate( usingDecl, this ); } public boolean isExternC() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java index 61460755594..15317c45185 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java @@ -110,6 +110,9 @@ abstract public class CPPScope implements ICPPScope, IASTInternalScope { bindings= fileSet.filterFileLocalBindings(bindings); } binding= CPPSemantics.resolveAmbiguities(name, bindings); + if( binding instanceof ICPPUsingDeclaration ){ + binding= CPPSemantics.resolveAmbiguities( name, ((ICPPUsingDeclaration)binding).getDelegates() ); + } } catch (CoreException e) { CCorePlugin.log(e); } @@ -126,6 +129,9 @@ abstract public class CPPScope implements ICPPScope, IASTInternalScope { bindings= fileSet.filterFileLocalBindings(bindings); } binding= CPPSemantics.resolveAmbiguities(name, bindings); + if( binding instanceof ICPPUsingDeclaration ){ + binding= CPPSemantics.resolveAmbiguities( name, ((ICPPUsingDeclaration)binding).getDelegates() ); + } } } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java index afce7934644..83d15c99eb7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java @@ -2146,6 +2146,9 @@ public class CPPSemantics { if (binding instanceof ICPPSpecialization) { return ((ICPPSpecialization) binding).getSpecializedBinding() instanceof IIndexBinding; } + if (binding instanceof ICPPDelegate) { + return ((ICPPDelegate) binding).getBinding() instanceof IIndexBinding; + } return false; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java index 9d5c18c26a2..7f2957b4894 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -8,9 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -/* - * Created on Apr 13, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -23,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode; 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.ICPPTemplateNonTypeParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; /** * @author aniefer @@ -99,7 +97,7 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java index 5278813247a..9b74b97c1bd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -9,9 +9,6 @@ * IBM - Initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Mar 11, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -21,6 +18,7 @@ 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.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.parser.ASTNode; @@ -111,7 +109,7 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java index 161d4003f84..27662ebec04 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation 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 @@ -8,9 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -/* - * Created on Apr 13, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -36,6 +33,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ObjectMap; @@ -221,7 +219,7 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate(IASTName name) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { // TODO Auto-generated method stub return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java index 9d23bd4b01f..1d0cdf4632b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -9,9 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ -/* - * Created on Dec 11, 2004 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -24,6 +21,7 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.parser.ASTNode; @@ -35,19 +33,12 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding { public static class CPPTypedefDelegate extends CPPDelegate implements ITypedef, ITypeContainer { - public CPPTypedefDelegate( IASTName name, ITypedef binding ) { + public CPPTypedefDelegate( ICPPUsingDeclaration name, ITypedef binding ) { super( name, binding ); } public IType getType() throws DOMException { return ((ITypedef)getBinding()).getType(); } - public Object clone() { - try { - return super.clone(); - } catch ( CloneNotSupportedException e ) { - } - return null; - } public boolean isSameType( IType type ) { return ((ITypedef)getBinding()).isSameType( type ); } @@ -174,8 +165,8 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPTypedefDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPTypedefDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedefSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedefSpecialization.java index 0c03cd5f831..be567c99a5a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedefSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedefSpecialization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -8,19 +8,15 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - -/* - * Created on May 3, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.ITypedef; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef.CPPTypedefDelegate; @@ -97,8 +93,8 @@ public class CPPTypedefSpecialization extends CPPSpecialization implements /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPTypedefDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPTypedefDelegate( usingDecl, this ); } public void setType(IType type) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java index ef0d4bcc4fa..a9811f78daa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -9,10 +9,6 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) *******************************************************************************/ - -/* - * Created on May 3, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.ILinkage; @@ -25,6 +21,7 @@ import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; @@ -75,7 +72,7 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name1 ) { + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl1 ) { return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java index 5c813d6fa95..84e2abcc3c2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation 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 @@ -50,7 +50,7 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl ICPPDelegate [] result = null; for( int i = 0; i < bindings.length; i++ ){ if( bindings[i] instanceof ICPPDelegateCreator){ - ICPPDelegate delegate = ((ICPPDelegateCreator)bindings[i]).createDelegate( name ); + ICPPDelegate delegate = ((ICPPDelegateCreator)bindings[i]).createDelegate( this ); result = (ICPPDelegate[]) ArrayUtil.append( ICPPDelegate.class, result, delegate ); } } @@ -133,7 +133,7 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name1 ) { + public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) { return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java index fbe1c9d0513..17d83ab9f61 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java @@ -26,6 +26,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.Linkage; @@ -38,7 +39,7 @@ import org.eclipse.core.runtime.PlatformObject; */ public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInternalVariable { public static class CPPVariableDelegate extends CPPDelegate implements ICPPVariable { - public CPPVariableDelegate( IASTName name, ICPPVariable binding ) { + public CPPVariableDelegate( ICPPUsingDeclaration name, ICPPVariable binding ) { super( name, binding ); } public IType getType() throws DOMException { @@ -287,8 +288,8 @@ public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInt /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) */ - public ICPPDelegate createDelegate( IASTName name ) { - return new CPPVariableDelegate( name, this ); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) { + return new CPPVariableDelegate( usingDecl, this ); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPDelegateCreator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPDelegateCreator.java index 39d37233399..c681144d6f7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPDelegateCreator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPDelegateCreator.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2007 QNX Software Systems and others. + * Copyright (c) 2007, 2008 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 @@ -7,12 +7,13 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Markus Schorn (Wind River Systems) **********************************************************************/ 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; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; /** * @author Doug Schaefer @@ -20,6 +21,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; */ public interface ICPPDelegateCreator { - ICPPDelegate createDelegate( IASTName name ); - + /** + * Creates a delegate binding for the using declaration provided. + * @param usingDecl + */ + ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java index 3f87cc2ba17..87efb08503c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java @@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPCompositeBinding; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUsingDeclaration; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.IIndexScope; @@ -81,6 +82,8 @@ public abstract class CompositeScope implements IIndexScope { return new CPPCompositeBinding( processUncertainBindings(((CPPCompositeBinding)binding).getBindings()) ); + } else if(binding instanceof CPPUsingDeclaration) { + return binding; } else if(binding == null) { return null; } else if(binding instanceof ICPPSpecialization) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java index 30e16f49fee..d57a42ceaeb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.index.composite.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.IBinding; import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IType; @@ -23,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates; @@ -92,7 +92,7 @@ ICPPClassTemplate, ICPPDelegateCreator, ICPPInternalTemplateInstantiator { return CPPTemplates.instantiateTemplate(this, arguments, null); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java index c605d1b6580..400fc752c6f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.IName; 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.IField; import org.eclipse.cdt.core.dom.ast.IScope; @@ -23,6 +22,7 @@ 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.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate; @@ -177,7 +177,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType return ((ICPPClassType)rbinding).isSameType(type); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassTypeDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassTypeDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java index df4e8f3acc4..912c9a3f907 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumeration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,12 +11,12 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.cpp.ICPPBinding; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; 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.IIndexFragmentBinding; @@ -41,7 +41,7 @@ class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeratio public Object clone() { fail(); return null; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPEnumerationDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPEnumerationDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java index 751071ee625..cc8da5cef26 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,11 +11,11 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexType; @@ -31,7 +31,7 @@ class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator, return cf.getCompositeType((IIndexType)type); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPEnumerator.CPPEnumeratorDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java index 8e9e4e60750..94655786799 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,13 +11,13 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.ICompositeType; import org.eclipse.cdt.core.dom.ast.IField; 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.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexFragmentBinding; @@ -42,7 +42,7 @@ class CompositeCPPField extends CompositeCPPVariable implements ICPPField, ICPPD return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPField.CPPFieldDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPField.CPPFieldDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java index a8030892042..b91005ad141 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -13,13 +13,13 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.ICPPUsingDeclaration; 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.IIndexFragmentBinding; @@ -95,7 +95,7 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction, return result.toString(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunction.CPPFunctionDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunction.CPPFunctionDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java index a3046cde08b..84cb387d75f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionTemplate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,7 +11,6 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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; @@ -19,6 +18,7 @@ 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; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator; @@ -51,7 +51,7 @@ public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implement return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java index 2e76ccf5fdd..9ea52a08282 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,11 +11,11 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; import org.eclipse.cdt.core.dom.ast.DOMException; -import org.eclipse.cdt.core.dom.ast.IASTName; 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.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexFragmentBinding; @@ -48,7 +48,7 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod, ICP return ((ICPPMethod)rbinding).getVisibility(); } - public final ICPPDelegate createDelegate(IASTName name) { - return new CPPMethod.CPPMethodDelegate(name, this); + public final ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPMethod.CPPMethodDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java index c93a83e9184..da34359a08b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 Symbian Software Systems and others. + * Copyright (c) 2006, 2008 Symbian 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 @@ -11,11 +11,11 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.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.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNamespace; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; @@ -42,7 +42,7 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace return new CompositeCPPNamespaceScope(cf, namespaces); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPNamespace.CPPNamespaceDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java index 41871dd9081..e1b61d28ea1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -36,6 +36,6 @@ class CompositeCPPNamespaceAlias extends CompositeCPPBinding implements ICPPName } public int getDelegateType() { - fail(); return 0; + return NAMESPACE_ALIAS; } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java index c5b4edb93f4..49e60103a92 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -10,9 +10,9 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.index.composite.cpp; -import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; @@ -27,7 +27,7 @@ class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParamete return ((ICPPParameter)rbinding).hasDefaultValue(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPParameter.CPPParameterDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPParameter.CPPParameterDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java index 99978e20ff1..fb67c94c5a2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedef.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -11,11 +11,11 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.ICPPBinding; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.CPPTypedefClone; @@ -44,7 +44,7 @@ class CompositeCPPTypedef extends CompositeCPPBinding implements ITypedef, IInde return new CPPTypedefClone(this); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPTypedef.CPPTypedefDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPTypedef.CPPTypedefDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUsingDeclaration.java index 2668da9b57f..1186af675fe 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUsingDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUsingDeclaration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Google, Inc and others. + * Copyright (c) 2007, 2008 Google, Inc 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 @@ -15,7 +15,6 @@ 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.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; -import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; @@ -38,7 +37,7 @@ class CompositeCPPUsingDeclaration extends CompositeCPPBinding implements ICPPUs if (binding instanceof IIndexFragmentBinding) { binding = cf.getCompositeBinding((IIndexFragmentBinding) binding); if (binding instanceof ICPPDelegateCreator) { - composites[j++] = ((ICPPDelegateCreator) binding).createDelegate(new CPPASTName(getNameCharArray())); + composites[j++] = ((ICPPDelegateCreator) binding).createDelegate(this); } } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java index c75d5cc16ee..047249d10f0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian 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 @@ -12,9 +12,9 @@ package org.eclipse.cdt.internal.core.index.composite.cpp; 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.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; @@ -56,7 +56,7 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable, return ((ICPPVariable)rbinding).isStatic(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPVariable.CPPVariableDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPVariable.CPPVariableDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java index 8a695b9533a..c76f8c16980 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java @@ -36,6 +36,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.ICPPTemplateScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IndexFilter; @@ -421,7 +422,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType return false; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java index e39af889777..404a1d9d0ae 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java @@ -39,6 +39,7 @@ 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.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IndexFilter; @@ -432,8 +433,8 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType, return this; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPClassTypeDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPClassTypeDelegate(usingDecl, this); } public String toString() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java index fa2af9817fb..753210178e0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 QNX Software Systems and others. + * Copyright (c) 2006, 2008 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 @@ -16,13 +16,13 @@ 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.core.dom.ast.cpp.ICPPUsingDeclaration; 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.IIndexCPPBindingConstants; @@ -42,6 +42,7 @@ class PDOMCPPEnumeration extends PDOMCPPBinding private static final int FIRST_ENUMERATOR = PDOMBinding.RECORD_SIZE + 0; + @SuppressWarnings("hiding") protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4; public PDOMCPPEnumeration(PDOM pdom, PDOMNode parent, IEnumeration enumeration) @@ -63,14 +64,14 @@ class PDOMCPPEnumeration extends PDOMCPPBinding public IEnumerator[] getEnumerators() throws DOMException { try { - ArrayList enums = new ArrayList(); + ArrayList<PDOMCPPEnumerator> enums = new ArrayList<PDOMCPPEnumerator>(); for (PDOMCPPEnumerator enumerator = getFirstEnumerator(); enumerator != null; enumerator = enumerator.getNextEnumerator()) { enums.add(enumerator); } - IEnumerator[] enumerators = (IEnumerator[])enums.toArray(new IEnumerator[enums.size()]); + IEnumerator[] enumerators = enums.toArray(new IEnumerator[enums.size()]); // Reverse the list since they are last in first out int n = enumerators.length; @@ -134,8 +135,8 @@ class PDOMCPPEnumeration extends PDOMCPPBinding throw new PDOMNotImplementedError(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPEnumerationDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPEnumerationDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumerator.java index 8493d232344..9fd15bfabc4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 QNX Software Systems and others. + * Copyright (c) 2006, 2008 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 @@ -13,13 +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.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.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexCPPBindingConstants; 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; @@ -34,6 +35,7 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi private static final int ENUMERATION = PDOMBinding.RECORD_SIZE + 0; private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4; + @SuppressWarnings("hiding") protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 8; public PDOMCPPEnumerator(PDOM pdom, PDOMNode parent, IEnumerator enumerator, PDOMCPPEnumeration enumeration) @@ -52,7 +54,7 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi } public int getNodeType() { - return PDOMCPPLinkage.CPPENUMERATOR; + return IIndexCPPBindingConstants.CPPENUMERATOR; } public PDOMCPPEnumerator getNextEnumerator() throws CoreException { @@ -74,8 +76,8 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi } } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPEnumerator.CPPEnumeratorDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPField.java index 86ea79ad3ff..f5506764e86 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 QNX Software Systems and others. + * Copyright (c) 2005, 2008 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 @@ -14,13 +14,14 @@ 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.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexCPPBindingConstants; import org.eclipse.cdt.internal.core.pdom.PDOM; import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; import org.eclipse.core.runtime.CoreException; @@ -47,7 +48,7 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre // @Override public int getNodeType() { - return PDOMCPPLinkage.CPPFIELD; + return IIndexCPPBindingConstants.CPPFIELD; } public ICPPClassType getClassOwner() { @@ -95,8 +96,8 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre return getClassOwner(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPField.CPPFieldDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPField.CPPFieldDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java index 010a7e07776..99f063f23e4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 QNX Software Systems and others. + * Copyright (c) 2005, 2008 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 @@ -16,7 +16,6 @@ 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.IBinding; import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IFunctionType; @@ -26,9 +25,11 @@ 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.dom.ast.cpp.ICPPUsingDeclaration; 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.IIndexCPPBindingConstants; 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; @@ -50,34 +51,40 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl * Offset of total number of function parameters (relative to the * beginning of the record). */ + @SuppressWarnings("static-access") private static final int NUM_PARAMS = PDOMCPPBinding.RECORD_SIZE + 0; /** * Offset of pointer to the first parameter of this function (relative to * the beginning of the record). */ + @SuppressWarnings("static-access") private static final int FIRST_PARAM = PDOMCPPBinding.RECORD_SIZE + 4; /** * Offset of pointer to the function type record of this function (relative to * the beginning of the record). */ + @SuppressWarnings("static-access") protected static final int FUNCTION_TYPE= PDOMCPPBinding.RECORD_SIZE + 8; /** * Offset of hash of parameter information to allow fast comparison */ + @SuppressWarnings("static-access") private static final int SIGNATURE_MEMENTO = PDOMCPPBinding.RECORD_SIZE + 12; /** * Offset of annotation information (relative to the beginning of the * record). */ + @SuppressWarnings("static-access") protected static final int ANNOTATION = PDOMCPPBinding.RECORD_SIZE + 16; // byte /** * The size in bytes of a PDOMCPPFunction record in the database. */ + @SuppressWarnings({ "static-access", "hiding" }) protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 17; public PDOMCPPFunction(PDOM pdom, PDOMNode parent, ICPPFunction function, boolean setTypes) throws CoreException { @@ -162,7 +169,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl } public int getNodeType() { - return PDOMCPPLinkage.CPPFUNCTION; + return IIndexCPPBindingConstants.CPPFUNCTION; } public PDOMCPPParameter getFirstParameter() throws CoreException { @@ -277,8 +284,8 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl return 0; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunction.CPPFunctionDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunction.CPPFunctionDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionTemplate.java index 79df5d4562d..cfa16346f5a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionTemplate.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionTemplate.java @@ -29,6 +29,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.ICPPTemplateScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.parser.util.ArrayUtil; @@ -234,8 +235,8 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements return this; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java index 5dcf6a6c634..5806c5290f7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 QNX Software Systems and others. + * Copyright (c) 2006, 2008 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 @@ -28,9 +28,11 @@ 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.core.dom.ast.cpp.ICPPReferenceType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexCPPBindingConstants; 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.PDOMLinkage; @@ -55,6 +57,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC /** * The size in bytes of a PDOMCPPMethod record in the database. */ + @SuppressWarnings("hiding") protected static final int RECORD_SIZE = PDOMCPPFunction.RECORD_SIZE + 1; /** @@ -96,7 +99,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC } public int getNodeType() { - return PDOMCPPLinkage.CPPMETHOD; + return IIndexCPPBindingConstants.CPPMETHOD; } public boolean isVirtual() throws DOMException { @@ -163,8 +166,8 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC return getBit(getByte(record + ANNOTATION1), PDOMCAnnotation.VOLATILE_OFFSET + CV_OFFSET); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPMethod.CPPMethodDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPMethod.CPPMethodDelegate(usingDecl, this); } public int getAdditionalNameFlags(int standardFlags, IASTName name) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java index 7f57d060e95..eb00dedbdfd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java @@ -26,6 +26,7 @@ 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.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IndexFilter; @@ -200,8 +201,8 @@ class PDOMCPPNamespace extends PDOMCPPBinding return this; } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPNamespace.CPPNamespaceDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java index 1522e89dbfe..50cd4cdc876 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java @@ -1,13 +1,13 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 QNX Software Systems and others. + * Copyright (c) 2006, 2008 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 - Initial API and implementation - * Markus Schorn (Wind River Systems) + * QNX - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.dom.cpp; @@ -29,10 +29,11 @@ import org.eclipse.core.runtime.CoreException; * @author Doug Schaefer * */ -class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements - ICPPNamespaceAlias { +class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias { + @SuppressWarnings("static-access") private static final int NAMESPACE_BINDING = PDOMCPPBinding.RECORD_SIZE + 0; + @SuppressWarnings({ "hiding", "static-access" }) protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 4; public PDOMCPPNamespaceAlias(PDOM pdom, PDOMNode parent, ICPPNamespaceAlias alias) @@ -95,7 +96,7 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements } public int getDelegateType() { - throw new PDOMNotImplementedError(); + return NAMESPACE_ALIAS; } public IBinding getBinding() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java index 269b8e17f51..8cc7ec5187a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java @@ -15,12 +15,12 @@ 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.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.index.IIndexFile; import org.eclipse.cdt.internal.core.Util; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; @@ -244,8 +244,8 @@ class PDOMCPPParameter extends PDOMNamedNode return getNodeType(); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPParameter.CPPParameterDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPParameter.CPPParameterDelegate(usingDecl, this); } public void delete(PDOMLinkage linkage) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTypedef.java index dd9db020887..20d155a996f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTypedef.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 QNX Software Systems and others. + * Copyright (c) 2006, 2008 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 @@ -13,12 +13,12 @@ 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.IBinding; import org.eclipse.cdt.core.dom.ast.IFunctionType; 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.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.internal.core.Util; import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; @@ -41,6 +41,7 @@ class PDOMCPPTypedef extends PDOMCPPBinding private static final int TYPE = PDOMBinding.RECORD_SIZE + 0; + @SuppressWarnings("hiding") protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4; public PDOMCPPTypedef(PDOM pdom, PDOMNode parent, ITypedef typedef) @@ -155,8 +156,8 @@ class PDOMCPPTypedef extends PDOMCPPBinding return new CPPTypedefClone(this); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPTypedef.CPPTypedefDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPTypedef.CPPTypedefDelegate(usingDecl, this); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclaration.java index dd3f05e4eed..b94c8be5564 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDeclaration.java @@ -16,7 +16,6 @@ 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.ICPPUsingDeclaration; import org.eclipse.cdt.core.parser.util.ArrayUtil; -import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants; import org.eclipse.cdt.internal.core.pdom.PDOM; @@ -93,8 +92,8 @@ class PDOMCPPUsingDeclaration extends PDOMCPPBinding implements ICPPUsingDeclara do { IBinding binding = alias.getBinding(); if (binding instanceof ICPPDelegateCreator) { - ICPPDelegate delegate = ((ICPPDelegateCreator) binding).createDelegate(new CPPASTName(getNameCharArray())); - ArrayUtil.append(ICPPDelegate.class, delegates, i++, delegate); + ICPPDelegate delegate = ((ICPPDelegateCreator) binding).createDelegate(this); + delegates= (ICPPDelegate[]) ArrayUtil.append(ICPPDelegate.class, delegates, i++, delegate); } } while ((alias = alias.getNext()) != null); } catch (CoreException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPVariable.java index 8265eda8cd8..64970fc0bb5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPVariable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 QNX Software Systems and others. + * Copyright (c) 2005, 2008 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 @@ -20,10 +20,12 @@ import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; 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.index.IIndexCPPBindingConstants; 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; @@ -54,6 +56,7 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega /** * The size in bytes of a PDOMCPPVariable record in the database. */ + @SuppressWarnings("hiding") protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 5; public PDOMCPPVariable(PDOM pdom, PDOMNode parent, ICPPVariable variable) throws CoreException { @@ -105,7 +108,7 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega } public int getNodeType() { - return PDOMCPPLinkage.CPPVARIABLE; + return IIndexCPPBindingConstants.CPPVARIABLE; } public boolean isMutable() throws DOMException { @@ -143,8 +146,8 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET); } - public ICPPDelegate createDelegate(IASTName name) { - return new CPPVariable.CPPVariableDelegate(name, this); + public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) { + return new CPPVariable.CPPVariableDelegate(usingDecl, this); } public int getAdditionalNameFlags(int standardFlags, IASTName name) { |