class documentation

class CFGNode: (source)

View In Hierarchy

A node in the CFG. Assignments within one CFG node are treated as unordered: E.g. if "x = x + 1" is in a single CFG node, both bindings for x will be visible from inside that node. Attributes: program: The Program instance we belong to id: Numerical node id. name: Name of this CFGNode, or None. For debugging. incoming: Other CFGNodes that are connected to this node. outgoing: CFGNodes we connect to. bindings: Bindings that are being assigned to Variables at this CFGNode. condition: None if no condition is set at this node; The binding representing the condition which needs to be fulfilled to take the branch represented by this node.

Method __init__ Initialize a new CFG node. Called from Program.NewCFGNode.
Method __repr__ Undocumented
Method CanHaveCombination Quick version of HasCombination below.
Method ConnectNew Add a new node connected to this node.
Method ConnectTo Connect this node to an existing node.
Method HasCombination Query whether a combination is possible.
Method RegisterBinding Undocumented
Class Variable __slots__ Undocumented
Instance Variable bindings Undocumented
Instance Variable condition Undocumented
Instance Variable id Undocumented
Instance Variable incoming Undocumented
Instance Variable name Undocumented
Instance Variable outgoing Undocumented
Instance Variable program Undocumented
def __init__(self, program, name, cfgnode_id, condition): (source)

Initialize a new CFG node. Called from Program.NewCFGNode.

def __repr__(self): (source)

Undocumented

def CanHaveCombination(self, bindings): (source)

Quick version of HasCombination below.

def ConnectNew(self, name=None, condition=None): (source)

Add a new node connected to this node.

def ConnectTo(self, cfg_node): (source)

Connect this node to an existing node.

def HasCombination(self, bindings): (source)

Query whether a combination is possible. Query whether its possible to have the given combination of bindings at this CFG node (I.e., whether they can all be assigned at the same time.) This will e.g. tell us whether a return binding is possible given a specific combination of argument bindings. Arguments: bindings: A list of Bindings. Returns: True if the combination is possible, False otherwise.

def RegisterBinding(self, binding): (source)

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

bindings = (source)

Undocumented

condition = (source)

Undocumented

Undocumented

incoming = (source)

Undocumented

Undocumented

outgoing = (source)

Undocumented

Undocumented