1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-04-17 05:44:42 +00:00
parent cf077ca4a0
commit ead2883d1c

View file

@ -22,17 +22,15 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
/**
* Switch statement in c++.
* Switch statement in C++.
*/
public class CPPASTSwitchStatement extends ASTNode implements
ICPPASTSwitchStatement, IASTAmbiguityParent {
public class CPPASTSwitchStatement extends ASTNode
implements ICPPASTSwitchStatement, IASTAmbiguityParent {
private IScope scope;
private IASTExpression controllerExpression;
private IASTDeclaration controllerDeclaration;
private IASTStatement body;
public CPPASTSwitchStatement() {
}
@ -52,10 +50,10 @@ public class CPPASTSwitchStatement extends ASTNode implements
public CPPASTSwitchStatement copy(CopyStyle style) {
CPPASTSwitchStatement copy = new CPPASTSwitchStatement();
copy.setControllerDeclaration(controllerDeclaration == null ? null : controllerDeclaration
.copy(style));
copy.setControllerExpression(controllerExpression == null ? null : controllerExpression
.copy(style));
copy.setControllerDeclaration(controllerDeclaration == null ?
null : controllerDeclaration.copy(style));
copy.setControllerExpression(controllerExpression == null ?
null : controllerExpression.copy(style));
copy.setBody(body == null ? null : body.copy(style));
copy.setOffsetAndLength(this);
if (style == CopyStyle.withLocations) {
@ -100,9 +98,9 @@ public class CPPASTSwitchStatement extends ASTNode implements
default: break;
}
}
if( controllerExpression != null ) if( !controllerExpression.accept( action ) ) return false;
if( controllerDeclaration != null ) if( !controllerDeclaration.accept( action ) ) return false;
if( body != null ) if( !body.accept( action ) ) return false;
if (controllerExpression != null && !controllerExpression.accept(action)) return false;
if (controllerDeclaration != null && !controllerDeclaration.accept(action)) return false;
if (body != null && !body.accept(action)) return false;
if (action.shouldVisitStatements) {
switch (action.leave(this)) {
@ -147,5 +145,4 @@ public class CPPASTSwitchStatement extends ASTNode implements
scope = new CPPBlockScope(this);
return scope;
}
}