Class UniqueEntryExitControlFlowGraph
- java.lang.Object
-
- com.ensoftcorp.open.commons.algorithms.UniqueEntryExitControlFlowGraph
-
- All Implemented Interfaces:
UniqueEntryExitGraph
public class UniqueEntryExitControlFlowGraph extends java.lang.Object implements UniqueEntryExitGraph
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UniqueEntryExitCFG_Edge
Tag applied to the newly created edges between the master entry and the cfg roots and the cfg exits and the master exitstatic java.lang.String
UniqueEntryExitCFG_Master_Entry
Tag applied to the newly created master entry nodestatic java.lang.String
UniqueEntryExitCFG_Master_Entry_Name
The name attribute applied to the EventFlow_Master_Entry of the PCGstatic java.lang.String
UniqueEntryExitCFG_Master_Exit
Tag applied to the newly create master exit nodestatic java.lang.String
UniqueEntryExitCFG_Master_Exit_Name
The name attribute applied to the EventFlow_Master_Exit of the PCG
-
Constructor Summary
Constructors Constructor Description UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg)
Constructs a new unique entry/exit control flow graph.UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, boolean addContains)
Constructs a new unique entry/exit control flow graph.UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, boolean relaxNonEmptyRootsRequirement, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits, boolean relaxNonEmptyExitsRequirement, boolean addContains)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits, boolean addContains)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge>
edges()
The set of edges in the graphcom.ensoftcorp.atlas.core.db.graph.Graph
getCFG()
com.ensoftcorp.atlas.core.db.graph.Node
getEntryNode()
Returns the master entry nodecom.ensoftcorp.atlas.core.db.graph.Node
getExitNode()
Returns the master exit nodecom.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getExits()
com.ensoftcorp.atlas.core.db.graph.Node
getFunction()
com.ensoftcorp.atlas.core.db.graph.Graph
getGraph()
com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getPredecessors(com.ensoftcorp.atlas.core.db.graph.Node node)
Gets the predecessors of a given nodecom.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getRoots()
com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getSuccessors(com.ensoftcorp.atlas.core.db.graph.Node node)
Gets the successors of a given nodecom.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
nodes()
The set of nodes in the graph
-
-
-
Field Detail
-
UniqueEntryExitCFG_Master_Entry
public static final java.lang.String UniqueEntryExitCFG_Master_Entry
Tag applied to the newly created master entry node- See Also:
- Constant Field Values
-
UniqueEntryExitCFG_Master_Exit
public static final java.lang.String UniqueEntryExitCFG_Master_Exit
Tag applied to the newly create master exit node- See Also:
- Constant Field Values
-
UniqueEntryExitCFG_Master_Entry_Name
public static final java.lang.String UniqueEntryExitCFG_Master_Entry_Name
The name attribute applied to the EventFlow_Master_Entry of the PCG- See Also:
- Constant Field Values
-
UniqueEntryExitCFG_Master_Exit_Name
public static final java.lang.String UniqueEntryExitCFG_Master_Exit_Name
The name attribute applied to the EventFlow_Master_Exit of the PCG- See Also:
- Constant Field Values
-
UniqueEntryExitCFG_Edge
public static final java.lang.String UniqueEntryExitCFG_Edge
Tag applied to the newly created edges between the master entry and the cfg roots and the cfg exits and the master exit- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UniqueEntryExitControlFlowGraph
public UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg)
Constructs a new unique entry/exit control flow graph. Assumes the entry is tagged with XCSG.controlFlowRoot and the exits are tagged with XCSG.controlFlowExitPoint- Parameters:
cfg
- a control flow graph
-
UniqueEntryExitControlFlowGraph
public UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, boolean addContains)
Constructs a new unique entry/exit control flow graph. Assumes the entry is tagged with XCSG.controlFlowRoot and the exits are tagged with XCSG.controlFlowExitPoint Optionally, containment edges can be added for display purposes- Parameters:
cfg
-addContains
-
-
UniqueEntryExitControlFlowGraph
public UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.- Parameters:
cfg
- a control flow graphroots
-exits
-
-
UniqueEntryExitControlFlowGraph
public UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits, boolean addContains)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.- Parameters:
cfg
- a control flow graphroots
-exits
-addContains
-
-
UniqueEntryExitControlFlowGraph
public UniqueEntryExitControlFlowGraph(com.ensoftcorp.atlas.core.db.graph.Graph cfg, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> roots, boolean relaxNonEmptyRootsRequirement, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> exits, boolean relaxNonEmptyExitsRequirement, boolean addContains)
Constructs a new unique entry/exit control flow graph with the specified entry and exit points.- Parameters:
cfg
-roots
-relaxNonEmptyRootsRequirement
- Relaxes the requirement that roots must be a non-empty setexits
-relaxNonEmptyExitsRequirement
- Relaxes the requirement that exist must be a non-empty setaddContains
-
-
-
Method Detail
-
getCFG
public com.ensoftcorp.atlas.core.db.graph.Graph getCFG()
-
getRoots
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getRoots()
-
getExits
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getExits()
-
getFunction
public com.ensoftcorp.atlas.core.db.graph.Node getFunction()
-
getGraph
public com.ensoftcorp.atlas.core.db.graph.Graph getGraph()
-
getPredecessors
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getPredecessors(com.ensoftcorp.atlas.core.db.graph.Node node)
Gets the predecessors of a given node- Specified by:
getPredecessors
in interfaceUniqueEntryExitGraph
- Parameters:
node
-- Returns:
- Predecessors of node
-
getSuccessors
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getSuccessors(com.ensoftcorp.atlas.core.db.graph.Node node)
Gets the successors of a given node- Specified by:
getSuccessors
in interfaceUniqueEntryExitGraph
- Parameters:
node
-- Returns:
- Successors of node
-
getEntryNode
public com.ensoftcorp.atlas.core.db.graph.Node getEntryNode()
Description copied from interface:UniqueEntryExitGraph
Returns the master entry node- Specified by:
getEntryNode
in interfaceUniqueEntryExitGraph
-
getExitNode
public com.ensoftcorp.atlas.core.db.graph.Node getExitNode()
Description copied from interface:UniqueEntryExitGraph
Returns the master exit node- Specified by:
getExitNode
in interfaceUniqueEntryExitGraph
-
nodes
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> nodes()
Description copied from interface:UniqueEntryExitGraph
The set of nodes in the graph- Specified by:
nodes
in interfaceUniqueEntryExitGraph
- Returns:
-
edges
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> edges()
Description copied from interface:UniqueEntryExitGraph
The set of edges in the graph- Specified by:
edges
in interfaceUniqueEntryExitGraph
- Returns:
-
-