Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.flow
Class FinallyBlock

java.lang.Object
  extended bynet.sf.jode.flow.StructuredBlock
      extended bynet.sf.jode.flow.FinallyBlock

public class FinallyBlock
extends StructuredBlock

Author:
Jochen Hoenicke

Constructor Summary
FinallyBlock()
           
 
Method Summary
 void dumpInstruction(TabbedPrintWriter writer)
          Print the instruction expressing this structured block.
 StructuredBlock getNextBlock(StructuredBlock subBlock)
          Returns the block where the control will normally flow to, when the given sub block is finished (not ignoring the jump after this block).
 FlowBlock getNextFlowBlock(StructuredBlock subBlock)
           
 StructuredBlock[] getSubBlocks()
          Returns all sub block of this structured block.
 VariableStack mapStackToLocal(VariableStack stack)
          A finally block starts with empty stack.
 boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock)
          Replaces the given sub block with a new block.
 void setCatchBlock(StructuredBlock subBlock)
          Sets the catch block.
 
Methods inherited from class net.sf.jode.flow.StructuredBlock
appendBlock, checkConsistent, contains, copyJump, doTransformations, dumpSource, fillInGenSet, flowMayBeChanged, getDeclarables, getNextBlock, getNextFlowBlock, isEmpty, isSingleExit, jumpMayBeChanged, makeDeclaration, moveJump, needsBraces, prependBlock, propagateUsage, removeBlock, removeJump, removeOnetimeLocals, removePush, replace, setFlowBlock, setJump, setSuccessors, simplify, swapJump, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FinallyBlock

public FinallyBlock()
Method Detail

setCatchBlock

public void setCatchBlock(StructuredBlock subBlock)
Sets the catch block.

Parameters:
subBlock - the catch block.

replaceSubBlock

public boolean replaceSubBlock(StructuredBlock oldBlock,
                               StructuredBlock newBlock)
Replaces the given sub block with a new block.

Overrides:
replaceSubBlock in class StructuredBlock
Parameters:
oldBlock - the old sub block.
newBlock - the new sub block.
Returns:
false, if oldBlock wasn't a direct sub block.

getSubBlocks

public StructuredBlock[] getSubBlocks()
Returns all sub block of this structured block.

Overrides:
getSubBlocks in class StructuredBlock

mapStackToLocal

public VariableStack mapStackToLocal(VariableStack stack)
A finally block starts with empty stack. It must return with empty stack too, but that need not to be checked. If the JSR's aren't correctly determined this may even not be true.

Overrides:
mapStackToLocal in class StructuredBlock
Parameters:
stack - the stack before the instruction is called
Returns:
stack the stack afterwards.

getNextBlock

public StructuredBlock getNextBlock(StructuredBlock subBlock)
Returns the block where the control will normally flow to, when the given sub block is finished (not ignoring the jump after this block). FinallyBlock have a special behaviour, since the finally block has no default successor at all (it is more a subroutine) that will be called by try or any exception.

Overrides:
getNextBlock in class StructuredBlock
Returns:
null, if the control flows to another FlowBlock.

getNextFlowBlock

public FlowBlock getNextFlowBlock(StructuredBlock subBlock)
Overrides:
getNextFlowBlock in class StructuredBlock

dumpInstruction

public void dumpInstruction(TabbedPrintWriter writer)
                     throws java.io.IOException
Description copied from class: StructuredBlock
Print the instruction expressing this structured block.

Specified by:
dumpInstruction in class StructuredBlock
Parameters:
writer - The tabbed print writer, where we print to.
Throws:
java.io.IOException

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.