Connects nodes to signify that control flows from first to second. Args: first: Union[Set[Node, ...], Node] second: Node
(self, first, second)
| 307 | self.cond_leaves = {} |
| 308 | |
| 309 | def _connect_nodes(self, first, second): |
| 310 | """Connects nodes to signify that control flows from first to second. |
| 311 | |
| 312 | Args: |
| 313 | first: Union[Set[Node, ...], Node] |
| 314 | second: Node |
| 315 | """ |
| 316 | if isinstance(first, Node): |
| 317 | first.next.add(second) |
| 318 | second.prev.add(first) |
| 319 | self.forward_edges.add((first, second)) |
| 320 | else: |
| 321 | for node in first: |
| 322 | self._connect_nodes(node, second) |
| 323 | |
| 324 | def _add_new_node(self, ast_node): |
| 325 | """Grows the graph by adding a CFG node following the current leaves.""" |
no test coverage detected