|
|
@ -246,7 +246,7 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { |
|
|
|
/* special syntax for endless loops: */ |
|
|
|
/* special syntax for endless loops: */ |
|
|
|
writer.print("for (;;)"); |
|
|
|
writer.print("for (;;)"); |
|
|
|
else |
|
|
|
else |
|
|
|
writer.print("while ("+cond.simplify().toString()+")"); |
|
|
|
writer.print("while ("+cond.toString()+")"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case DOWHILE: |
|
|
|
case DOWHILE: |
|
|
|
writer.print("do"); |
|
|
|
writer.print("do"); |
|
|
@ -259,11 +259,11 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { |
|
|
|
init.getInstruction().getOperator()) |
|
|
|
init.getInstruction().getOperator()) |
|
|
|
.getLocalInfo().getType().getHint() |
|
|
|
.getLocalInfo().getType().getHint() |
|
|
|
+ " "); |
|
|
|
+ " "); |
|
|
|
writer.print(init.getInstruction().simplify().toString()); |
|
|
|
writer.print(init.getInstruction().toString()); |
|
|
|
} else |
|
|
|
} else |
|
|
|
writer.print("/**/"); |
|
|
|
writer.print("/**/"); |
|
|
|
writer.print("; "+cond.simplify().toString()+"; " |
|
|
|
writer.print("; "+cond.toString()+"; " |
|
|
|
+incr.getInstruction().simplify().toString()+")"); |
|
|
|
+incr.getInstruction().toString()+")"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (needBrace) |
|
|
|
if (needBrace) |
|
|
@ -439,8 +439,19 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { |
|
|
|
return mayChangeJump; |
|
|
|
return mayChangeJump; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void simplify() { |
|
|
|
|
|
|
|
cond = cond.simplify(); |
|
|
|
|
|
|
|
if (type == FOR) { |
|
|
|
|
|
|
|
incr.simplify(); |
|
|
|
|
|
|
|
if (init != null) |
|
|
|
|
|
|
|
init.simplify(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
super.simplify(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean doTransformations() { |
|
|
|
public boolean doTransformations() { |
|
|
|
return init == null && (type == FOR || type == POSSFOR) |
|
|
|
return init == null && (type == FOR || type == POSSFOR) |
|
|
|
&& CreateForInitializer.transform(this, flowBlock.lastModified); |
|
|
|
&& CreateForInitializer.transform(this, flowBlock.lastModified); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|