|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jode.flow.StructuredBlock
net.sf.jode.flow.IfThenElseBlock
An IfThenElseBlock is the structured block representing an if instruction. The else part may be null.
Constructor Summary | |
IfThenElseBlock(Expression cond)
Creates a new if then else block. |
Method Summary | |
boolean |
doTransformations()
Do simple transformation on the structuredBlock. |
void |
dumpInstruction(TabbedPrintWriter writer)
Print the source code for this structured block. |
java.util.Set |
getDeclarables()
|
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)
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 |
setElseBlock(StructuredBlock elseBlock)
Sets the else block. |
void |
setThenBlock(StructuredBlock thenBlock)
Sets the then block. |
void |
simplify()
|
Methods inherited from class net.sf.jode.flow.StructuredBlock |
appendBlock, checkConsistent, contains, copyJump, dumpSource, fillInGenSet, flowMayBeChanged, getNextBlock, getNextBlock, getNextFlowBlock, getNextFlowBlock, isEmpty, isSingleExit, moveJump, needsBraces, prependBlock, propagateUsage, removeBlock, removeJump, removeOnetimeLocals, replace, setFlowBlock, setJump, setSuccessors, swapJump, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IfThenElseBlock(Expression cond)
Method Detail |
public void setThenBlock(StructuredBlock thenBlock)
thenBlock
- the then block, must be non null.public void setElseBlock(StructuredBlock elseBlock)
elseBlock
- the else blockpublic boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock)
replaceSubBlock
in class StructuredBlock
oldBlock
- the old sub block.newBlock
- the new sub block.
public VariableStack mapStackToLocal(VariableStack stack)
mapStackToLocal
in class StructuredBlock
stack
- the stack before the instruction is called
public void removePush()
StructuredBlock
removePush
in class StructuredBlock
public java.util.Set getDeclarables()
getDeclarables
in class StructuredBlock
public void makeDeclaration(java.util.Set done)
makeDeclaration
in class StructuredBlock
done
- The set of the already declare variables.public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException
dumpInstruction
in class StructuredBlock
writer
- The tabbed print writer, where we print to.
java.io.IOException
public StructuredBlock[] getSubBlocks()
getSubBlocks
in class StructuredBlock
public boolean jumpMayBeChanged()
jumpMayBeChanged
in class StructuredBlock
public void simplify()
simplify
in class StructuredBlock
public boolean doTransformations()
StructuredBlock
doTransformations
in class StructuredBlock
|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |