mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 367607: Short name for templated in qualified name.
This commit is contained in:
parent
2e36c7ca14
commit
1145c22674
7 changed files with 169 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2011 IBM Corporation and others.
|
* Copyright (c) 2005, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -5689,4 +5689,18 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testDeductionForConstFunctionType_367562() throws Exception {
|
public void testDeductionForConstFunctionType_367562() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename> struct base {
|
||||||
|
// typedef int type;
|
||||||
|
// };
|
||||||
|
// template <typename A, typename B> struct derived;
|
||||||
|
// template <typename B> struct derived<int, B> : public base<B> {
|
||||||
|
// typedef typename derived::type type; // ERROR HERE
|
||||||
|
// };
|
||||||
|
public void testTemplateShortNameInQualifiedName_367607() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
|
ICPPDeferredClassInstance shortHand= bh.assertNonProblem("derived:", -1);
|
||||||
|
assertTrue(shortHand.getClassTemplate() instanceof ICPPClassTemplatePartialSpecialization);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -124,7 +124,7 @@ public interface IASTName extends IASTNode, IName {
|
||||||
public char[] getLookupKey();
|
public char[] getLookupKey();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the intermediate representation of the biniding, if already available.
|
* Gets the intermediate representation of the binding, if already available.
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public IBinding getPreBinding();
|
public IBinding getPreBinding();
|
||||||
|
@ -134,4 +134,10 @@ public interface IASTName extends IASTNode, IName {
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public IBinding resolvePreBinding();
|
public IBinding resolvePreBinding();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this name is qualified, i.e. whether it is preceded by a scope operator.
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public boolean isQualified();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2011 IBM Corporation and others.
|
* Copyright (c) 2005, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -265,4 +265,8 @@ public class CASTName extends ASTNode implements IASTName, IASTCompletionContext
|
||||||
public IASTName getLastName() {
|
public IASTName getLastName() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isQualified() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2012 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -19,6 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTInternalNameOwner;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTInternalNameOwner;
|
||||||
|
@ -151,6 +152,22 @@ public abstract class CPPASTNameBase extends ASTNode implements IASTName {
|
||||||
public IASTName getLastName() {
|
public IASTName getLastName() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isQualified() {
|
||||||
|
IASTNode parent= getParent();
|
||||||
|
if (parent instanceof ICPPASTQualifiedName) {
|
||||||
|
ICPPASTQualifiedName qn= (ICPPASTQualifiedName) parent;
|
||||||
|
if (qn.isFullyQualified())
|
||||||
|
return true;
|
||||||
|
IASTName[] qns = qn.getNames();
|
||||||
|
if (qns.length > 0 && qns[0] == this)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -324,7 +324,7 @@ public class CPPSemantics {
|
||||||
if (binding instanceof ICPPClassTemplate && !(binding instanceof ICPPClassSpecialization) &&
|
if (binding instanceof ICPPClassTemplate && !(binding instanceof ICPPClassSpecialization) &&
|
||||||
!(binding instanceof ICPPTemplateParameter) && !(data.astName instanceof ICPPASTTemplateId)) {
|
!(binding instanceof ICPPTemplateParameter) && !(data.astName instanceof ICPPASTTemplateId)) {
|
||||||
ASTNodeProperty prop = data.astName.getPropertyInParent();
|
ASTNodeProperty prop = data.astName.getPropertyInParent();
|
||||||
if (prop != ICPPASTTemplateId.TEMPLATE_NAME && prop != ICPPASTQualifiedName.SEGMENT_NAME) {
|
if (prop != ICPPASTTemplateId.TEMPLATE_NAME && !data.astName.isQualified()) {
|
||||||
// You cannot use a class template name outside of the class template scope,
|
// You cannot use a class template name outside of the class template scope,
|
||||||
// mark it as a problem.
|
// mark it as a problem.
|
||||||
IBinding replacement= CPPTemplates.isUsedInClassTemplateScope((ICPPClassTemplate) binding, data.astName);
|
IBinding replacement= CPPTemplates.isUsedInClassTemplateScope((ICPPClassTemplate) binding, data.astName);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -37,40 +37,52 @@ class ASTPreprocessorName extends ASTPreprocessorNode implements IASTName {
|
||||||
fBinding= binding;
|
fBinding= binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding resolveBinding() {
|
public IBinding resolveBinding() {
|
||||||
return fBinding;
|
return fBinding;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IBinding resolvePreBinding() {
|
public IBinding resolvePreBinding() {
|
||||||
return fBinding;
|
return fBinding;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IBinding getBinding() {
|
public IBinding getBinding() {
|
||||||
return fBinding;
|
return fBinding;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IBinding getPreBinding() {
|
public IBinding getPreBinding() {
|
||||||
return fBinding;
|
return fBinding;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
final IASTTranslationUnit tu= getTranslationUnit();
|
final IASTTranslationUnit tu= getTranslationUnit();
|
||||||
return tu == null ? Linkage.NO_LINKAGE : tu.getLinkage();
|
return tu == null ? Linkage.NO_LINKAGE : tu.getLinkage();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IASTCompletionContext getCompletionContext() {
|
public IASTCompletionContext getCompletionContext() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean isDeclaration() {
|
public boolean isDeclaration() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean isDefinition() {
|
public boolean isDefinition() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean isReference() {
|
public boolean isReference() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public char[] toCharArray() {
|
public char[] toCharArray() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public char[] getSimpleID() {
|
public char[] getSimpleID() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public char[] getLookupKey() {
|
public char[] getLookupKey() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
@ -79,15 +91,22 @@ class ASTPreprocessorName extends ASTPreprocessorNode implements IASTName {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new String(fName);
|
return new String(fName);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void setBinding(IBinding binding) {assert false;}
|
public void setBinding(IBinding binding) {assert false;}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getRoleOfName(boolean allowResolution) {
|
public int getRoleOfName(boolean allowResolution) {
|
||||||
return IASTNameOwner.r_unclear;
|
return IASTNameOwner.r_unclear;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IASTName getLastName() {
|
public IASTName getLastName() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public boolean isQualified() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public IASTName copy() {
|
public IASTName copy() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -51,144 +51,179 @@ public class PDOMASTAdapter {
|
||||||
public AnonymousASTName(IASTName name, final IASTFileLocation loc) {
|
public AnonymousASTName(IASTName name, final IASTFileLocation loc) {
|
||||||
fDelegate= name;
|
fDelegate= name;
|
||||||
fLocation= new IASTFileLocation() {
|
fLocation= new IASTFileLocation() {
|
||||||
|
@Override
|
||||||
public int getEndingLineNumber() {
|
public int getEndingLineNumber() {
|
||||||
return loc.getStartingLineNumber();
|
return loc.getStartingLineNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getFileName() {
|
public String getFileName() {
|
||||||
return loc.getFileName();
|
return loc.getFileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getStartingLineNumber() {
|
public int getStartingLineNumber() {
|
||||||
return loc.getStartingLineNumber();
|
return loc.getStartingLineNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTFileLocation asFileLocation() {
|
public IASTFileLocation asFileLocation() {
|
||||||
return loc.asFileLocation();
|
return loc.asFileLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeLength() {
|
public int getNodeLength() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeOffset() {
|
public int getNodeOffset() {
|
||||||
return loc.getNodeOffset();
|
return loc.getNodeOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTPreprocessorIncludeStatement getContextInclusionStatement() {
|
public IASTPreprocessorIncludeStatement getContextInclusionStatement() {
|
||||||
return loc.getContextInclusionStatement();
|
return loc.getContextInclusionStatement();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean accept(ASTVisitor visitor) {
|
public boolean accept(ASTVisitor visitor) {
|
||||||
return fDelegate.accept(visitor);
|
return fDelegate.accept(visitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean contains(IASTNode node) {
|
public boolean contains(IASTNode node) {
|
||||||
return fDelegate.contains(node);
|
return fDelegate.contains(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getBinding() {
|
public IBinding getBinding() {
|
||||||
return fDelegate.getBinding();
|
return fDelegate.getBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getPreBinding() {
|
public IBinding getPreBinding() {
|
||||||
return fDelegate.getPreBinding();
|
return fDelegate.getPreBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getContainingFilename() {
|
public String getContainingFilename() {
|
||||||
return fLocation.getFileName();
|
return fLocation.getFileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTFileLocation getFileLocation() {
|
public IASTFileLocation getFileLocation() {
|
||||||
return fLocation;
|
return fLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return fDelegate.getLinkage();
|
return fDelegate.getLinkage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTNodeLocation[] getNodeLocations() {
|
public IASTNodeLocation[] getNodeLocations() {
|
||||||
return fDelegate.getNodeLocations();
|
return fDelegate.getNodeLocations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTNode getParent() {
|
public IASTNode getParent() {
|
||||||
return fDelegate.getParent();
|
return fDelegate.getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTNode[] getChildren() {
|
public IASTNode[] getChildren() {
|
||||||
return fDelegate.getChildren();
|
return fDelegate.getChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ASTNodeProperty getPropertyInParent() {
|
public ASTNodeProperty getPropertyInParent() {
|
||||||
return fDelegate.getPropertyInParent();
|
return fDelegate.getPropertyInParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getRawSignature() {
|
public String getRawSignature() {
|
||||||
return fDelegate.getRawSignature();
|
return fDelegate.getRawSignature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTTranslationUnit getTranslationUnit() {
|
public IASTTranslationUnit getTranslationUnit() {
|
||||||
return fDelegate.getTranslationUnit();
|
return fDelegate.getTranslationUnit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getRoleOfName(boolean allowResolution) {
|
public int getRoleOfName(boolean allowResolution) {
|
||||||
return fDelegate.getRoleOfName(allowResolution);
|
return fDelegate.getRoleOfName(allowResolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isDeclaration() {
|
public boolean isDeclaration() {
|
||||||
return fDelegate.isDeclaration();
|
return fDelegate.isDeclaration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isDefinition() {
|
public boolean isDefinition() {
|
||||||
return fDelegate.isDefinition();
|
return fDelegate.isDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isReference() {
|
public boolean isReference() {
|
||||||
return fDelegate.isReference();
|
return fDelegate.isReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding resolveBinding() {
|
public IBinding resolveBinding() {
|
||||||
return fDelegate.resolveBinding();
|
return fDelegate.resolveBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding resolvePreBinding() {
|
public IBinding resolvePreBinding() {
|
||||||
return fDelegate.resolvePreBinding();
|
return fDelegate.resolvePreBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTCompletionContext getCompletionContext() {
|
public IASTCompletionContext getCompletionContext() {
|
||||||
return fDelegate.getCompletionContext();
|
return fDelegate.getCompletionContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setBinding(IBinding binding) {
|
public void setBinding(IBinding binding) {
|
||||||
fDelegate.setBinding(binding);
|
fDelegate.setBinding(binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setParent(IASTNode node) {
|
public void setParent(IASTNode node) {
|
||||||
fDelegate.setParent(node);
|
fDelegate.setParent(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setPropertyInParent(ASTNodeProperty property) {
|
public void setPropertyInParent(ASTNodeProperty property) {
|
||||||
fDelegate.setPropertyInParent(property);
|
fDelegate.setPropertyInParent(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] toCharArray() {
|
public char[] toCharArray() {
|
||||||
return fDelegate.toCharArray();
|
return fDelegate.toCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getSimpleID() {
|
public char[] getSimpleID() {
|
||||||
return fDelegate.getSimpleID();
|
return fDelegate.getSimpleID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getLookupKey() {
|
public char[] getLookupKey() {
|
||||||
return fDelegate.getLookupKey();
|
return fDelegate.getLookupKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTImageLocation getImageLocation() {
|
public IASTImageLocation getImageLocation() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isPartOfTranslationUnitFile() {
|
public boolean isPartOfTranslationUnitFile() {
|
||||||
return fLocation.getFileName().equals(fDelegate.getTranslationUnit().getFilePath());
|
return fLocation.getFileName().equals(fDelegate.getTranslationUnit().getFilePath());
|
||||||
}
|
}
|
||||||
|
@ -198,40 +233,53 @@ public class PDOMASTAdapter {
|
||||||
return fDelegate.toString();
|
return fDelegate.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTName getLastName() {
|
public IASTName getLastName() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IToken getSyntax() throws ExpansionOverlapsBoundaryException,
|
public IToken getSyntax() throws ExpansionOverlapsBoundaryException,
|
||||||
UnsupportedOperationException {
|
UnsupportedOperationException {
|
||||||
return fDelegate.getSyntax();
|
return fDelegate.getSyntax();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IToken getLeadingSyntax() throws ExpansionOverlapsBoundaryException,
|
public IToken getLeadingSyntax() throws ExpansionOverlapsBoundaryException,
|
||||||
UnsupportedOperationException {
|
UnsupportedOperationException {
|
||||||
return fDelegate.getLeadingSyntax();
|
return fDelegate.getLeadingSyntax();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IToken getTrailingSyntax() throws ExpansionOverlapsBoundaryException,
|
public IToken getTrailingSyntax() throws ExpansionOverlapsBoundaryException,
|
||||||
UnsupportedOperationException {
|
UnsupportedOperationException {
|
||||||
return fDelegate.getTrailingSyntax();
|
return fDelegate.getTrailingSyntax();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isFrozen() {
|
public boolean isFrozen() {
|
||||||
return fDelegate.isFrozen();
|
return fDelegate.isFrozen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return fDelegate.isFrozen();
|
return fDelegate.isFrozen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTName copy() {
|
public IASTName copy() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IASTName copy(CopyStyle style) {
|
public IASTName copy(CopyStyle style) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isQualified() {
|
||||||
|
return fDelegate.isQualified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class AnonymousEnumeration implements IEnumeration {
|
private static class AnonymousEnumeration implements IEnumeration {
|
||||||
|
@ -248,43 +296,53 @@ public class PDOMASTAdapter {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
return fDelegate.getAdapter(adapter);
|
return fDelegate.getAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IEnumerator[] getEnumerators() throws DOMException {
|
public IEnumerator[] getEnumerators() throws DOMException {
|
||||||
return fDelegate.getEnumerators();
|
return fDelegate.getEnumerators();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return fDelegate.getLinkage();
|
return fDelegate.getLinkage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return new String(fName);
|
return new String(fName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getScope() throws DOMException {
|
public IScope getScope() throws DOMException {
|
||||||
return fDelegate.getScope();
|
return fDelegate.getScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return fDelegate.isSameType(type);
|
return fDelegate.isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getOwner() {
|
public IBinding getOwner() {
|
||||||
return fDelegate.getOwner();
|
return fDelegate.getOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getMinValue() {
|
public long getMinValue() {
|
||||||
return fDelegate.getMinValue();
|
return fDelegate.getMinValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getMaxValue() {
|
public long getMaxValue() {
|
||||||
return fDelegate.getMaxValue();
|
return fDelegate.getMaxValue();
|
||||||
}
|
}
|
||||||
|
@ -304,51 +362,63 @@ public class PDOMASTAdapter {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IField findField(String name) {
|
public IField findField(String name) {
|
||||||
return fDelegate.findField(name);
|
return fDelegate.findField(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
return fDelegate.getAdapter(adapter);
|
return fDelegate.getAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getCompositeScope() {
|
public IScope getCompositeScope() {
|
||||||
return fDelegate.getCompositeScope();
|
return fDelegate.getCompositeScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IField[] getFields() {
|
public IField[] getFields() {
|
||||||
return fDelegate.getFields();
|
return fDelegate.getFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return fDelegate.getKey();
|
return fDelegate.getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return fDelegate.getLinkage();
|
return fDelegate.getLinkage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return new String(fName);
|
return new String(fName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getScope() throws DOMException {
|
public IScope getScope() throws DOMException {
|
||||||
return fDelegate.getScope();
|
return fDelegate.getScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return fDelegate.isSameType(type);
|
return fDelegate.isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getOwner() {
|
public IBinding getOwner() {
|
||||||
return fDelegate.getOwner();
|
return fDelegate.getOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isAnonymous() {
|
public boolean isAnonymous() {
|
||||||
return fDelegate.isAnonymous();
|
return fDelegate.isAnonymous();
|
||||||
}
|
}
|
||||||
|
@ -368,14 +438,17 @@ public class PDOMASTAdapter {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return new String(fName);
|
return new String(fName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getQualifiedName() throws DOMException {
|
public String[] getQualifiedName() throws DOMException {
|
||||||
String[] qn= fDelegate.getQualifiedName();
|
String[] qn= fDelegate.getQualifiedName();
|
||||||
if (qn.length < 1) {
|
if (qn.length < 1) {
|
||||||
|
@ -385,6 +458,7 @@ public class PDOMASTAdapter {
|
||||||
return qn;
|
return qn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[][] getQualifiedNameCharArray() throws DOMException {
|
public char[][] getQualifiedNameCharArray() throws DOMException {
|
||||||
char[][] qn= fDelegate.getQualifiedNameCharArray();
|
char[][] qn= fDelegate.getQualifiedNameCharArray();
|
||||||
if (qn.length < 1) {
|
if (qn.length < 1) {
|
||||||
|
@ -394,23 +468,28 @@ public class PDOMASTAdapter {
|
||||||
return qn;
|
return qn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
return fDelegate.getAdapter(adapter);
|
return fDelegate.getAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return fDelegate.getLinkage();
|
return fDelegate.getLinkage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getScope() throws DOMException {
|
public IScope getScope() throws DOMException {
|
||||||
return fDelegate.getScope();
|
return fDelegate.getScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
return fDelegate.isGloballyQualified();
|
return fDelegate.isGloballyQualified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getOwner() {
|
public IBinding getOwner() {
|
||||||
return fDelegate.getOwner();
|
return fDelegate.getOwner();
|
||||||
}
|
}
|
||||||
|
@ -421,30 +500,37 @@ public class PDOMASTAdapter {
|
||||||
super(name, (ICPPBinding) delegate);
|
super(name, (ICPPBinding) delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IEnumerator[] getEnumerators() throws DOMException {
|
public IEnumerator[] getEnumerators() throws DOMException {
|
||||||
return ((IEnumeration) fDelegate).getEnumerators();
|
return ((IEnumeration) fDelegate).getEnumerators();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return ((IEnumeration) fDelegate).isSameType(type);
|
return ((IEnumeration) fDelegate).isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getMinValue() {
|
public long getMinValue() {
|
||||||
return ((IEnumeration)fDelegate).getMinValue();
|
return ((IEnumeration)fDelegate).getMinValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getMaxValue() {
|
public long getMaxValue() {
|
||||||
return ((IEnumeration)fDelegate).getMaxValue();
|
return ((IEnumeration)fDelegate).getMaxValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isScoped() {
|
public boolean isScoped() {
|
||||||
return ((ICPPEnumeration)fDelegate).isScoped();
|
return ((ICPPEnumeration)fDelegate).isScoped();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IType getFixedType() {
|
public IType getFixedType() {
|
||||||
return ((ICPPEnumeration)fDelegate).getFixedType();
|
return ((ICPPEnumeration)fDelegate).getFixedType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPScope asScope() {
|
public ICPPScope asScope() {
|
||||||
return ((ICPPEnumeration)fDelegate).asScope();
|
return ((ICPPEnumeration)fDelegate).asScope();
|
||||||
}
|
}
|
||||||
|
@ -455,58 +541,72 @@ public class PDOMASTAdapter {
|
||||||
super(name, delegate);
|
super(name, delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IField findField(String name) {
|
public IField findField(String name) {
|
||||||
return ((ICPPClassType) fDelegate).findField(name);
|
return ((ICPPClassType) fDelegate).findField(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPMethod[] getAllDeclaredMethods() {
|
public ICPPMethod[] getAllDeclaredMethods() {
|
||||||
return ((ICPPClassType) fDelegate).getAllDeclaredMethods();
|
return ((ICPPClassType) fDelegate).getAllDeclaredMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPBase[] getBases() {
|
public ICPPBase[] getBases() {
|
||||||
return ((ICPPClassType) fDelegate).getBases();
|
return ((ICPPClassType) fDelegate).getBases();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getCompositeScope() {
|
public IScope getCompositeScope() {
|
||||||
return ((ICPPClassType) fDelegate).getCompositeScope();
|
return ((ICPPClassType) fDelegate).getCompositeScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPConstructor[] getConstructors() {
|
public ICPPConstructor[] getConstructors() {
|
||||||
return ((ICPPClassType) fDelegate).getConstructors();
|
return ((ICPPClassType) fDelegate).getConstructors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPField[] getDeclaredFields() {
|
public ICPPField[] getDeclaredFields() {
|
||||||
return ((ICPPClassType) fDelegate).getDeclaredFields();
|
return ((ICPPClassType) fDelegate).getDeclaredFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPMethod[] getDeclaredMethods() {
|
public ICPPMethod[] getDeclaredMethods() {
|
||||||
return ((ICPPClassType) fDelegate).getDeclaredMethods();
|
return ((ICPPClassType) fDelegate).getDeclaredMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IField[] getFields() {
|
public IField[] getFields() {
|
||||||
return ((ICPPClassType) fDelegate).getFields();
|
return ((ICPPClassType) fDelegate).getFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding[] getFriends() {
|
public IBinding[] getFriends() {
|
||||||
return ((ICPPClassType) fDelegate).getFriends();
|
return ((ICPPClassType) fDelegate).getFriends();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return ((ICPPClassType) fDelegate).getKey();
|
return ((ICPPClassType) fDelegate).getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPMethod[] getMethods() {
|
public ICPPMethod[] getMethods() {
|
||||||
return ((ICPPClassType) fDelegate).getMethods();
|
return ((ICPPClassType) fDelegate).getMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPClassType[] getNestedClasses() {
|
public ICPPClassType[] getNestedClasses() {
|
||||||
return ((ICPPClassType) fDelegate).getNestedClasses();
|
return ((ICPPClassType) fDelegate).getNestedClasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return ((ICPPClassType) fDelegate).isSameType(type);
|
return ((ICPPClassType) fDelegate).isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isAnonymous() {
|
public boolean isAnonymous() {
|
||||||
return ((ICPPClassType) fDelegate).isAnonymous();
|
return ((ICPPClassType) fDelegate).isAnonymous();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue