|
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.LoopBlock
This is the structured block for an Loop block.
Field Summary | |
static int |
DOWHILE
|
static Expression |
FALSE
|
static int |
FOR
|
static int |
POSSFOR
|
static Expression |
TRUE
|
static int |
WHILE
|
Constructor Summary | |
LoopBlock(int type,
Expression cond)
|
Method Summary | |
void |
checkDeclaration(java.util.Set declareSet)
Check if this is an local store instruction to a not yet declared variable. |
boolean |
conditionMatches(CombineableOperator combinable)
|
boolean |
doTransformations()
Do simple transformation on the structuredBlock. |
void |
dumpInstruction(TabbedPrintWriter writer)
Print the instruction expressing this structured block. |
void |
dumpSource(TabbedPrintWriter writer)
Print the source code for this structured block. |
Expression |
getCondition()
|
java.util.Set |
getDeclarables()
|
java.lang.String |
getLabel()
Returns the label of this block and creates a new label, if there wasn't a label previously. |
StructuredBlock |
getNextBlock(StructuredBlock subBlock)
Returns the block where the control will normally flow to, when the given sub block is finished (not ignoring the jump after this block). |
FlowBlock |
getNextFlowBlock(StructuredBlock subBlock)
|
StructuredBlock[] |
getSubBlocks()
Returns all sub block of this structured block. |
int |
getType()
|
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 is called after the analysis is completely done. |
void |
mergeBreakedStack(VariableStack stack)
Is called by BreakBlock, to tell us what the stack can be after a break. |
void |
mergeContinueStack(VariableStack stack)
Is called by BreakBlock, to tell us what the stack can be after a break. |
void |
removeLocallyDeclareable(java.util.Set set)
Remove all variables from set, that we can declare inside the loop-block. |
void |
removeOnetimeLocals()
This method should remove local variables that are only written and read one time directly after another. |
void |
removePush()
This is called after mapStackToLocal to do the stack to local transformation. |
void |
replaceBreakContinue(BreakableBlock block)
Replace all breaks to block with a continue to this. |
boolean |
replaceSubBlock(StructuredBlock oldBlock,
StructuredBlock newBlock)
Replaces the given sub block with a new block. |
void |
setBody(StructuredBlock body)
|
void |
setBreaked()
Is called by BreakBlock, to tell us that this block is breaked. |
void |
setCondition(Expression cond)
|
void |
setInit(InstructionBlock initBlock)
|
void |
setType(int type)
|
void |
simplify()
|
Methods inherited from class net.sf.jode.flow.StructuredBlock |
appendBlock, checkConsistent, contains, copyJump, fillInGenSet, flowMayBeChanged, getNextBlock, getNextFlowBlock, isEmpty, isSingleExit, moveJump, needsBraces, prependBlock, propagateUsage, removeBlock, removeJump, replace, setFlowBlock, setJump, setSuccessors, swapJump, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int WHILE
public static final int DOWHILE
public static final int FOR
public static final int POSSFOR
public static final Expression TRUE
public static final Expression FALSE
Constructor Detail |
public LoopBlock(int type, Expression cond)
Method Detail |
public StructuredBlock getNextBlock(StructuredBlock subBlock)
getNextBlock
in class StructuredBlock
public FlowBlock getNextFlowBlock(StructuredBlock subBlock)
getNextFlowBlock
in class StructuredBlock
public void setBody(StructuredBlock body)
public void setInit(InstructionBlock initBlock)
public boolean conditionMatches(CombineableOperator combinable)
public Expression getCondition()
public void setCondition(Expression cond)
public int getType()
public void setType(int type)
public boolean replaceSubBlock(StructuredBlock oldBlock, StructuredBlock newBlock)
replaceSubBlock
in class StructuredBlock
oldBlock
- the old sub block.newBlock
- the new sub block.
public StructuredBlock[] getSubBlocks()
getSubBlocks
in class StructuredBlock
public void removeLocallyDeclareable(java.util.Set set)
public java.util.Set getDeclarables()
getDeclarables
in class StructuredBlock
public void checkDeclaration(java.util.Set declareSet)
public void makeDeclaration(java.util.Set done)
makeDeclaration
in class StructuredBlock
done
- The set of the already declare variables.public void dumpSource(TabbedPrintWriter writer) throws java.io.IOException
StructuredBlock
dumpSource
in class StructuredBlock
writer
- The tabbed print writer, where we print to.
java.io.IOException
public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException
StructuredBlock
dumpInstruction
in class StructuredBlock
writer
- The tabbed print writer, where we print to.
java.io.IOException
public java.lang.String getLabel()
getLabel
in interface BreakableBlock
public void setBreaked()
setBreaked
in interface BreakableBlock
public VariableStack mapStackToLocal(VariableStack stack)
mapStackToLocal
in class StructuredBlock
stack
- the stack at begin of the block
public void mergeContinueStack(VariableStack stack)
public void mergeBreakedStack(VariableStack stack)
mergeBreakedStack
in interface BreakableBlock
stack
- the stack at the break.
public void removePush()
StructuredBlock
removePush
in class StructuredBlock
public void removeOnetimeLocals()
removeOnetimeLocals
in class StructuredBlock
public void replaceBreakContinue(BreakableBlock block)
block
- the breakable block where the breaks originally
breaked to (Have a break now, if you didn't understand that :-).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 |