mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Cosmetics.
This commit is contained in:
parent
626c0cdaf3
commit
c0486260cc
9 changed files with 78 additions and 92 deletions
|
@ -17,8 +17,8 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface IASTGotoStatement extends IASTStatement, IASTNameOwner {
|
||||
|
||||
public static final ASTNodeProperty NAME = new ASTNodeProperty("IASTGotoStatement.NAME - Name for IASTGotoStatement"); //$NON-NLS-1$
|
||||
public static final ASTNodeProperty NAME =
|
||||
new ASTNodeProperty("IASTGotoStatement.NAME - Name for IASTGotoStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Returns the name of the label. The name resolves to a ILabel binding.
|
||||
|
@ -46,5 +46,4 @@ public interface IASTGotoStatement extends IASTStatement, IASTNameOwner {
|
|||
*/
|
||||
@Override
|
||||
public IASTGotoStatement copy(CopyStyle style);
|
||||
|
||||
}
|
||||
|
|
|
@ -24,9 +24,7 @@ import org.eclipse.cdt.core.parser.IToken;
|
|||
* @noextend This interface is not intended to be extended by clients.
|
||||
*/
|
||||
public interface IASTNode {
|
||||
/**
|
||||
* @since 5.3
|
||||
*/
|
||||
/** @since 5.3 */
|
||||
public enum CopyStyle {
|
||||
/**
|
||||
* Copy without location, this copy is independent of the index and can be shared.
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
|||
* @author jcamelon
|
||||
*/
|
||||
public class CASTContinueStatement extends ASTNode implements IASTContinueStatement {
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitStatements) {
|
||||
|
|
|
@ -23,11 +23,9 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
|||
* @author jcamelon
|
||||
*/
|
||||
public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, IASTAmbiguityParent {
|
||||
|
||||
private IASTName name;
|
||||
private IASTStatement nestedStatement;
|
||||
|
||||
|
||||
public CASTLabelStatement() {
|
||||
}
|
||||
|
||||
|
@ -77,8 +75,8 @@ public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, I
|
|||
default: break;
|
||||
}
|
||||
}
|
||||
if( name != null ) if( !name.accept( action ) ) return false;
|
||||
if( nestedStatement != null ) if( !nestedStatement.accept( action ) ) return false;
|
||||
if (name != null && !name.accept(action)) return false;
|
||||
if (nestedStatement != null && !nestedStatement.accept(action)) return false;
|
||||
if (action.shouldVisitStatements) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
|
@ -89,10 +87,10 @@ public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, I
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRoleForName(IASTName n) {
|
||||
if( n == name ) return r_declaration;
|
||||
if (n == name)
|
||||
return r_declaration;
|
||||
return r_unclear;
|
||||
}
|
||||
|
||||
|
@ -113,12 +111,10 @@ public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, I
|
|||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if( child == nestedStatement )
|
||||
{
|
||||
if (child == nestedStatement) {
|
||||
other.setParent(this);
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
setNestedStatement((IASTStatement) other);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
|
|||
* Represents a literal
|
||||
*/
|
||||
public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpression {
|
||||
|
||||
private int kind;
|
||||
private char[] value = CharArrayUtils.EMPTY;
|
||||
|
||||
|
|
|
@ -23,11 +23,9 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
|||
* @author jcamelon
|
||||
*/
|
||||
public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, IASTAmbiguityParent {
|
||||
|
||||
private IASTExpression condition;
|
||||
private IASTStatement body;
|
||||
|
||||
|
||||
public CASTWhileStatement() {
|
||||
}
|
||||
|
||||
|
@ -92,8 +90,8 @@ public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, I
|
|||
default: break;
|
||||
}
|
||||
}
|
||||
if( condition != null ) if( !condition.accept( action ) ) return false;
|
||||
if( body != null ) if( !body.accept( action ) ) return false;
|
||||
if (condition != null && !condition.accept(action)) return false;
|
||||
if (body != null && !body.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitStatements) {
|
||||
switch (action.leave(this)) {
|
||||
|
@ -107,14 +105,12 @@ public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, I
|
|||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if( body == child )
|
||||
{
|
||||
if (body == child) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
body = (IASTStatement) other;
|
||||
}
|
||||
if( child == condition )
|
||||
{
|
||||
if (child == condition) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
condition = (IASTExpression) other;
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
|||
* @author jcamelon
|
||||
*/
|
||||
public class CPPASTContinueStatement extends ASTNode implements IASTContinueStatement {
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitStatements) {
|
||||
|
|
|
@ -1812,7 +1812,7 @@ public class CPPSemantics {
|
|||
return new CPPCompositeBinding(result);
|
||||
}
|
||||
|
||||
static public boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) {
|
||||
public static boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) {
|
||||
if (node == null)
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue