class CFGNode: (source)
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 |
|
Quick version of HasCombination below. |
Method |
|
Add a new node connected to this node. |
Method |
|
Connect this node to an existing node. |
Method |
|
Query whether a combination is possible. |
Method |
|
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 |
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.