|
|
@ -29,8 +29,7 @@ public class ConditionalBlock extends InstructionContainer { |
|
|
|
EmptyBlock trueBlock; |
|
|
|
EmptyBlock trueBlock; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates a new if then else block. The method setThenBlock must |
|
|
|
* Creates a new if conditional block. |
|
|
|
* be called shortly after the creation. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ConditionalBlock(Expression cond, Jump condJump, Jump elseJump) { |
|
|
|
public ConditionalBlock(Expression cond, Jump condJump, Jump elseJump) { |
|
|
|
super(cond, elseJump); |
|
|
|
super(cond, elseJump); |
|
|
@ -41,6 +40,18 @@ public class ConditionalBlock extends InstructionContainer { |
|
|
|
trueBlock.outer = this; |
|
|
|
trueBlock.outer = this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new if conditional block. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public ConditionalBlock(Expression cond) { |
|
|
|
|
|
|
|
super(cond); |
|
|
|
|
|
|
|
/* cond is a CompareBinary or CompareUnary operator, so no |
|
|
|
|
|
|
|
* check for LocalVarOperator (for condJump) is needed here. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
trueBlock = new EmptyBlock(); |
|
|
|
|
|
|
|
trueBlock.outer = this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* The implementation of getNext[Flow]Block is the standard |
|
|
|
/* The implementation of getNext[Flow]Block is the standard |
|
|
|
* implementation |
|
|
|
* implementation |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -64,9 +75,7 @@ public class ConditionalBlock extends InstructionContainer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Print the source code for this structured block. This may be |
|
|
|
* Print the source code for this structured block. |
|
|
|
* called only once, because it remembers which local variables |
|
|
|
|
|
|
|
* were declared. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void dumpInstruction(TabbedPrintWriter writer) |
|
|
|
public void dumpInstruction(TabbedPrintWriter writer) |
|
|
|
throws java.io.IOException |
|
|
|
throws java.io.IOException |
|
|
|