mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Code streamlining.
This commit is contained in:
parent
35044af3ee
commit
11f921e614
7 changed files with 135 additions and 154 deletions
|
@ -102,8 +102,7 @@ public class ASTTypeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Whether the function matching the given function binding takes
|
* Returns whether the function matching the given function binding takes parameters or not.
|
||||||
* parameters or not.
|
|
||||||
*
|
*
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@ -120,9 +119,8 @@ public class ASTTypeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representation for the type array. The representation is
|
* Returns a string representation for the type array. The representation is a comma-separated
|
||||||
* a comma-separated list of the normalized string representations of the
|
* list of the normalized string representations of the provided types.
|
||||||
* provided types.
|
|
||||||
* @see #getTypeListString(IType[], boolean)
|
* @see #getTypeListString(IType[], boolean)
|
||||||
*/
|
*/
|
||||||
public static String getTypeListString(IType[] types) {
|
public static String getTypeListString(IType[] types) {
|
||||||
|
@ -133,6 +131,7 @@ public class ASTTypeUtil {
|
||||||
* Returns a String representation of the type array as a
|
* Returns a String representation of the type array as a
|
||||||
* comma-separated list.
|
* comma-separated list.
|
||||||
* @param types
|
* @param types
|
||||||
|
* @param normalize indicates whether normalization shall be performed
|
||||||
* @return representation of the type array as a comma-separated list
|
* @return representation of the type array as a comma-separated list
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@ -164,14 +163,12 @@ public class ASTTypeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void appendArgumentList(ICPPTemplateArgument[] args, boolean normalize, StringBuilder result) {
|
private static void appendArgumentList(ICPPTemplateArgument[] args, boolean normalize, StringBuilder result) {
|
||||||
boolean first= true;
|
|
||||||
result.append('<');
|
result.append('<');
|
||||||
for (ICPPTemplateArgument arg : args) {
|
for (int i = 0; i < args.length; i++) {
|
||||||
if (!first) {
|
if (i != 0) {
|
||||||
result.append(',');
|
result.append(',');
|
||||||
}
|
}
|
||||||
first= false;
|
appendArgument(args[i], normalize, result);
|
||||||
appendArgument(arg, normalize, result);
|
|
||||||
}
|
}
|
||||||
result.append('>');
|
result.append('>');
|
||||||
}
|
}
|
||||||
|
@ -507,40 +504,41 @@ public class ASTTypeUtil {
|
||||||
*/
|
*/
|
||||||
public static void appendType(IType type, boolean normalize, StringBuilder result) {
|
public static void appendType(IType type, boolean normalize, StringBuilder result) {
|
||||||
IType[] types = new IType[DEAULT_ITYPE_SIZE];
|
IType[] types = new IType[DEAULT_ITYPE_SIZE];
|
||||||
|
int numTypes = 0;
|
||||||
|
|
||||||
// Push all of the types onto the stack
|
// Push all of the types onto the stack.
|
||||||
int i = 0;
|
int i = 0;
|
||||||
IQualifierType cvq= null;
|
IQualifierType cvq= null;
|
||||||
ICPPReferenceType ref= null;
|
ICPPReferenceType ref= null;
|
||||||
while (type != null && ++i < 100) {
|
while (type != null && ++i < 100) {
|
||||||
if (type instanceof ITypedef) {
|
if (type instanceof ITypedef) {
|
||||||
if (normalize) {
|
// If normalization was not requested, skip the typedef and proceed with its target
|
||||||
// Skip the typedef and proceed with its target type.
|
// type.
|
||||||
} else {
|
if (!normalize) {
|
||||||
// Output reference, qualifier and typedef, then stop.
|
// Output reference, qualifier and typedef, then stop.
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
types = ArrayUtil.append(IType.class, types, ref);
|
types = ArrayUtil.appendAt(types, numTypes++, ref);
|
||||||
ref= null;
|
ref= null;
|
||||||
}
|
}
|
||||||
if (cvq != null) {
|
if (cvq != null) {
|
||||||
types = ArrayUtil.append(IType.class, types, cvq);
|
types = ArrayUtil.appendAt(types, numTypes++, cvq);
|
||||||
cvq= null;
|
cvq= null;
|
||||||
}
|
}
|
||||||
types = ArrayUtil.append(IType.class, types, type);
|
types = ArrayUtil.appendAt(types, numTypes++, type);
|
||||||
type= null;
|
type= null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (type instanceof ICPPReferenceType) {
|
if (type instanceof ICPPReferenceType) {
|
||||||
// Reference types ignore cv-qualifiers
|
// Reference types ignore cv-qualifiers.
|
||||||
cvq= null;
|
cvq= null;
|
||||||
// Lvalue references win over rvalue references
|
// Lvalue references win over rvalue references.
|
||||||
if (ref == null || ref.isRValueReference()) {
|
if (ref == null || ref.isRValueReference()) {
|
||||||
// Delay reference to see if there are more
|
// Delay reference to see if there are more.
|
||||||
ref= (ICPPReferenceType) type;
|
ref= (ICPPReferenceType) type;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cvq != null) {
|
if (cvq != null) {
|
||||||
// Merge cv qualifiers
|
// Merge cv qualifiers.
|
||||||
if (type instanceof IQualifierType || type instanceof IPointerType) {
|
if (type instanceof IQualifierType || type instanceof IPointerType) {
|
||||||
type= SemanticUtil.addQualifiers(type, cvq.isConst(), cvq.isVolatile(), false);
|
type= SemanticUtil.addQualifiers(type, cvq.isConst(), cvq.isVolatile(), false);
|
||||||
cvq= null;
|
cvq= null;
|
||||||
|
@ -550,16 +548,16 @@ public class ASTTypeUtil {
|
||||||
// Delay cv qualifier to merge it with others
|
// Delay cv qualifier to merge it with others
|
||||||
cvq= (IQualifierType) type;
|
cvq= (IQualifierType) type;
|
||||||
} else {
|
} else {
|
||||||
// No reference, no cv qualifier: output reference and cv-qualifier
|
// No reference, no cv qualifier: output reference and cv-qualifier.
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
types = ArrayUtil.append(IType.class, types, ref);
|
types = ArrayUtil.appendAt(types, numTypes++, ref);
|
||||||
ref= null;
|
ref= null;
|
||||||
}
|
}
|
||||||
if (cvq != null) {
|
if (cvq != null) {
|
||||||
types = ArrayUtil.append(IType.class, types, cvq);
|
types = ArrayUtil.appendAt(types, numTypes++, cvq);
|
||||||
cvq= null;
|
cvq= null;
|
||||||
}
|
}
|
||||||
types = ArrayUtil.append(IType.class, types, type);
|
types = ArrayUtil.appendAt(types, numTypes++, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -572,12 +570,12 @@ public class ASTTypeUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pop all of the types off of the stack, and build the string representation while doing so.
|
// Pop all of the types from the stack, and build the string representation while doing so.
|
||||||
List<IType> postfix= null;
|
List<IType> postfix= null;
|
||||||
BitSet parenthesis= null;
|
BitSet parenthesis= null;
|
||||||
boolean needParenthesis= false;
|
boolean needParenthesis= false;
|
||||||
boolean needSpace= false;
|
boolean needSpace= false;
|
||||||
for (int j = types.length; --j >= 0;) {
|
for (int j = numTypes; --j >= 0;) {
|
||||||
IType tj = types[j];
|
IType tj = types[j];
|
||||||
if (tj != null) {
|
if (tj != null) {
|
||||||
if (j > 0 && types[j - 1] instanceof IQualifierType) {
|
if (j > 0 && types[j - 1] instanceof IQualifierType) {
|
||||||
|
@ -589,7 +587,7 @@ public class ASTTypeUtil {
|
||||||
needSpace= true;
|
needSpace= true;
|
||||||
--j;
|
--j;
|
||||||
} else {
|
} else {
|
||||||
// Handle post-fix
|
// Handle post-fix.
|
||||||
if (tj instanceof IFunctionType || tj instanceof IArrayType) {
|
if (tj instanceof IFunctionType || tj instanceof IArrayType) {
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
if (needSpace)
|
if (needSpace)
|
||||||
|
@ -639,7 +637,7 @@ public class ASTTypeUtil {
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public static String getType(IASTDeclarator declarator) {
|
public static String getType(IASTDeclarator declarator) {
|
||||||
// get the most nested declarator
|
// Get the most nested declarator.
|
||||||
while (declarator.getNestedDeclarator() != null) {
|
while (declarator.getNestedDeclarator() != null) {
|
||||||
declarator = declarator.getNestedDeclarator();
|
declarator = declarator.getNestedDeclarator();
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,79 +143,51 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return node instanceof IASTName ? new String(((IASTName) node).getSimpleID()) : CPPSemantics.EMPTY_NAME;
|
return node instanceof IASTName ? new String(((IASTName) node).getSimpleID()) : CPPSemantics.EMPTY_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return node instanceof IASTName ? ((IASTName) node).getSimpleID() : CharArrayUtils.EMPTY;
|
return node instanceof IASTName ? ((IASTName) node).getSimpleID() : CharArrayUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getScope() throws DOMException {
|
public IScope getScope() throws DOMException {
|
||||||
throw new DOMException(this);
|
throw new DOMException(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getPhysicalNode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IASTNode getPhysicalNode() {
|
public IASTNode getPhysicalNode() {
|
||||||
return getASTNode();
|
return getASTNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
// Don't clone problems
|
// Don't clone problems.
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getParent()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getParent() throws DOMException {
|
public IScope getParent() throws DOMException {
|
||||||
throw new DOMException(this);
|
throw new DOMException(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] find(String name) {
|
public IBinding[] find(String name) {
|
||||||
return IBinding.EMPTY_BINDING_ARRAY;
|
return IBinding.EMPTY_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getScopeName()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IName getScopeName() {
|
public IName getScopeName() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#addName(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void addName(IASTName name) {
|
public void addName(IASTName name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve) {
|
public IBinding getBinding(IASTName name, boolean resolve) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -226,37 +198,22 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
|
||||||
return IBinding.EMPTY_BINDING_ARRAY;
|
return IBinding.EMPTY_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
|
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #getBindings(ScopeLookupData)} instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
|
||||||
return getBindings(new ScopeLookupData(name, resolve, prefixLookup));
|
return getBindings(new ScopeLookupData(name, resolve, prefixLookup));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] getBindings(ScopeLookupData lookup) {
|
public IBinding[] getBindings(ScopeLookupData lookup) {
|
||||||
return IBinding.EMPTY_BINDING_ARRAY;
|
return IBinding.EMPTY_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return type == this;
|
return type == this;
|
||||||
|
@ -320,76 +277,99 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
|
||||||
public void removeNestedFromCache(IASTNode container) {
|
public void removeNestedFromCache(IASTNode container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dummy methods for derived classes
|
// Dummy methods for derived classes.
|
||||||
public IType getType() {
|
public IType getType() {
|
||||||
return new ProblemType(getID());
|
return new ProblemType(getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStatic() {
|
public boolean isStatic() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getQualifiedName() throws DOMException {
|
public String[] getQualifiedName() throws DOMException {
|
||||||
throw new DOMException(this);
|
throw new DOMException(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public char[][] getQualifiedNameCharArray() throws DOMException {
|
public char[][] getQualifiedNameCharArray() throws DOMException {
|
||||||
throw new DOMException(this);
|
throw new DOMException(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
throw new DOMException(this);
|
throw new DOMException(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMutable() {
|
public boolean isMutable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExtern() {
|
public boolean isExtern() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExternC() {
|
public boolean isExternC() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAuto() {
|
public boolean isAuto() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRegister() {
|
public boolean isRegister() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IValue getInitialValue() {
|
public IValue getInitialValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAnonymous() {
|
public boolean isAnonymous() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDeleted() {
|
public boolean isDeleted() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInline() {
|
public boolean isInline() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean takesVarArgs() {
|
public boolean takesVarArgs() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IType[] getExceptionSpecification() {
|
public IType[] getExceptionSpecification() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasParameterPack() {
|
public boolean hasParameterPack() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPureVirtual() {
|
public boolean isPureVirtual() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isImplicit() {
|
public boolean isImplicit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
public boolean isExplicit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasDefaultValue() {
|
public boolean hasDefaultValue() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IValue getDefaultValue() {
|
public IValue getDefaultValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isParameterPack() {
|
public boolean isParameterPack() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.IName;
|
import org.eclipse.cdt.core.dom.IName;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.EScopeKind;
|
import org.eclipse.cdt.core.dom.ast.EScopeKind;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
|
@ -84,7 +83,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getParent() throws DOMException {
|
public IScope getParent() {
|
||||||
//we can't just resolve the function and get its parent scope, since there are cases where that
|
//we can't just resolve the function and get its parent scope, since there are cases where that
|
||||||
//could loop since resolving functions requires resolving their parameter types
|
//could loop since resolving functions requires resolving their parameter types
|
||||||
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode();
|
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode();
|
||||||
|
|
|
@ -17,7 +17,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.IName;
|
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.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
@ -78,7 +77,7 @@ abstract public class CPPScope implements ICPPASTInternalScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getParent() throws DOMException {
|
public IScope getParent() {
|
||||||
return CPPVisitor.getContainingNonTemplateScope(physicalNode);
|
return CPPVisitor.getContainingNonTemplateScope(physicalNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ public class CPPScopeMapper {
|
||||||
public IBinding[] getBindings(ScopeLookupData lookup) {
|
public IBinding[] getBindings(ScopeLookupData lookup) {
|
||||||
return fScope.getBindings(lookup);
|
return fScope.getBindings(lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getParent() throws DOMException {
|
public IScope getParent() throws DOMException {
|
||||||
IScope parent= fScope.getParent();
|
IScope parent= fScope.getParent();
|
||||||
|
|
|
@ -14,15 +14,19 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Non API methods for cpp bindings.
|
* Non API methods for C++ bindings.
|
||||||
*/
|
*/
|
||||||
public interface ICPPInternalBinding extends ICPPBinding {
|
public interface ICPPInternalBinding extends ICPPBinding {
|
||||||
|
/**
|
||||||
|
* Returns the definition of the binding, or {@code null} if the binding doesn't have
|
||||||
|
* a definition.
|
||||||
|
*/
|
||||||
IASTNode getDefinition();
|
IASTNode getDefinition();
|
||||||
|
|
||||||
/** Implementors must keep the node with the lowest offset in declarations[0] */
|
/** Implementors must keep the node with the lowest offset in declarations[0] */
|
||||||
IASTNode[] getDeclarations();
|
IASTNode[] getDeclarations();
|
||||||
|
|
||||||
void addDefinition(IASTNode node);
|
void addDefinition(IASTNode node);
|
||||||
|
|
||||||
void addDeclaration(IASTNode node);
|
void addDeclaration(IASTNode node);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue