Cfg

case class Cfg(entryNode: Option[CfgNode], edges: List[CfgEdge], fringe: List[(CfgNode, CfgEdgeType)], labeledNodes: Map[String, CfgNode], breaks: List[CfgNode], continues: List[CfgNode], caseLabels: List[CfgNode], jumpsToLabel: List[(CfgNode, String)])

A control flow graph that is under construction, consisting of:

Value parameters:
breaks

unresolved breaks collected along the way

caseLabels

labels beginning with "case"

continues

unresolved continues collected along the way

edges

control flow edges between nodes of the code property graph.

entryNode

the control flow graph's first node, that is, the node to which a CFG that appends this CFG should attach itself to.

fringe

nodes of the CFG for which an outgoing edge type is already known but the destination node is not. These nodes are connected when another CFG is appended to this CFG. In addition to these three core building blocks, we store labels and jump statements that have not been resolved and may be resolvable as parent sub trees or sibblings are translated.

jumpsToLabel

unresolved gotos, labeled break and labeld continues collected along the way

labeledNodes

labels contained in the abstract syntax tree from which this CPG was generated

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def ++(other: Cfg): Cfg

Create a new CFG in which other is appended to this CFG. All nodes of the fringe are connected to other's entry node and the new fringe is other's fringe. The diffgraphs, jumps, and labels are the sum of those present in this and other.

Create a new CFG in which other is appended to this CFG. All nodes of the fringe are connected to other's entry node and the new fringe is other's fringe. The diffgraphs, jumps, and labels are the sum of those present in this and other.

Upon completing traversal of the abstract syntax tree, this method creates CFG edges between jumps like gotos, labeled breaks, labeled continues and respective labels.

Upon completing traversal of the abstract syntax tree, this method creates CFG edges between jumps like gotos, labeled breaks, labeled continues and respective labels.

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product