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