diff options
author | Sergey Prigogin | 2012-04-12 23:40:08 +0000 |
---|---|---|
committer | Sergey Prigogin | 2012-04-13 00:21:02 +0000 |
commit | f02e178d5229b6d4d32c34d1e97dac52a6eeeadd (patch) | |
tree | cb74e2b6c2c31bd42a39064f6fdecc9df85bfcd2 /upc | |
parent | df5940c5fae1887ea7780c3a1b17b5593ff491e6 (diff) | |
download | org.eclipse.cdt-f02e178d5229b6d4d32c34d1e97dac52a6eeeadd.tar.gz org.eclipse.cdt-f02e178d5229b6d4d32c34d1e97dac52a6eeeadd.tar.xz org.eclipse.cdt-f02e178d5229b6d4d32c34d1e97dac52a6eeeadd.zip |
Cosmetics.
Diffstat (limited to 'upc')
2 files changed, 31 insertions, 46 deletions
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java index 1fb52781b78..9b85e452595 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.upc.ast; @@ -18,11 +18,9 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTForStatement; @SuppressWarnings("restriction") public class UPCASTForallStatement extends CASTForStatement implements IUPCASTForallStatement { - private IASTExpression affinity; private boolean affinityContinue; - public UPCASTForallStatement() { } @@ -40,15 +38,14 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo @Override public UPCASTForallStatement copy(CopyStyle style) { UPCASTForallStatement copy = new UPCASTForallStatement(); - copyForStatement(copy, style); copy.setAffinityExpression(affinity == null ? null : affinity.copy(style)); + copyForStatement(copy, style); if (style == CopyStyle.withLocations) { copy.setCopyLocation(this); } return copy; } - @Override public boolean isAffinityContinue() { return affinityContinue; @@ -61,10 +58,10 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo @Override public void setAffinityExpression(IASTExpression affinity) { - if(affinity != null) + if (affinity != null) this.affinityContinue = false; this.affinity = affinity; - if(affinity != null) { + if (affinity != null) { affinity.setParent(this); affinity.setPropertyInParent(AFFINITY); } @@ -72,43 +69,40 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo @Override public void setAffinityContinue(boolean affinityContinue) { - if(affinityContinue) + if (affinityContinue) this.affinity = null; this.affinityContinue = affinityContinue; } - @Override public boolean accept(ASTVisitor visitor) { - if(visitor.shouldVisitStatements) { - switch(visitor.visit(this)){ - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; + if (visitor.shouldVisitStatements) { + switch (visitor.visit(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; } } IASTStatement initializer = super.getInitializerStatement(); - if(initializer != null) if(!initializer.accept(visitor)) return false; + if (initializer != null && !initializer.accept(visitor)) return false; IASTExpression condition = super.getConditionExpression(); - if(condition != null) if(!condition.accept(visitor)) return false; + if (condition != null && !condition.accept(visitor)) return false; IASTExpression iteration = super.getIterationExpression(); - if(iteration != null) if(!iteration.accept(visitor)) return false; + if (iteration != null && !iteration.accept(visitor)) return false; - if(affinity != null) if(!affinity.accept(visitor)) return false; + if (affinity != null && !affinity.accept(visitor)) return false; IASTStatement body = super.getBody(); - if(body != null) if(!body.accept(visitor)) return false; + if (body != null && !body.accept(visitor)) return false; - if(visitor.shouldVisitStatements) { - switch(visitor.leave(this)){ - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; + if (visitor.shouldVisitStatements) { + switch (visitor.leave(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; } } - return true; } - } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java index 7af6f97da17..9058c8aa904 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.upc.ast; @@ -17,10 +17,8 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; @SuppressWarnings("restriction") public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSynchronizationStatement { - private int statmentKind; - private IASTExpression barrierExpression = null; - + private IASTExpression barrierExpression; public UPCASTSynchronizationStatement() { } @@ -41,7 +39,7 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy copy.statmentKind = statmentKind; copy.setBarrierExpression(barrierExpression == null ? null : barrierExpression.copy(style)); copy.setOffsetAndLength(this); - if(style == CopyStyle.withLocations) { + if (style == CopyStyle.withLocations) { copy.setCopyLocation(this); } return copy; @@ -60,7 +58,7 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy @Override public void setBarrierExpression(IASTExpression expr) { this.barrierExpression = expr; - if(expr != null) { + if (expr != null) { expr.setParent(this); expr.setPropertyInParent(BARRIER_EXPRESSION); } @@ -71,30 +69,23 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy this.statmentKind = kind; } - @Override public boolean accept(ASTVisitor visitor) { - if(visitor.shouldVisitStatements) { - switch(visitor.visit(this)) { - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; + if (visitor.shouldVisitStatements) { + switch (visitor.visit(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; } } - if(barrierExpression != null) { - boolean abort = !barrierExpression.accept(visitor); - if(abort) - return false; - } + if (barrierExpression != null && !barrierExpression.accept(visitor)) return false; - if(visitor.shouldVisitStatements) { - switch(visitor.leave(this)) { - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; + if (visitor.shouldVisitStatements) { + switch (visitor.leave(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; } } - return true; } - }
\ No newline at end of file |