class documentation

class ControlFlowGraph(object): (source)

View In Hierarchy

A control flow graph for a Python program.

Method __init__ Undocumented
Method add_node Undocumented
Method compact Prunes unused blocks and merges blocks when possible.
Method get_block_by_ast_node Undocumented
Method get_block_by_ast_node_and_label Gets the block corresponding to node having label label.
Method get_block_by_ast_node_type_and_label Gets a block with node type node_type having label label.
Method get_block_by_function_name Undocumented
Method get_block_by_source Undocumented
Method get_block_by_source_and_ast_node_type A block with an Instruction matching node_type and containing source.
Method get_blocks_by_ast_node Undocumented
Method get_blocks_by_ast_node_type_and_label Gets the blocks with node type node_type having label label.
Method get_blocks_by_function_name Returns entry blocks for any functions named name.
Method get_blocks_by_source Yields blocks that contain instructions matching the query source.
Method get_blocks_by_source_and_ast_node_type Blocks with an Instruction matching node_type and containing source.
Method get_control_flow_node_by_ast_node Undocumented
Method get_control_flow_node_by_source Undocumented
Method get_control_flow_node_by_source_and_identifier Undocumented
Method get_control_flow_nodes Undocumented
Method get_control_flow_nodes_by_ast_node Undocumented
Method get_control_flow_nodes_by_source Undocumented
Method get_control_flow_nodes_by_source_and_identifier Undocumented
Method get_enter_blocks Returns entry blocks for all functions.
Method get_enter_control_flow_nodes Yields all ControlFlowNodes without any prev nodes.
Method get_exit_blocks Yields all blocks without any next blocks.
Method get_instructions Yields all instructions in the control flow graph.
Method get_start_control_flow_node Undocumented
Method move_block_to_rear Undocumented
Method new_block Undocumented
Method prune Prunes all prunable blocks from the graph.
Instance Variable blocks All blocks contained in the control flow graph.
Instance Variable nodes All control flow nodes in the control flow graph.
Instance Variable start_block The entry point to the program.
def __init__(self): (source)

Undocumented

def add_node(self, control_flow_node): (source)

Undocumented

def compact(self): (source)

Prunes unused blocks and merges blocks when possible.

def get_block_by_ast_node(self, node): (source)

Undocumented

def get_block_by_ast_node_and_label(self, node, label): (source)

Gets the block corresponding to node having label label.

def get_block_by_ast_node_type_and_label(self, node_type, label): (source)

Gets a block with node type node_type having label label.

def get_block_by_function_name(self, name): (source)

Undocumented

def get_block_by_source(self, source): (source)

Undocumented

def get_block_by_source_and_ast_node_type(self, source, node_type): (source)

A block with an Instruction matching node_type and containing source.

def get_blocks_by_ast_node(self, node): (source)

Undocumented

def get_blocks_by_ast_node_type_and_label(self, node_type, label): (source)

Gets the blocks with node type node_type having label label.

def get_blocks_by_function_name(self, name): (source)

Returns entry blocks for any functions named name.

def get_blocks_by_source(self, source): (source)

Yields blocks that contain instructions matching the query source.

def get_blocks_by_source_and_ast_node_type(self, source, node_type): (source)

Blocks with an Instruction matching node_type and containing source.

def get_control_flow_node_by_ast_node(self, node): (source)

Undocumented

def get_control_flow_node_by_source(self, source): (source)

Undocumented

def get_control_flow_node_by_source_and_identifier(self, source, name): (source)

Undocumented

def get_control_flow_nodes(self): (source)

Undocumented

def get_control_flow_nodes_by_ast_node(self, node): (source)

Undocumented

def get_control_flow_nodes_by_source(self, source): (source)

Undocumented

def get_control_flow_nodes_by_source_and_identifier(self, source, name): (source)

Undocumented

def get_enter_blocks(self): (source)

Returns entry blocks for all functions.

def get_enter_control_flow_nodes(self): (source)

Yields all ControlFlowNodes without any prev nodes.

def get_exit_blocks(self): (source)

Yields all blocks without any next blocks.

def get_instructions(self): (source)

Yields all instructions in the control flow graph.

def get_start_control_flow_node(self): (source)

Undocumented

def move_block_to_rear(self, block): (source)

Undocumented

def new_block(self, node=None, label=None, prunable=True): (source)

Undocumented

def prune(self): (source)

Prunes all prunable blocks from the graph.

All blocks contained in the control flow graph.

All control flow nodes in the control flow graph.

start_block = (source)

The entry point to the program.