Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.flow
Class CatchBlock

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

public class CatchBlock
extends StructuredBlock

Author:
Jochen Hoenicke

Constructor Summary
CatchBlock(Type type)
           
 
Method Summary
 boolean combineLocal()
          Check if this is an local store instruction to a not yet declared variable.
 void dumpInstruction(TabbedPrintWriter writer)
          Print the instruction expressing this structured block.
 java.util.Set getDeclarables()
           
 Type getExceptionType()
           
 LocalInfo getLocal()
           
 StructuredBlock[] getSubBlocks()
          Returns all sub block of this structured block.
 boolean jumpMayBeChanged()
          Determines if there is a sub block, that flows through to the end of this block.
 void makeDeclaration(java.util.Set done)
          Make the declarations, i.e. initialize the declare variable to correct values.
 VariableStack mapStackToLocal(VariableStack stack)
          A catch block pushes the exception on the stack, iff a local doesn't exists.
 void removePush()
          This is called after mapStackToLocal to do the stack to local transformation.
 boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock)
          Replaces the given sub block with a new block.
 void setCatchBlock(StructuredBlock catchBlock)
          Sets the catch block.
 
Methods inherited from class net.sf.jode.flow.StructuredBlock
appendBlock, checkConsistent, contains, copyJump, doTransformations, dumpSource, fillInGenSet, flowMayBeChanged, getNextBlock, getNextBlock, getNextFlowBlock, getNextFlowBlock, isEmpty, isSingleExit, moveJump, needsBraces, prependBlock, propagateUsage, removeBlock, removeJump, removeOnetimeLocals, 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

CatchBlock

public CatchBlock(Type type)
Method Detail

getExceptionType

public Type getExceptionType()

getLocal

public LocalInfo getLocal()

setCatchBlock

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

Parameters:
catchBlock - 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 catch block pushes the exception on the stack, iff a local doesn't exists.

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

removePush

public void removePush()
Description copied from class: StructuredBlock
This is called after mapStackToLocal to do the stack to local transformation.

Overrides:
removePush in class StructuredBlock

getDeclarables

public java.util.Set getDeclarables()
Overrides:
getDeclarables in class StructuredBlock

makeDeclaration

public void makeDeclaration(java.util.Set done)
Make the declarations, i.e. initialize the declare variable to correct values. This will declare every variable that is marked as used, but not done.

Overrides:
makeDeclaration in class StructuredBlock
Parameters:
done - The set of the already declare variables.

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

jumpMayBeChanged

public boolean jumpMayBeChanged()
Determines if there is a sub block, that flows through to the end of this block. If this returns true, you know that jump is null.

Overrides:
jumpMayBeChanged in class StructuredBlock
Returns:
true, if the jump may be safely changed.

combineLocal

public boolean combineLocal()
Check if this is an local store instruction to a not yet declared variable. In that case mark this as declaration and return the variable.


Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.