Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.flow
Class ConditionalBlock

java.lang.Object
  extended bynet.sf.jode.flow.StructuredBlock
      extended bynet.sf.jode.flow.InstructionContainer
          extended bynet.sf.jode.flow.ConditionalBlock

public class ConditionalBlock
extends InstructionContainer

An ConditionalBlock is the structured block representing an if instruction. The else part may be null.


Constructor Summary
ConditionalBlock(Expression cond)
          Creates a new if conditional block.
 
Method Summary
 void checkConsistent()
           
 boolean doTransformations()
          Do simple transformation on the structuredBlock.
 void dumpInstruction(TabbedPrintWriter writer)
          Print the source code for this structured block.
 StructuredBlock[] getSubBlocks()
          Returns all sub block of this structured block.
 VariableStack mapStackToLocal(VariableStack stack)
          This does take the instr into account and modifies stack accordingly.
 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 setSuccessors(Jump[] jumps)
          Sets the successors of this structured block.
 
Methods inherited from class net.sf.jode.flow.InstructionContainer
fillInGenSet, getDeclarables, getInstruction, makeDeclaration, removeOnetimeLocals, setInstruction, simplify
 
Methods inherited from class net.sf.jode.flow.StructuredBlock
appendBlock, contains, copyJump, dumpSource, flowMayBeChanged, getNextBlock, getNextBlock, getNextFlowBlock, getNextFlowBlock, isEmpty, isSingleExit, jumpMayBeChanged, moveJump, needsBraces, prependBlock, propagateUsage, removeBlock, removeJump, replace, setFlowBlock, setJump, swapJump, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalBlock

public ConditionalBlock(Expression cond)
Creates a new if conditional block.

Method Detail

checkConsistent

public void checkConsistent()
Overrides:
checkConsistent in class StructuredBlock

setSuccessors

public void setSuccessors(Jump[] jumps)
Sets the successors of this structured block. This should be only called once, by FlowBlock.setSuccessors().

Overrides:
setSuccessors in class StructuredBlock

getSubBlocks

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

Overrides:
getSubBlocks in class StructuredBlock

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.

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

dumpInstruction

public void dumpInstruction(TabbedPrintWriter writer)
                     throws java.io.IOException
Print the source code for this structured block.

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

doTransformations

public boolean doTransformations()
Description copied from class: StructuredBlock
Do simple transformation on the structuredBlock.

Overrides:
doTransformations in class InstructionContainer

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.