mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
da074afa86
commit
d3fcfea8f1
6 changed files with 110 additions and 98 deletions
|
@ -54,12 +54,14 @@ public class CEnumerator extends PlatformObject implements IEnumerator {
|
|||
public IASTNode getPhysicalNode() {
|
||||
return enumeratorName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return enumeratorName.toString();
|
||||
}
|
||||
|
||||
public char[] getNameCharArray() {
|
||||
return enumeratorName.toCharArray();
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public class CField extends CVariable implements IField {
|
|||
throw new DOMException(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
*/
|
||||
|
@ -43,5 +44,4 @@ public class CField extends CVariable implements IField {
|
|||
ICCompositeTypeScope scope = (ICCompositeTypeScope) getScope();
|
||||
return scope.getCompositeType();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,9 +44,11 @@ public class CLabel extends PlatformObject implements ILabel {
|
|||
labelStatement = statement;
|
||||
statement.setBinding(this);
|
||||
}
|
||||
|
||||
public IASTNode getPhysicalNode() {
|
||||
return labelStatement;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.ILabel#getLabelStatement()
|
||||
*/
|
||||
|
@ -60,6 +62,7 @@ public class CLabel extends PlatformObject implements ILabel {
|
|||
public String getName() {
|
||||
return labelStatement.toString();
|
||||
}
|
||||
|
||||
public char[] getNameCharArray() {
|
||||
return labelStatement.toCharArray();
|
||||
}
|
||||
|
|
|
@ -88,8 +88,7 @@ public class CParameter extends PlatformObject implements IParameter {
|
|||
node = node.getParent();
|
||||
|
||||
if (node.getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER ||
|
||||
node instanceof IASTFunctionDefinition )
|
||||
{
|
||||
node instanceof IASTFunctionDefinition) {
|
||||
return declarations[i];
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +106,7 @@ public class CParameter extends PlatformObject implements IParameter {
|
|||
return name.toString();
|
||||
return CVisitor.EMPTY_STRING;
|
||||
}
|
||||
|
||||
public char[] getNameCharArray() {
|
||||
IASTName name = getPrimaryDeclaration();
|
||||
if (name != null)
|
||||
|
|
|
@ -73,9 +73,9 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
|
|||
private ICompositeType typeInIndex;
|
||||
|
||||
public CStructure(IASTName name) {
|
||||
if( name.getPropertyInParent() == IASTCompositeTypeSpecifier.TYPE_NAME )
|
||||
if (name.getPropertyInParent() == IASTCompositeTypeSpecifier.TYPE_NAME) {
|
||||
definition = name;
|
||||
else {
|
||||
} else {
|
||||
declarations = new IASTName[] { name };
|
||||
}
|
||||
name.setBinding(this);
|
||||
|
|
|
@ -95,6 +95,7 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
|
|||
public String getName() {
|
||||
return declarations[0].toString();
|
||||
}
|
||||
|
||||
public char[] getNameCharArray() {
|
||||
return declarations[0].toCharArray();
|
||||
}
|
||||
|
@ -131,18 +132,21 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IVariable#isExtern()
|
||||
*/
|
||||
public boolean isExtern() {
|
||||
return hasStorageClass(IASTDeclSpecifier.sc_extern);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
|
||||
*/
|
||||
public boolean isAuto() {
|
||||
return hasStorageClass(IASTDeclSpecifier.sc_auto);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
|
||||
*/
|
||||
|
@ -153,12 +157,15 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
|
|||
public ILinkage getLinkage() {
|
||||
return Linkage.C_LINKAGE;
|
||||
}
|
||||
|
||||
public IASTNode[] getDeclarations() {
|
||||
return declarations;
|
||||
}
|
||||
|
||||
public IASTNode getDefinition() {
|
||||
return getPhysicalNode();
|
||||
}
|
||||
|
||||
public IBinding getOwner() throws DOMException {
|
||||
if (declarations == null || declarations.length == 0)
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue