Class ConditionalBlockImpl
- java.lang.Object
-
- org.checkerframework.dataflow.cfg.block.BlockImpl
-
- org.checkerframework.dataflow.cfg.block.ConditionalBlockImpl
-
- All Implemented Interfaces:
Block,ConditionalBlock,org.plumelib.util.UniqueId
public class ConditionalBlockImpl extends BlockImpl implements ConditionalBlock
Implementation of a conditional basic block.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.checkerframework.dataflow.cfg.block.Block
Block.BlockType
-
-
Field Summary
Fields Modifier and Type Field Description protected Store.FlowRuleelseFlowRuleThe initial value says that the ELSE store before a conditional block flows to BOTH of the stores of the else successor.protected @Nullable BlockImplelseSuccessorSuccessor of the else branch.protected Store.FlowRulethenFlowRuleThe initial value says that the THEN store before a conditional block flows to BOTH of the stores of the then successor.protected @Nullable BlockImplthenSuccessorSuccessor of the then branch.-
Fields inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
predecessors, type
-
-
Constructor Summary
Constructors Constructor Description ConditionalBlockImpl()Initialize an empty conditional basic block to be filled with contents and linked to other basic blocks later.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Store.FlowRulegetElseFlowRule()Returns the flow rule for information flowing from this block to its else successor.BlockgetElseSuccessor()Returns the entry block of the else branch.@Nullable NodegetLastNode()Returns the last node of this block, or null if none.java.util.List<Node>getNodes()Returns the nodes contained within this basic block.java.util.Set<Block>getSuccessors()Returns the successors of this basic block.Store.FlowRulegetThenFlowRule()Returns the flow rule for information flowing from this block to its then successor.BlockgetThenSuccessor()Returns the entry block of the then branch.voidsetElseFlowRule(Store.FlowRule rule)Set the flow rule for information flowing from this block to its else successor.voidsetElseSuccessor(BlockImpl b)Set the else branch successor.voidsetThenFlowRule(Store.FlowRule rule)Set the flow rule for information flowing from this block to its then successor.voidsetThenSuccessor(BlockImpl b)Set the then branch successor.java.lang.StringtoString()-
Methods inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
addPredecessor, getPredecessors, getType, getUid, removePredecessor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.checkerframework.dataflow.cfg.block.Block
getPredecessors, getType
-
-
-
-
Field Detail
-
thenFlowRule
protected Store.FlowRule thenFlowRule
The initial value says that the THEN store before a conditional block flows to BOTH of the stores of the then successor.
-
elseFlowRule
protected Store.FlowRule elseFlowRule
The initial value says that the ELSE store before a conditional block flows to BOTH of the stores of the else successor.
-
-
Method Detail
-
setThenSuccessor
public void setThenSuccessor(BlockImpl b)
Set the then branch successor.
-
setElseSuccessor
public void setElseSuccessor(BlockImpl b)
Set the else branch successor.
-
getThenSuccessor
public Block getThenSuccessor()
Description copied from interface:ConditionalBlockReturns the entry block of the then branch.- Specified by:
getThenSuccessorin interfaceConditionalBlock- Returns:
- the entry block of the then branch
-
getElseSuccessor
public Block getElseSuccessor()
Description copied from interface:ConditionalBlockReturns the entry block of the else branch.- Specified by:
getElseSuccessorin interfaceConditionalBlock- Returns:
- the entry block of the else branch
-
getSuccessors
public java.util.Set<Block> getSuccessors()
Description copied from interface:BlockReturns the successors of this basic block.- Specified by:
getSuccessorsin interfaceBlock- Returns:
- the successors of this basic block
-
getThenFlowRule
public Store.FlowRule getThenFlowRule()
Description copied from interface:ConditionalBlockReturns the flow rule for information flowing from this block to its then successor.- Specified by:
getThenFlowRulein interfaceConditionalBlock- Returns:
- the flow rule for information flowing from this block to its then successor
-
getElseFlowRule
public Store.FlowRule getElseFlowRule()
Description copied from interface:ConditionalBlockReturns the flow rule for information flowing from this block to its else successor.- Specified by:
getElseFlowRulein interfaceConditionalBlock- Returns:
- the flow rule for information flowing from this block to its else successor
-
setThenFlowRule
public void setThenFlowRule(Store.FlowRule rule)
Description copied from interface:ConditionalBlockSet the flow rule for information flowing from this block to its then successor.- Specified by:
setThenFlowRulein interfaceConditionalBlock- Parameters:
rule- the new flow rule for information flowing from this block to its then successor
-
setElseFlowRule
public void setElseFlowRule(Store.FlowRule rule)
Description copied from interface:ConditionalBlockSet the flow rule for information flowing from this block to its else successor.- Specified by:
setElseFlowRulein interfaceConditionalBlock- Parameters:
rule- the new flow rule for information flowing from this block to its else successor
-
getNodes
public java.util.List<Node> getNodes()
Returns the nodes contained within this basic block. The list may be empty.The following invariant holds.
forall n in getNodes() :: n.getBlock() == this
This implementation returns an empty list.
-
getLastNode
public @Nullable Node getLastNode()
Description copied from interface:BlockReturns the last node of this block, or null if none.- Specified by:
getLastNodein interfaceBlock- Returns:
- the last node of this block or
null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-