mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
b4e5df991c
commit
d5fb2c9614
1 changed files with 21 additions and 23 deletions
|
@ -22,11 +22,10 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* While statement in c++.
|
* While statement in C++.
|
||||||
*/
|
*/
|
||||||
public class CPPASTWhileStatement extends ASTNode implements
|
public class CPPASTWhileStatement extends ASTNode
|
||||||
ICPPASTWhileStatement, IASTAmbiguityParent {
|
implements ICPPASTWhileStatement, IASTAmbiguityParent {
|
||||||
|
|
||||||
private IASTExpression condition;
|
private IASTExpression condition;
|
||||||
private IASTStatement body;
|
private IASTStatement body;
|
||||||
private IASTDeclaration condition2;
|
private IASTDeclaration condition2;
|
||||||
|
@ -96,23 +95,23 @@ public class CPPASTWhileStatement extends ASTNode implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept( ASTVisitor action ){
|
public boolean accept(ASTVisitor action) {
|
||||||
if( action.shouldVisitStatements ){
|
if (action.shouldVisitStatements) {
|
||||||
switch( action.visit( this ) ){
|
switch (action.visit(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT : return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
case ASTVisitor.PROCESS_SKIP : return true;
|
case ASTVisitor.PROCESS_SKIP: return true;
|
||||||
default : break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( condition != null ) if( !condition.accept( action ) ) return false;
|
if (condition != null && !condition.accept(action)) return false;
|
||||||
if( condition2 != null ) if( !condition2.accept( action ) ) return false;
|
if (condition2 != null && !condition2.accept(action)) return false;
|
||||||
if( body != null ) if( !body.accept( action ) ) return false;
|
if (body != null && !body.accept(action)) return false;
|
||||||
|
|
||||||
if( action.shouldVisitExpressions ){
|
if (action.shouldVisitExpressions) {
|
||||||
switch( action.leave( this ) ){
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT : return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
case ASTVisitor.PROCESS_SKIP : return true;
|
case ASTVisitor.PROCESS_SKIP: return true;
|
||||||
default : break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -134,9 +133,8 @@ public class CPPASTWhileStatement extends ASTNode implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
if( scope == null )
|
if (scope == null)
|
||||||
scope = new CPPBlockScope( this );
|
scope = new CPPBlockScope(this);
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue