1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Removed dependency of CPPDelegate on IASTName, bug 217271.

This commit is contained in:
Markus Schorn 2008-01-31 17:28:39 +00:00
parent 20a43f994b
commit 01ed5f9133
64 changed files with 359 additions and 335 deletions

View file

@ -163,6 +163,63 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
IBinding b1= getBindingFromASTName("B bb", 1); IBinding b1= getBindingFromASTName("B bb", 1);
} }
// namespace header {
// class clh {
// };
// void fh();
// void fh(int a);
//
// class cl {
// };
// void f();
// void f(int a);
// }
// using header::clh;
// using header::fh;
// #include "header.h"
// namespace source {
// class cls {
// };
// void fs();
// void fs(int a);
//
// }
// using header::cl;
// using header::f;
//
//
// using source::cls;
// using source::fs;
//
// void test() {
// fh();
// fh(1);
//
// clh c;
//
// f();
// f(1);
// cl c1;
//
// fs();
// fs(1);
// cls c2;
// }
public void testUsingOverloadedFunctionDirective() {
IBinding b;
b= getBindingFromASTName("fh()", 2);
b= getBindingFromASTName("fh(1)", 2);
b= getBindingFromASTName("clh c", 3);
b= getBindingFromASTName("f()", 1);
b= getBindingFromASTName("f(1)", 1);
b= getBindingFromASTName("cl c1", 2);
b= getBindingFromASTName("fs()", 2);
b= getBindingFromASTName("fs(1)", 2);
b= getBindingFromASTName("cls c2", 3);
}
// int (*f)(int); // int (*f)(int);
// int g(int n){return n;} // int g(int n){return n;}
// int g(int n, int m){ return n+m; } // int g(int n, int m){ return n+m; }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope; 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.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; 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.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.ArrayUtil;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@ -167,8 +167,8 @@ public class CPPClassInstance extends CPPInstance implements ICPPClassType, ICPP
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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) {
return new CPPClassType.CPPClassTypeDelegate( name, this ); return new CPPClassType.CPPClassTypeDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,9 +9,6 @@
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Bryan Wilkinson (QNX) * Bryan Wilkinson (QNX)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 29, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; 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.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.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
@ -247,8 +245,8 @@ public class CPPClassSpecialization extends CPPSpecialization implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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) {
return new CPPClassType.CPPClassTypeDelegate( name, this ); return new CPPClassType.CPPClassTypeDelegate( usingDecl, this );
} }
public Object clone() { public Object clone() {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; 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.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.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.IIndexType;
@ -53,8 +54,8 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost { ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost {
public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate implements ICPPClassTemplate, ICPPInternalClassTemplate { public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate implements ICPPClassTemplate, ICPPInternalClassTemplate {
public CPPClassTemplateDelegate( IASTName name, ICPPClassType cls ) { public CPPClassTemplateDelegate( ICPPUsingDeclaration usingDecl, ICPPClassType cls ) {
super( name, cls ); super( usingDecl, cls );
} }
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() throws DOMException { public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() throws DOMException {
return ((ICPPClassTemplate)getBinding()).getPartialSpecializations(); return ((ICPPClassTemplate)getBinding()).getPartialSpecializations();
@ -229,8 +230,8 @@ ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTempla
return partialSpecializations; return partialSpecializations;
} }
public ICPPDelegate createDelegate( IASTName name ) { public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) {
return new CPPClassTemplateDelegate( name, this ); return new CPPClassTemplateDelegate( usingDecl, this );
} }
/* */ /* */

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope; 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.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.CharArrayUtils;
@ -58,9 +59,9 @@ import org.eclipse.core.runtime.PlatformObject;
* @author aniefer * @author aniefer
*/ */
public class CPPClassType extends PlatformObject implements ICPPInternalClassTypeMixinHost, ICPPClassType, ICPPInternalClassType { public class CPPClassType extends PlatformObject implements ICPPInternalClassTypeMixinHost, ICPPClassType, ICPPInternalClassType {
public static class CPPClassTypeDelegate extends CPPDelegate implements ICPPClassType, ICPPInternalClassType { public static class CPPClassTypeDelegate extends CPPDelegate implements ICPPClassType {
public CPPClassTypeDelegate( IASTName name, ICPPClassType cls ){ public CPPClassTypeDelegate( ICPPUsingDeclaration usingDecl, ICPPClassType cls ){
super( name, cls ); super( usingDecl, cls );
} }
public ICPPBase[] getBases() throws DOMException { public ICPPBase[] getBases() throws DOMException {
return ((ICPPClassType)getBinding()).getBases(); return ((ICPPClassType)getBinding()).getBases();
@ -95,14 +96,6 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
public IScope getCompositeScope() throws DOMException { public IScope getCompositeScope() throws DOMException {
return ((ICPPClassType)getBinding()).getCompositeScope(); 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 { public ICPPMethod[] getConversionOperators() throws DOMException {
IBinding binding = getBinding(); IBinding binding = getBinding();
if( binding instanceof ICPPInternalClassType ) if( binding instanceof ICPPInternalClassType )
@ -411,8 +404,8 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
return true; return true;
} }
public ICPPDelegate createDelegate( IASTName name ) { public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) {
return new CPPClassTypeDelegate( name, this ); return new CPPClassTypeDelegate( usingDecl, this );
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,13 +8,9 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 14, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope; 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.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; 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.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
/** /**
@ -118,7 +115,7 @@ public class CPPDeferredClassInstance extends CPPInstance implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunction; 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.ICPPParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; 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.ICPPTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@ -171,7 +171,7 @@ public class CPPDeferredFunctionInstance extends CPPInstance implements ICPPFunc
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,21 +7,18 @@
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * 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; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope; 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.ICPPBlockScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.dom.Linkage;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
@ -29,30 +26,29 @@ import org.eclipse.core.runtime.PlatformObject;
* @author aniefer * @author aniefer
*/ */
public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInternalBinding { public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInternalBinding {
private IBinding binding = null; private final IBinding originalBinding;
private int type = 0; private ICPPUsingDeclaration usingDeclaration;
private IASTName name = null;
/** /**
* *
*/ */
public CPPDelegate( IASTName name, IBinding binding ) { public CPPDelegate(ICPPUsingDeclaration usingDecl, IBinding original ) {
this.binding = binding; this.originalBinding = original;
this.name = name; this.usingDeclaration = usingDecl;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getDelegateType() * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getDelegateType()
*/ */
public int getDelegateType() { public int getDelegateType() {
return type; return USING_DECLARATION;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding() * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding()
*/ */
public IBinding getBinding() { public IBinding getBinding() {
return binding; return originalBinding;
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -86,75 +82,72 @@ public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInt
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName() * @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
*/ */
public String getName() { public String getName() {
return name.toString(); return usingDeclaration.getName();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray() * @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
*/ */
public char[] getNameCharArray() { public char[] getNameCharArray() {
return name.toCharArray(); return usingDeclaration.getNameCharArray();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope() * @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
*/ */
public IScope getScope() { public IScope getScope() throws DOMException {
return CPPVisitor.getContainingScope( name.getParent() ); return usingDeclaration.getScope();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations() * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations()
*/ */
public IASTNode[] getDeclarations() { public IASTNode[] getDeclarations() {
return null; if (usingDeclaration instanceof ICPPInternalBinding) {
return ((ICPPInternalBinding) usingDeclaration).getDeclarations();
}
return IASTNode.EMPTY_NODE_ARRAY;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDefinition() * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDefinition()
*/ */
public IASTNode getDefinition() { public IASTNode getDefinition() {
if( binding instanceof ICPPInternalBinding ) return null;
return ((ICPPInternalBinding)binding).getDefinition();
return name;
}
public void setName( IASTName name ){
this.name = name;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
*/ */
public ICPPDelegate createDelegate( IASTName n ) { public ICPPDelegate createDelegate( ICPPUsingDeclaration decl ) {
CPPDelegate delegate = null; CPPDelegate delegate= (CPPDelegate) clone();
try { delegate.usingDeclaration= decl;
delegate = (CPPDelegate) clone();
} catch ( CloneNotSupportedException e ) {
}
delegate.setName( n );
return delegate; return delegate;
} }
@Override
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// cannot be thrown because we implement Clonable
}
return null;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
*/ */
public void addDefinition(IASTNode node) { public void addDefinition(IASTNode node) {
// TODO Auto-generated method stub
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
*/ */
public void addDeclaration(IASTNode node) { public void addDeclaration(IASTNode node) {
// TODO Auto-generated method stub
} }
public void removeDeclaration(IASTNode node) { public void removeDeclaration(IASTNode node) {
} }
public ILinkage getLinkage() { public ILinkage getLinkage() {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -10,10 +10,6 @@
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 14, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.IIndexType;
import org.eclipse.core.runtime.PlatformObject; 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 class CPPEnumeration extends PlatformObject implements IEnumeration, ICPPInternalBinding {
public static class CPPEnumerationDelegate extends CPPDelegate implements IEnumeration { public static class CPPEnumerationDelegate extends CPPDelegate implements IEnumeration {
public CPPEnumerationDelegate( IASTName name, IEnumeration binding ) { public CPPEnumerationDelegate( ICPPUsingDeclaration name, IEnumeration binding ) {
super( name, binding ); super( name, binding );
} }
public IEnumerator[] getEnumerators() throws DOMException { public IEnumerator[] getEnumerators() throws DOMException {
return ((IEnumeration)getBinding()).getEnumerators(); return ((IEnumeration)getBinding()).getEnumerators();
} }
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
}
return null;
}
public boolean isSameType( IType type ) { public boolean isSameType( IType type ) {
return ((IEnumeration)getBinding()).isSameType( type ); return ((IEnumeration)getBinding()).isSameType( type );
} }
} }
private IASTName enumName; private IASTName enumName;
/** /**
@ -159,8 +148,8 @@ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPP
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPEnumerationDelegate( name, this ); return new CPPEnumerationDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,10 +8,6 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 14, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.IASTEnumerationSpecifier.IASTEnumerator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.core.runtime.PlatformObject; 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 class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPInternalBinding {
public static class CPPEnumeratorDelegate extends CPPDelegate implements IEnumerator { public static class CPPEnumeratorDelegate extends CPPDelegate implements IEnumerator {
public CPPEnumeratorDelegate( IASTName name, IEnumerator binding ) { public CPPEnumeratorDelegate( ICPPUsingDeclaration name, IEnumerator binding ) {
super( name, binding ); super( name, binding );
} }
public IType getType() throws DOMException { public IType getType() throws DOMException {
@ -134,8 +131,8 @@ public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPIn
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPEnumeratorDelegate( name, this ); return new CPPEnumeratorDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; 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 class CPPField extends CPPVariable implements ICPPField, ICPPInternalBinding {
public static class CPPFieldDelegate extends CPPVariable.CPPVariableDelegate implements ICPPField { public static class CPPFieldDelegate extends CPPVariable.CPPVariableDelegate implements ICPPField {
public CPPFieldDelegate( IASTName name, ICPPField binding ) { public CPPFieldDelegate( ICPPUsingDeclaration name, ICPPField binding ) {
super( name, binding ); super( name, binding );
} }
public int getVisibility() throws DOMException { public int getVisibility() throws DOMException {
@ -171,8 +172,8 @@ public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBind
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPFieldDelegate( name, this ); return new CPPFieldDelegate( usingDecl, this );
} }
public ICompositeType getCompositeTypeOwner() throws DOMException { public ICompositeType getCompositeTypeOwner() throws DOMException {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,13 +9,9 @@
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Mar 29, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; 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.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField.CPPFieldDelegate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField.CPPFieldDelegate;
@ -83,8 +80,8 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
return false; return false;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFieldDelegate( name, this ); return new CPPFieldDelegate( usingDecl, this );
} }
public ICompositeType getCompositeTypeOwner() throws DOMException { public ICompositeType getCompositeTypeOwner() throws DOMException {

View file

@ -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.ICPPClassScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; 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 class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInternalFunction {
public static class CPPFunctionDelegate extends CPPDelegate implements ICPPFunction, ICPPInternalFunction { public static class CPPFunctionDelegate extends CPPDelegate implements ICPPFunction, ICPPInternalFunction {
public CPPFunctionDelegate( IASTName name, ICPPFunction binding ) { public CPPFunctionDelegate( ICPPUsingDeclaration usingDecl, ICPPFunction binding ) {
super( name, binding ); super( usingDecl, binding );
} }
public IParameter[] getParameters() throws DOMException { public IParameter[] getParameters() throws DOMException {
@ -94,7 +95,11 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
} }
} }
public IBinding resolveParameter( IASTParameterDeclaration param ) { 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 { public static class CPPFunctionProblem extends ProblemBinding implements ICPPFunction {
@ -505,8 +510,8 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPFunctionDelegate( name, this ); return new CPPFunctionDelegate( usingDecl, this );
} }
static public boolean hasStorageClass( ICPPInternalFunction function, int storage){ static public boolean hasStorageClass( ICPPInternalFunction function, int storage){

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunctionType; 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.ICPPParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; 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.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@ -48,8 +48,8 @@ public class CPPFunctionInstance extends CPPInstance implements ICPPFunction, IC
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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) {
return new CPPFunction.CPPFunctionDelegate( name, this ); return new CPPFunction.CPPFunctionDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -10,9 +10,6 @@
* Bryan Wilkinson (QNX) * Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 22, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; 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.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.CPPFunctionDelegate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.CPPFunctionDelegate;
@ -156,8 +154,8 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
return false; return false;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFunctionDelegate( name, this ); return new CPPFunctionDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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.ICPPFunctionTemplate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; 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.ICPPTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; 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 static class CPPFunctionTemplateDelegate extends CPPFunction.CPPFunctionDelegate implements ICPPFunctionTemplate, ICPPInternalTemplate {
public CPPFunctionTemplateDelegate( IASTName name, ICPPFunction binding ) { public CPPFunctionTemplateDelegate( ICPPUsingDeclaration name, ICPPFunction binding ) {
super( name, binding ); super( name, binding );
} }
public ICPPTemplateParameter[] getTemplateParameters() throws DOMException { public ICPPTemplateParameter[] getTemplateParameters() throws DOMException {
@ -427,8 +428,8 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPFunctionTemplateDelegate( name, this ); return new CPPFunctionTemplateDelegate( usingDecl, this );
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,15 +7,10 @@
* *
* Contributors: * Contributors:
* IBM - Initial API and implementation * IBM - Initial API and implementation
* /
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 29, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IType; 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.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.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; 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.ICPPTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
/** /**
@ -44,7 +40,7 @@ public class CPPFunctionTemplateSpecialization extends CPPFunctionSpecialization
return template.getTemplateParameters(); return template.getTemplateParameters();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,12 +11,12 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IASTNode;
import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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 * 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) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
*/ */
public ICPPDelegate createDelegate(IASTName aName) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPTypedefDelegate( aName, this ); return new CPPTypedefDelegate( usingDecl, this );
} }
/** /**

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,10 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Jan 14, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ILabel;
import org.eclipse.cdt.core.dom.ast.IScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
@ -122,7 +119,7 @@ public class CPPLabel extends PlatformObject implements ILabel, ICPPInternalBind
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -9,9 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 1, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; 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 class CPPMethod extends CPPFunction implements ICPPMethod {
public static class CPPMethodDelegate extends CPPFunction.CPPFunctionDelegate 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 ); super( name, binding );
} }
public int getVisibility() throws DOMException { public int getVisibility() throws DOMException {
@ -234,8 +232,8 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPMethodDelegate( name, this ); return new CPPMethodDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,9 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 1, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; 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.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.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.core.parser.util.ObjectSet; 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 class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPInternalBinding {
public static class CPPNamespaceDelegate extends CPPDelegate implements ICPPNamespace { public static class CPPNamespaceDelegate extends CPPDelegate implements ICPPNamespace {
public CPPNamespaceDelegate( IASTName name, ICPPNamespace binding ) { public CPPNamespaceDelegate( ICPPUsingDeclaration name, ICPPNamespace binding ) {
super( name, binding ); super( name, binding );
} }
public ICPPNamespaceScope getNamespaceScope() throws DOMException { public ICPPNamespaceScope getNamespaceScope() throws DOMException {
@ -305,8 +303,8 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPNamespaceDelegate( name, this ); return new CPPNamespaceDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,10 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Mar 15, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias; 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.ICPPNamespaceScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
@ -131,7 +128,7 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,9 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 10, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; 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 class CPPParameter extends PlatformObject implements ICPPParameter, ICPPInternalBinding {
public static class CPPParameterDelegate extends CPPDelegate implements ICPPParameter { public static class CPPParameterDelegate extends CPPDelegate implements ICPPParameter {
public CPPParameterDelegate( IASTName name, IParameter binding ) { public CPPParameterDelegate( ICPPUsingDeclaration name, IParameter binding ) {
super( name, binding ); super( name, binding );
} }
public IType getType() throws DOMException { public IType getType() throws DOMException {
@ -245,8 +243,8 @@ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPI
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPParameterDelegate( name, this ); return new CPPParameterDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,17 +9,14 @@
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Mar 29, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope; 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.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter.CPPParameterDelegate; 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(); return getParameter().hasDefaultValue();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPParameterDelegate( name, this ); return new CPPParameterDelegate( usingDecl, this );
} }
public boolean isExternC() { public boolean isExternC() {

View file

@ -110,6 +110,9 @@ abstract public class CPPScope implements ICPPScope, IASTInternalScope {
bindings= fileSet.filterFileLocalBindings(bindings); bindings= fileSet.filterFileLocalBindings(bindings);
} }
binding= CPPSemantics.resolveAmbiguities(name, bindings); binding= CPPSemantics.resolveAmbiguities(name, bindings);
if( binding instanceof ICPPUsingDeclaration ){
binding= CPPSemantics.resolveAmbiguities( name, ((ICPPUsingDeclaration)binding).getDelegates() );
}
} catch (CoreException e) { } catch (CoreException e) {
CCorePlugin.log(e); CCorePlugin.log(e);
} }
@ -126,6 +129,9 @@ abstract public class CPPScope implements ICPPScope, IASTInternalScope {
bindings= fileSet.filterFileLocalBindings(bindings); bindings= fileSet.filterFileLocalBindings(bindings);
} }
binding= CPPSemantics.resolveAmbiguities(name, bindings); binding= CPPSemantics.resolveAmbiguities(name, bindings);
if( binding instanceof ICPPUsingDeclaration ){
binding= CPPSemantics.resolveAmbiguities( name, ((ICPPUsingDeclaration)binding).getDelegates() );
}
} }
} }
} }

View file

@ -2146,6 +2146,9 @@ public class CPPSemantics {
if (binding instanceof ICPPSpecialization) { if (binding instanceof ICPPSpecialization) {
return ((ICPPSpecialization) binding).getSpecializedBinding() instanceof IIndexBinding; return ((ICPPSpecialization) binding).getSpecializedBinding() instanceof IIndexBinding;
} }
if (binding instanceof ICPPDelegate) {
return ((ICPPDelegate) binding).getBinding() instanceof IIndexBinding;
}
return false; return false;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,9 +8,6 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 13, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPTemplateNonTypeParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
/** /**
* @author aniefer * @author aniefer
@ -99,7 +97,7 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,9 +9,6 @@
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Mar 11, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.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.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
@ -111,7 +109,7 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,9 +8,6 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
/*
* Created on Apr 13, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.ICPPSpecialization;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; 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.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.ArrayUtil;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
@ -221,7 +219,7 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 // TODO Auto-generated method stub
return null; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,9 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on Dec 11, 2004
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; 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 class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding {
public static class CPPTypedefDelegate extends CPPDelegate implements ITypedef, ITypeContainer { public static class CPPTypedefDelegate extends CPPDelegate implements ITypedef, ITypeContainer {
public CPPTypedefDelegate( IASTName name, ITypedef binding ) { public CPPTypedefDelegate( ICPPUsingDeclaration name, ITypedef binding ) {
super( name, binding ); super( name, binding );
} }
public IType getType() throws DOMException { public IType getType() throws DOMException {
return ((ITypedef)getBinding()).getType(); return ((ITypedef)getBinding()).getType();
} }
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
}
return null;
}
public boolean isSameType( IType type ) { public boolean isSameType( IType type ) {
return ((ITypedef)getBinding()).isSameType( type ); return ((ITypedef)getBinding()).isSameType( type );
} }
@ -174,8 +165,8 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPTypedefDelegate( name, this ); return new CPPTypedefDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,19 +8,15 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
/*
* Created on May 3, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; 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.ITypeContainer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef.CPPTypedefDelegate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef.CPPTypedefDelegate;
@ -97,8 +93,8 @@ public class CPPTypedefSpecialization extends CPPSpecialization implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPTypedefDelegate( name, this ); return new CPPTypedefDelegate( usingDecl, this );
} }
public void setType(IType type) { public void setType(IType type) {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,10 +9,6 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
/*
* Created on May 3, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage; 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.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.Linkage; import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal; import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@ -75,7 +72,7 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -50,7 +50,7 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl
ICPPDelegate [] result = null; ICPPDelegate [] result = null;
for( int i = 0; i < bindings.length; i++ ){ for( int i = 0; i < bindings.length; i++ ){
if( bindings[i] instanceof ICPPDelegateCreator){ 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 ); result = (ICPPDelegate[]) ArrayUtil.append( ICPPDelegate.class, result, delegate );
} }
} }
@ -133,7 +133,7 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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; return null;
} }

View file

@ -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.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage; 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 class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInternalVariable {
public static class CPPVariableDelegate extends CPPDelegate implements ICPPVariable { public static class CPPVariableDelegate extends CPPDelegate implements ICPPVariable {
public CPPVariableDelegate( IASTName name, ICPPVariable binding ) { public CPPVariableDelegate( ICPPUsingDeclaration name, ICPPVariable binding ) {
super( name, binding ); super( name, binding );
} }
public IType getType() throws DOMException { public IType getType() throws DOMException {
@ -287,8 +288,8 @@ public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInt
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName) * @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 ) {
return new CPPVariableDelegate( name, this ); return new CPPVariableDelegate( usingDecl, this );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,12 +7,13 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Markus Schorn (Wind River Systems)
**********************************************************************/ **********************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
/** /**
* @author Doug Schaefer * @author Doug Schaefer
@ -20,6 +21,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
*/ */
public interface ICPPDelegateCreator { public interface ICPPDelegateCreator {
ICPPDelegate createDelegate( IASTName name ); /**
* Creates a delegate binding for the using declaration provided.
* @param usingDecl
*/
ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl );
} }

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding; 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.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.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.IIndexScope; import org.eclipse.cdt.internal.core.index.IIndexScope;
@ -81,6 +82,8 @@ public abstract class CompositeScope implements IIndexScope {
return new CPPCompositeBinding( return new CPPCompositeBinding(
processUncertainBindings(((CPPCompositeBinding)binding).getBindings()) processUncertainBindings(((CPPCompositeBinding)binding).getBindings())
); );
} else if(binding instanceof CPPUsingDeclaration) {
return binding;
} else if(binding == null) { } else if(binding == null) {
return null; return null;
} else if(binding instanceof ICPPSpecialization) { } else if(binding instanceof ICPPSpecialization) {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPSpecialization;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; 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.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.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
@ -92,7 +92,7 @@ ICPPClassTemplate, ICPPDelegateCreator, ICPPInternalTemplateInstantiator {
return CPPTemplates.instantiateTemplate(this, arguments, null); return CPPTemplates.instantiateTemplate(this, arguments, null);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.IName;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; 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.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.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate; 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); return ((ICPPClassType)rbinding).isSameType(type);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassTypeDelegate(name, this); return new CPPClassTypeDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,12 +11,12 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; 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 Object clone() { fail(); return null; }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPEnumerationDelegate(name, this); return new CPPEnumerationDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,11 +11,11 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.CPPEnumerator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.index.IIndexType; import org.eclipse.cdt.internal.core.index.IIndexType;
@ -31,7 +31,7 @@ class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator,
return cf.getCompositeType((IIndexType)type); return cf.getCompositeType((IIndexType)type);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPEnumerator.CPPEnumeratorDelegate(name, this); return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,13 +11,13 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField; 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.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.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.CPPField;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.IIndexFragmentBinding;
@ -42,7 +42,7 @@ class CompositeCPPField extends CompositeCPPVariable implements ICPPField, ICPPD
return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult); return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPField.CPPFieldDelegate(name, this); return new CPPField.CPPFieldDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IParameter; import org.eclipse.cdt.core.dom.ast.IParameter;
import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.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.CPPFunction;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.IIndexFragmentBinding;
@ -95,7 +95,7 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction,
return result.toString(); return result.toString();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFunction.CPPFunctionDelegate(name, this); return new CPPFunction.CPPFunctionDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,7 +11,6 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IType; 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.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.ICPPFunctionTemplate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; 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.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.CPPFunctionTemplate;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
@ -51,7 +51,7 @@ public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implement
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding); return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this); return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,11 +11,11 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; 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.CPPMethod;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.IIndexFragmentBinding;
@ -48,7 +48,7 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod, ICP
return ((ICPPMethod)rbinding).getVisibility(); return ((ICPPMethod)rbinding).getVisibility();
} }
public final ICPPDelegate createDelegate(IASTName name) { public final ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPMethod.CPPMethodDelegate(name, this); return new CPPMethod.CPPMethodDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,11 +11,11 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope; 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.CPPNamespace;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.IIndexFragmentBinding;
@ -42,7 +42,7 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace
return new CompositeCPPNamespaceScope(cf, namespaces); return new CompositeCPPNamespaceScope(cf, namespaces);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPNamespace.CPPNamespaceDelegate(name, this); return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -36,6 +36,6 @@ class CompositeCPPNamespaceAlias extends CompositeCPPBinding implements ICPPName
} }
public int getDelegateType() { public int getDelegateType() {
fail(); return 0; return NAMESPACE_ALIAS;
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -10,9 +10,9 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; 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.core.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
@ -27,7 +27,7 @@ class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParamete
return ((ICPPParameter)rbinding).hasDefaultValue(); return ((ICPPParameter)rbinding).hasDefaultValue();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPParameter.CPPParameterDelegate(name, this); return new CPPParameter.CPPParameterDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,11 +11,11 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; 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.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.ITypeContainer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef;
import org.eclipse.cdt.internal.core.index.CPPTypedefClone; import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
@ -44,7 +44,7 @@ class CompositeCPPTypedef extends CompositeCPPBinding implements ITypedef, IInde
return new CPPTypedefClone(this); return new CPPTypedefClone(this);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPTypedef.CPPTypedefDelegate(name, this); return new CPPTypedef.CPPTypedefDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil; 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.dom.parser.cpp.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding; import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@ -38,7 +37,7 @@ class CompositeCPPUsingDeclaration extends CompositeCPPBinding implements ICPPUs
if (binding instanceof IIndexFragmentBinding) { if (binding instanceof IIndexFragmentBinding) {
binding = cf.getCompositeBinding((IIndexFragmentBinding) binding); binding = cf.getCompositeBinding((IIndexFragmentBinding) binding);
if (binding instanceof ICPPDelegateCreator) { if (binding instanceof ICPPDelegateCreator) {
composites[j++] = ((ICPPDelegateCreator) binding).createDelegate(new CPPASTName(getNameCharArray())); composites[j++] = ((ICPPDelegateCreator) binding).createDelegate(this);
} }
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,9 +12,9 @@
package org.eclipse.cdt.internal.core.index.composite.cpp; package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable; 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.dom.parser.cpp.ICPPDelegateCreator;
@ -56,7 +56,7 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable,
return ((ICPPVariable)rbinding).isStatic(); return ((ICPPVariable)rbinding).isStatic();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPVariable.CPPVariableDelegate(name, this); return new CPPVariable.CPPVariableDelegate(usingDecl, this);
} }
} }

View file

@ -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.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; 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.ICPPTemplateScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.index.IndexFilter;
@ -421,7 +422,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
return false; return false;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassTemplate.CPPClassTemplateDelegate(name, this); return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this);
} }
} }

View file

@ -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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; 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.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.index.IndexFilter;
@ -432,8 +433,8 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
return this; return this;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassTypeDelegate(name, this); return new CPPClassTypeDelegate(usingDecl, this);
} }
public String toString() { public String toString() {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; 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.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.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants; 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; private static final int FIRST_ENUMERATOR = PDOMBinding.RECORD_SIZE + 0;
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4; protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4;
public PDOMCPPEnumeration(PDOM pdom, PDOMNode parent, IEnumeration enumeration) public PDOMCPPEnumeration(PDOM pdom, PDOMNode parent, IEnumeration enumeration)
@ -63,14 +64,14 @@ class PDOMCPPEnumeration extends PDOMCPPBinding
public IEnumerator[] getEnumerators() throws DOMException { public IEnumerator[] getEnumerators() throws DOMException {
try { try {
ArrayList enums = new ArrayList(); ArrayList<PDOMCPPEnumerator> enums = new ArrayList<PDOMCPPEnumerator>();
for (PDOMCPPEnumerator enumerator = getFirstEnumerator(); for (PDOMCPPEnumerator enumerator = getFirstEnumerator();
enumerator != null; enumerator != null;
enumerator = enumerator.getNextEnumerator()) { enumerator = enumerator.getNextEnumerator()) {
enums.add(enumerator); 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 // Reverse the list since they are last in first out
int n = enumerators.length; int n = enumerators.length;
@ -134,8 +135,8 @@ class PDOMCPPEnumeration extends PDOMCPPBinding
throw new PDOMNotImplementedError(); throw new PDOMNotImplementedError();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPEnumerationDelegate(name, this); return new CPPEnumerationDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IType; 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.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.CPPEnumerator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.PDOM;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; 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 ENUMERATION = PDOMBinding.RECORD_SIZE + 0;
private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4; private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4;
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 8; protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 8;
public PDOMCPPEnumerator(PDOM pdom, PDOMNode parent, IEnumerator enumerator, PDOMCPPEnumeration enumeration) public PDOMCPPEnumerator(PDOM pdom, PDOMNode parent, IEnumerator enumerator, PDOMCPPEnumeration enumeration)
@ -52,7 +54,7 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi
} }
public int getNodeType() { public int getNodeType() {
return PDOMCPPLinkage.CPPENUMERATOR; return IIndexCPPBindingConstants.CPPENUMERATOR;
} }
public PDOMCPPEnumerator getNextEnumerator() throws CoreException { public PDOMCPPEnumerator getNextEnumerator() throws CoreException {
@ -74,8 +76,8 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi
} }
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPEnumerator.CPPEnumeratorDelegate(name, this); return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -14,13 +14,14 @@
package org.eclipse.cdt.internal.core.pdom.dom.cpp; package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin; 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.ICompositeType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.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.CPPField;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.PDOM;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -47,7 +48,7 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre
// @Override // @Override
public int getNodeType() { public int getNodeType() {
return PDOMCPPLinkage.CPPFIELD; return IIndexCPPBindingConstants.CPPFIELD;
} }
public ICPPClassType getClassOwner() { public ICPPClassType getClassOwner() {
@ -95,8 +96,8 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre
return getClassOwner(); return getClassOwner();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPField.CPPFieldDelegate(name, this); return new CPPField.CPPFieldDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.IFunctionType; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; 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.ICPPFunctionType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.Util; 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.CPPFunction;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.index.IndexCPPSignatureUtil;
import org.eclipse.cdt.internal.core.pdom.PDOM; import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database; 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 * Offset of total number of function parameters (relative to the
* beginning of the record). * beginning of the record).
*/ */
@SuppressWarnings("static-access")
private static final int NUM_PARAMS = PDOMCPPBinding.RECORD_SIZE + 0; private static final int NUM_PARAMS = PDOMCPPBinding.RECORD_SIZE + 0;
/** /**
* Offset of pointer to the first parameter of this function (relative to * Offset of pointer to the first parameter of this function (relative to
* the beginning of the record). * the beginning of the record).
*/ */
@SuppressWarnings("static-access")
private static final int FIRST_PARAM = PDOMCPPBinding.RECORD_SIZE + 4; private static final int FIRST_PARAM = PDOMCPPBinding.RECORD_SIZE + 4;
/** /**
* Offset of pointer to the function type record of this function (relative to * Offset of pointer to the function type record of this function (relative to
* the beginning of the record). * the beginning of the record).
*/ */
@SuppressWarnings("static-access")
protected static final int FUNCTION_TYPE= PDOMCPPBinding.RECORD_SIZE + 8; protected static final int FUNCTION_TYPE= PDOMCPPBinding.RECORD_SIZE + 8;
/** /**
* Offset of hash of parameter information to allow fast comparison * Offset of hash of parameter information to allow fast comparison
*/ */
@SuppressWarnings("static-access")
private static final int SIGNATURE_MEMENTO = PDOMCPPBinding.RECORD_SIZE + 12; private static final int SIGNATURE_MEMENTO = PDOMCPPBinding.RECORD_SIZE + 12;
/** /**
* Offset of annotation information (relative to the beginning of the * Offset of annotation information (relative to the beginning of the
* record). * record).
*/ */
@SuppressWarnings("static-access")
protected static final int ANNOTATION = PDOMCPPBinding.RECORD_SIZE + 16; // byte protected static final int ANNOTATION = PDOMCPPBinding.RECORD_SIZE + 16; // byte
/** /**
* The size in bytes of a PDOMCPPFunction record in the database. * 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; protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 17;
public PDOMCPPFunction(PDOM pdom, PDOMNode parent, ICPPFunction function, boolean setTypes) throws CoreException { 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() { public int getNodeType() {
return PDOMCPPLinkage.CPPFUNCTION; return IIndexCPPBindingConstants.CPPFUNCTION;
} }
public PDOMCPPParameter getFirstParameter() throws CoreException { public PDOMCPPParameter getFirstParameter() throws CoreException {
@ -277,8 +284,8 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
return 0; return 0;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFunction.CPPFunctionDelegate(name, this); return new CPPFunction.CPPFunctionDelegate(usingDecl, this);
} }
} }

View file

@ -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.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; 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.ICPPTemplateScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil;
@ -234,8 +235,8 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
return this; return this;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(name, this); return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; 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.ICPPReferenceType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.Util; 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.CPPMethod;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database; import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage; 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. * The size in bytes of a PDOMCPPMethod record in the database.
*/ */
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMCPPFunction.RECORD_SIZE + 1; protected static final int RECORD_SIZE = PDOMCPPFunction.RECORD_SIZE + 1;
/** /**
@ -96,7 +99,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
} }
public int getNodeType() { public int getNodeType() {
return PDOMCPPLinkage.CPPMETHOD; return IIndexCPPBindingConstants.CPPMETHOD;
} }
public boolean isVirtual() throws DOMException { 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); return getBit(getByte(record + ANNOTATION1), PDOMCAnnotation.VOLATILE_OFFSET + CV_OFFSET);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPMethod.CPPMethodDelegate(name, this); return new CPPMethod.CPPMethodDelegate(usingDecl, this);
} }
public int getAdditionalNameFlags(int standardFlags, IASTName name) { public int getAdditionalNameFlags(int standardFlags, IASTName name) {

View file

@ -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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; 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.ICPPNamespaceScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.index.IndexFilter;
@ -200,8 +201,8 @@ class PDOMCPPNamespace extends PDOMCPPBinding
return this; return this;
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPNamespace.CPPNamespaceDelegate(name, this); return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX - Initial API and implementation * QNX - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp; package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@ -29,10 +29,11 @@ import org.eclipse.core.runtime.CoreException;
* @author Doug Schaefer * @author Doug Schaefer
* *
*/ */
class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias {
ICPPNamespaceAlias {
@SuppressWarnings("static-access")
private static final int NAMESPACE_BINDING = PDOMCPPBinding.RECORD_SIZE + 0; private static final int NAMESPACE_BINDING = PDOMCPPBinding.RECORD_SIZE + 0;
@SuppressWarnings({ "hiding", "static-access" })
protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 4; protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 4;
public PDOMCPPNamespaceAlias(PDOM pdom, PDOMNode parent, ICPPNamespaceAlias alias) public PDOMCPPNamespaceAlias(PDOM pdom, PDOMNode parent, ICPPNamespaceAlias alias)
@ -95,7 +96,7 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements
} }
public int getDelegateType() { public int getDelegateType() {
throw new PDOMNotImplementedError(); return NAMESPACE_ALIAS;
} }
public IBinding getBinding() { public IBinding getBinding() {

View file

@ -15,12 +15,12 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IParameter;
import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.ICPPParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.index.IIndexFile; import org.eclipse.cdt.core.index.IIndexFile;
import org.eclipse.cdt.internal.core.Util; import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter;
@ -244,8 +244,8 @@ class PDOMCPPParameter extends PDOMNamedNode
return getNodeType(); return getNodeType();
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPParameter.CPPParameterDelegate(name, this); return new CPPParameter.CPPParameterDelegate(usingDecl, this);
} }
public void delete(PDOMLinkage linkage) throws CoreException { public void delete(PDOMLinkage linkage) throws CoreException {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunctionType; import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate; 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.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.Util; import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; 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; private static final int TYPE = PDOMBinding.RECORD_SIZE + 0;
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4; protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 4;
public PDOMCPPTypedef(PDOM pdom, PDOMNode parent, ITypedef typedef) public PDOMCPPTypedef(PDOM pdom, PDOMNode parent, ITypedef typedef)
@ -155,8 +156,8 @@ class PDOMCPPTypedef extends PDOMCPPBinding
return new CPPTypedefClone(this); return new CPPTypedefClone(this);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPTypedef.CPPTypedefDelegate(name, this); return new CPPTypedef.CPPTypedefDelegate(usingDecl, this);
} }
} }

View file

@ -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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil; 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.dom.parser.cpp.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants; import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
import org.eclipse.cdt.internal.core.pdom.PDOM; import org.eclipse.cdt.internal.core.pdom.PDOM;
@ -93,8 +92,8 @@ class PDOMCPPUsingDeclaration extends PDOMCPPBinding implements ICPPUsingDeclara
do { do {
IBinding binding = alias.getBinding(); IBinding binding = alias.getBinding();
if (binding instanceof ICPPDelegateCreator) { if (binding instanceof ICPPDelegateCreator) {
ICPPDelegate delegate = ((ICPPDelegateCreator) binding).createDelegate(new CPPASTName(getNameCharArray())); ICPPDelegate delegate = ((ICPPDelegateCreator) binding).createDelegate(this);
ArrayUtil.append(ICPPDelegate.class, delegates, i++, delegate); delegates= (ICPPDelegate[]) ArrayUtil.append(ICPPDelegate.class, delegates, i++, delegate);
} }
} while ((alias = alias.getNext()) != null); } while ((alias = alias.getNext()) != null);
} catch (CoreException e) { } catch (CoreException e) {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.IType;
import org.eclipse.cdt.core.dom.ast.IVariable; 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.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
import org.eclipse.cdt.internal.core.Util; 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.CPPVariable;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator; 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.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database; import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; 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. * The size in bytes of a PDOMCPPVariable record in the database.
*/ */
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 5; protected static final int RECORD_SIZE = PDOMBinding.RECORD_SIZE + 5;
public PDOMCPPVariable(PDOM pdom, PDOMNode parent, ICPPVariable variable) throws CoreException { public PDOMCPPVariable(PDOM pdom, PDOMNode parent, ICPPVariable variable) throws CoreException {
@ -105,7 +108,7 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega
} }
public int getNodeType() { public int getNodeType() {
return PDOMCPPLinkage.CPPVARIABLE; return IIndexCPPBindingConstants.CPPVARIABLE;
} }
public boolean isMutable() throws DOMException { public boolean isMutable() throws DOMException {
@ -143,8 +146,8 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET); return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
} }
public ICPPDelegate createDelegate(IASTName name) { public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPVariable.CPPVariableDelegate(name, this); return new CPPVariable.CPPVariableDelegate(usingDecl, this);
} }
public int getAdditionalNameFlags(int standardFlags, IASTName name) { public int getAdditionalNameFlags(int standardFlags, IASTName name) {