1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +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);
}
// 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 g(int n){return n;}
// 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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@ -28,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@ -167,8 +167,8 @@ public class CPPClassInstance extends CPPInstance implements ICPPClassType, ICPP
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
*/
public ICPPDelegate createDelegate(IASTName name) {
return new CPPClassType.CPPClassTypeDelegate( name, this );
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassType.CPPClassTypeDelegate( usingDecl, this );
}
/* (non-Javadoc)

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

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

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

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

View file

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

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

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

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

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

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

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

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

View file

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

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

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

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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -11,12 +11,12 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
/**
* The CPPImplicitTypedef is used to represent implicit typedefs that exist on the translation
@ -114,8 +114,8 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
*/
public ICPPDelegate createDelegate(IASTName aName) {
return new CPPTypedefDelegate( aName, this );
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPTypedefDelegate( usingDecl, this );
}
/**

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

View file

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

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

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

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

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

View file

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

View file

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

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

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

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

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

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

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

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

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

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

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

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

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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@ -23,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate;
@ -177,7 +177,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return ((ICPPClassType)rbinding).isSameType(type);
}
public ICPPDelegate createDelegate(IASTName name) {
return new CPPClassTypeDelegate(name, this);
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
return new CPPClassTypeDelegate(usingDecl, this);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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