instr.dumpExpression

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@699 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent c9c26784e7
commit bc4477a653
  1. 4
      jode/jode/flow/ConditionalBlock.java
  2. 4
      jode/jode/flow/IfThenElseBlock.java
  3. 8
      jode/jode/flow/ReturnBlock.java
  4. 4
      jode/jode/flow/ThrowBlock.java

@ -122,7 +122,9 @@ public class ConditionalBlock extends InstructionContainer {
public void dumpInstruction(TabbedPrintWriter writer) public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
writer.println("IF ("+instr.toString()+")"); writer.print("IF (");
instr.dumpExpression(writer);
writer.println(")");
writer.tab(); writer.tab();
trueBlock.dumpSource(writer); trueBlock.dumpSource(writer);
writer.untab(); writer.untab();

@ -140,7 +140,9 @@ public class IfThenElseBlock extends StructuredBlock {
throws java.io.IOException throws java.io.IOException
{ {
boolean needBrace = thenBlock.needsBraces(); boolean needBrace = thenBlock.needsBraces();
writer.print("if ("+cond.toString()+")"); writer.print("if (");
cond.dumpExpression(writer);
writer.print(")");
if (needBrace) if (needBrace)
writer.openBrace(); writer.openBrace();
else else

@ -74,7 +74,11 @@ public class ReturnBlock extends InstructionContainer {
public void dumpInstruction(TabbedPrintWriter writer) public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
writer.println("return" + writer.print("return");
(instr == null ? "" : " " + instr) + ";"); if (instr != null) {
writer.print(" ");
instr.dumpExpression(writer);
}
writer.println(";");
} }
} }

@ -32,6 +32,8 @@ public class ThrowBlock extends ReturnBlock {
public void dumpInstruction(TabbedPrintWriter writer) public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
writer.println("throw " + instr + ";"); writer.print("throw ");
instr.dumpExpression(writer);
writer.println(";");
} }
} }

Loading…
Cancel
Save