|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jode.flow.StructuredBlock net.sf.jode.flow.IfThenElseBlock
public class 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. |
Expression |
getCondition()
Gets the condition. |
Set |
getDeclarables()
|
StructuredBlock |
getElseBlock()
|
StructuredBlock[] |
getSubBlocks()
Returns all sub block of this structured block. |
StructuredBlock |
getThenBlock()
|
boolean |
hasElse()
|
boolean |
jumpMayBeChanged()
Determines if there is a sub block, that flows through to the end of this block. |
void |
makeDeclaration(Set done)
Make the declarations, i.e. |
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, getBCELInstructions, getBytecodeInstructions, 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 Expression getCondition()
public void setThenBlock(StructuredBlock thenBlock)
thenBlock
- the then block, must be non null.public StructuredBlock getThenBlock()
public void setElseBlock(StructuredBlock elseBlock)
elseBlock
- the else blockpublic StructuredBlock getElseBlock()
public boolean hasElse()
public 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 Set getDeclarables()
getDeclarables
in class StructuredBlock
public void makeDeclaration(Set done)
makeDeclaration
in class StructuredBlock
done
- The set of the already declare variables.public void dumpInstruction(TabbedPrintWriter writer) throws IOException
dumpInstruction
in class StructuredBlock
writer
- The tabbed print writer, where we print to.
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |