mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
Cosmetics.
This commit is contained in:
parent
d5f6bfc0bd
commit
cf9f88cb44
1 changed files with 37 additions and 26 deletions
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* /
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
/*
|
/*
|
||||||
* Created on Apr 29, 2005
|
* Created on Apr 29, 2005
|
||||||
|
@ -30,15 +30,15 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class CPPSpecialization extends PlatformObject implements ICPPSpecialization, ICPPInternalBinding {
|
public abstract class CPPSpecialization extends PlatformObject
|
||||||
|
implements ICPPSpecialization, ICPPInternalBinding {
|
||||||
private IBinding specialized;
|
private IBinding specialized;
|
||||||
private ICPPScope scope;
|
private ICPPScope scope;
|
||||||
protected ObjectMap argumentMap;
|
protected ObjectMap argumentMap;
|
||||||
|
|
||||||
private IASTNode definition = null;
|
private IASTNode definition;
|
||||||
private IASTNode [] declarations = null;
|
private IASTNode[] declarations;
|
||||||
|
|
||||||
public CPPSpecialization(IBinding specialized, ICPPScope scope, ObjectMap argumentMap) {
|
public CPPSpecialization(IBinding specialized, ICPPScope scope, ObjectMap argumentMap) {
|
||||||
this.specialized = specialized;
|
this.specialized = specialized;
|
||||||
|
@ -59,9 +59,11 @@ public abstract class CPPSpecialization extends PlatformObject implements ICPPSp
|
||||||
public IBinding getSpecializedBinding() {
|
public IBinding getSpecializedBinding() {
|
||||||
return specialized;
|
return specialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTNode[] getDeclarations() {
|
public IASTNode[] getDeclarations() {
|
||||||
return declarations;
|
return declarations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTNode getDefinition() {
|
public IASTNode getDefinition() {
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
@ -69,12 +71,14 @@ public abstract class CPPSpecialization extends PlatformObject implements ICPPSp
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
definition = node;
|
definition = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
if( declarations == null )
|
if (declarations == null) {
|
||||||
declarations = new IASTNode[] { node };
|
declarations = new IASTNode[] { node };
|
||||||
else {
|
} else {
|
||||||
// keep the lowest offset declaration in [0]
|
// keep the lowest offset declaration in [0]
|
||||||
if( declarations.length > 0 && ((ASTNode)node).getOffset() < ((ASTNode)declarations[0]).getOffset() ){
|
if (declarations.length > 0 &&
|
||||||
|
((ASTNode) node).getOffset() < ((ASTNode) declarations[0]).getOffset()) {
|
||||||
declarations = (IASTNode[]) ArrayUtil.prepend(IASTNode.class, declarations, node);
|
declarations = (IASTNode[]) ArrayUtil.prepend(IASTNode.class, declarations, node);
|
||||||
} else {
|
} else {
|
||||||
declarations = (IASTNode[]) ArrayUtil.append(IASTNode.class, declarations, node);
|
declarations = (IASTNode[]) ArrayUtil.append(IASTNode.class, declarations, node);
|
||||||
|
@ -93,24 +97,31 @@ public abstract class CPPSpecialization extends PlatformObject implements ICPPSp
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return specialized.getName();
|
return specialized.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return specialized.getNameCharArray();
|
return specialized.getNameCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getQualifiedName() {
|
public String[] getQualifiedName() {
|
||||||
return CPPVisitor.getQualifiedName(this);
|
return CPPVisitor.getQualifiedName(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public char[][] getQualifiedNameCharArray() {
|
public char[][] getQualifiedNameCharArray() {
|
||||||
return CPPVisitor.getQualifiedNameCharArray(this);
|
return CPPVisitor.getQualifiedNameCharArray(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
return ((ICPPInternalBinding) specialized).isGloballyQualified();
|
return ((ICPPInternalBinding) specialized).isGloballyQualified();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return Linkage.CPP_LINKAGE;
|
return Linkage.CPP_LINKAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectMap getArgumentMap() {
|
public ObjectMap getArgumentMap() {
|
||||||
return argumentMap;
|
return argumentMap;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue