net.sf.jode.flow
Class ReturnBlock

java.lang.Object
  extended by net.sf.jode.flow.StructuredBlock
      extended by net.sf.jode.flow.InstructionContainer
          extended by net.sf.jode.flow.ReturnBlock
Direct Known Subclasses:
ThrowBlock

public class ReturnBlock
extends InstructionContainer

This is the structured block for a Return block.


Constructor Summary
ReturnBlock()
           
ReturnBlock(Expression instr)
           
ReturnBlock(Instruction bytecodeInstr, Expression instr)
           
 
Method Summary
 void checkConsistent()
           
 void dumpInstruction(TabbedPrintWriter writer)
          Print the instruction expressing this structured block.
 boolean jumpMayBeChanged()
           
 VariableStack mapStackToLocal(VariableStack stack)
          This does take the instr into account and modifies stack accordingly.
 boolean needsBraces()
          Tells if this block needs braces when used in a if or while block.
 void removePush()
          This is called after mapStackToLocal to do the stack to local transformation.
 
Methods inherited from class net.sf.jode.flow.InstructionContainer
doTransformations, fillInGenSet, getDeclarables, getInstruction, makeDeclaration, removeOnetimeLocals, setInstruction, simplify
 
Methods inherited from class net.sf.jode.flow.StructuredBlock
appendBlock, contains, copyJump, dumpSource, flowMayBeChanged, getBCELInstructions, getBytecodeInstructions, getNextBlock, getNextBlock, getNextFlowBlock, getNextFlowBlock, getSubBlocks, isEmpty, isSingleExit, moveJump, prependBlock, propagateUsage, removeBlock, removeJump, replace, replaceSubBlock, setFlowBlock, setJump, setSuccessors, swapJump, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReturnBlock

public ReturnBlock()

ReturnBlock

public ReturnBlock(Expression instr)

ReturnBlock

public ReturnBlock(Instruction bytecodeInstr,
                   Expression instr)
Method Detail

jumpMayBeChanged

public boolean jumpMayBeChanged()
Overrides:
jumpMayBeChanged in class StructuredBlock

checkConsistent

public void checkConsistent()
Overrides:
checkConsistent in class StructuredBlock

mapStackToLocal

public VariableStack mapStackToLocal(VariableStack stack)
This does take the instr into account and modifies stack accordingly. It then calls super.mapStackToLocal.

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

needsBraces

public boolean needsBraces()
Tells if this block needs braces when used in a if or while block.

Overrides:
needsBraces in class StructuredBlock
Returns:
true if this block should be sorrounded by braces.

dumpInstruction

public void dumpInstruction(TabbedPrintWriter writer)
                     throws 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:
IOException