new empty constructor

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@201 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 6c046404d6
commit 8fab80629c
  1. 19
      jode/jode/flow/ConditionalBlock.java

@ -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

Loading…
Cancel
Save