Expression rework (ComplexExpression removed)

not a CatchBlock any more


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@771 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent afd13f2bf5
commit 19c90b0a4c
  1. 43
      jode/jode/flow/FinallyBlock.java

@ -23,11 +23,50 @@ package jode.flow;
* *
* @author Jochen Hoenicke * @author Jochen Hoenicke
*/ */
public class FinallyBlock extends CatchBlock { public class FinallyBlock extends StructuredBlock {
/**
* The catch block.
*/
StructuredBlock subBlock;
public FinallyBlock() { public FinallyBlock() {
} }
/**
* Sets the catch block.
* @param subBlock the catch block.
*/
public void setCatchBlock(StructuredBlock subBlock) {
this.subBlock = subBlock;
subBlock.outer = this;
subBlock.setFlowBlock(flowBlock);
}
/* The implementation of getNext[Flow]Block is the standard
* implementation */
/**
* Replaces the given sub block with a new block.
* @param oldBlock the old sub block.
* @param newBlock the new sub block.
* @return false, if oldBlock wasn't a direct sub block.
*/
public boolean replaceSubBlock(StructuredBlock oldBlock,
StructuredBlock newBlock) {
if (subBlock == oldBlock)
subBlock = newBlock;
else
return false;
return true;
}
/**
* Returns all sub block of this structured block.
*/
public StructuredBlock[] getSubBlocks() {
return new StructuredBlock[] { subBlock };
}
/** /**
* Returns the block where the control will normally flow to, when * Returns the block where the control will normally flow to, when
* the given sub block is finished (<em>not</em> ignoring the jump * the given sub block is finished (<em>not</em> ignoring the jump
@ -51,7 +90,7 @@ public class FinallyBlock extends CatchBlock {
writer.print("finally"); writer.print("finally");
writer.openBrace(); writer.openBrace();
writer.tab(); writer.tab();
catchBlock.dumpSource(writer); subBlock.dumpSource(writer);
writer.untab(); writer.untab();
} }
} }

Loading…
Cancel
Save