1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

fix to CPPASTForStatement constructor

This commit is contained in:
Mike Kucera 2008-03-05 15:09:29 +00:00
parent a5f83b394c
commit 1c53e978a3

View file

@ -30,16 +30,16 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
private IASTExpression iterationExpression; private IASTExpression iterationExpression;
private IASTStatement body, init; private IASTStatement body, init;
private IASTDeclaration cond_declaration; private IASTDeclaration condDeclaration;
public CPPASTForStatement() { public CPPASTForStatement() {
} }
public CPPASTForStatement(IASTStatement init, IASTDeclaration cond_declaration, public CPPASTForStatement(IASTStatement init, IASTDeclaration condDeclaration,
IASTExpression iterationExpression, IASTStatement body) { IASTExpression iterationExpression, IASTStatement body) {
setInitializerStatement(init); setInitializerStatement(init);
setConditionDeclaration(cond_declaration); setConditionDeclaration(condDeclaration);
setIterationExpression(iterationExpression); setIterationExpression(iterationExpression);
setBody(body); setBody(body);
} }
@ -47,7 +47,7 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
public CPPASTForStatement(IASTStatement init, IASTExpression condition, public CPPASTForStatement(IASTStatement init, IASTExpression condition,
IASTExpression iterationExpression, IASTStatement body) { IASTExpression iterationExpression, IASTStatement body) {
setInitializerStatement(init); setInitializerStatement(init);
setConditionExpression(iterationExpression); setConditionExpression(condition);
setIterationExpression(iterationExpression); setIterationExpression(iterationExpression);
setBody(body); setBody(body);
} }
@ -104,7 +104,7 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
} }
if( init != null ) if( !init.accept( action ) ) return false; if( init != null ) if( !init.accept( action ) ) return false;
if( condition != null ) if( !condition.accept( action ) ) return false; if( condition != null ) if( !condition.accept( action ) ) return false;
if( cond_declaration != null ) if( !cond_declaration.accept( action ) ) return false; if( condDeclaration != null ) if( !condDeclaration.accept( action ) ) return false;
if( iterationExpression != null ) if( !iterationExpression.accept( action ) ) return false; if( iterationExpression != null ) if( !iterationExpression.accept( action ) ) return false;
if( body != null ) if( !body.accept( action ) ) return false; if( body != null ) if( !body.accept( action ) ) return false;
@ -131,11 +131,11 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
other.setParent( child.getParent() ); other.setParent( child.getParent() );
condition = (IASTExpression) other; condition = (IASTExpression) other;
} }
if( child == cond_declaration ) if( child == condDeclaration )
{ {
other.setPropertyInParent( child.getPropertyInParent() ); other.setPropertyInParent( child.getPropertyInParent() );
other.setParent( child.getParent() ); other.setParent( child.getParent() );
cond_declaration = (IASTDeclaration) other; condDeclaration = (IASTDeclaration) other;
} }
if( child == iterationExpression ) if( child == iterationExpression )
@ -165,7 +165,7 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
} }
public void setConditionDeclaration(IASTDeclaration d) { public void setConditionDeclaration(IASTDeclaration d) {
cond_declaration = d; condDeclaration = d;
if (d != null) { if (d != null) {
d.setParent(this); d.setParent(this);
d.setPropertyInParent(CONDITION_DECLARATION); d.setPropertyInParent(CONDITION_DECLARATION);
@ -173,6 +173,6 @@ public class CPPASTForStatement extends CPPASTNode implements ICPPASTForStatemen
} }
public IASTDeclaration getConditionDeclaration() { public IASTDeclaration getConditionDeclaration() {
return cond_declaration; return condDeclaration;
} }
} }