class documentation

Control flow graph (CFG). A control flow graph is composed of basic blocks and links between them representing control flow jumps. It has a unique entry block and several possible 'final' blocks (blocks with no exits representing the end of the CFG).

Static Method border_style Undocumented
Static Method fillcolor Undocumented
Method __init__ Undocumented
Method __iter__ Generator that yields all the blocks in the current graph, then recursively yields from any sub graphs
Method __str__ Undocumented
Method bsearch Search for a block at line
Method build_key Build key graph
Method build_visual Build a visualisation of the CFG with graphviz and output it in a DOT file.
Method edge_For Undocumented
Method edge_If Undocumented
Method edge_While Undocumented
Method find_path Undocumented
Method highlight_blocks In interactive mode, highlight the block at lineno
Method node_ClassDef Undocumented
Method node_Try Undocumented
Method outline_block In interactive mode, outline the block at lineno
Method own_blocks Generator that yields all blocks in the current graph, excluding any subgraphs
Method stylize_edge Undocumented
Method stylize_node Undocumented
Constant DEFAULT Undocumented
Class Variable node_styles Undocumented
Class Variable subgraphs Undocumented
Instance Variable asynchr Undocumented
Instance Variable classcfgs Undocumented
Instance Variable end_lineno Undocumented
Instance Variable entryblock Undocumented
Instance Variable finalblocks Undocumented
Instance Variable functioncfgs Undocumented
Instance Variable highlighted_blocks Undocumented
Instance Variable isShort Undocumented
Instance Variable lineno Undocumented
Instance Variable name Undocumented
Instance Variable outlined_block Undocumented
Instance Variable qualname Undocumented
Method _build_key_subgraph Undocumented
Method _build_visual Undocumented
Method _edge_handler Undocumented
Method _style_handler Undocumented
Method _visit_blocks Undocumented
Method _visit_func Undocumented
@staticmethod
def border_style(block, interactive): (source)

Undocumented

Parameters
block:BlockUndocumented
interactive:boolUndocumented
@staticmethod
def fillcolor(block, interactive, color, default=''): (source)

Undocumented

Parameters
block:BlockUndocumented
interactive:boolUndocumented
color:strUndocumented
default:strUndocumented
def __init__(self, name, asynchr=False, short=True): (source)

Undocumented

Parameters
name:strUndocumented
asynchr:boolUndocumented
short:boolUndocumented
def __iter__(self): (source)

Generator that yields all the blocks in the current graph, then recursively yields from any sub graphs

Returns
Iterator[Block]Undocumented
def __str__(self): (source)

Undocumented

Returns
strUndocumented
def bsearch(self, lineno, lst=None): (source)

Search for a block at line

Parameters
lineno:intUndocumented
lst:Optional[list]Undocumented
Returns
Optional[Block]Undocumented
def build_key(self, **kwargs): (source)

Build key graph

def build_visual(self, filepath, format, calls=True, show=True, cleanup=True, directory=None, interactive=False, build_keys=True, build_own=False, diffable=None): (source)

Build a visualisation of the CFG with graphviz and output it in a DOT file. Args: filename: The name of the output file in which the visualisation must be saved. format: The format to use for the output file (PDF, ...). show: A boolean indicating whether to automatically open the output file after building the visualisation.

Parameters
filepath:strUndocumented
format:strUndocumented
calls:boolUndocumented
show:boolUndocumented
cleanupUndocumented
directoryUndocumented
interactiveUndocumented
build_keysUndocumented
build_ownUndocumented
diffableUndocumented
Returns
strUndocumented
def edge_For(self, link): (source)

Undocumented

Parameters
link:LinkUndocumented
Returns
Tuple[None, str, str]Undocumented
def edge_If(self, link): (source)

Undocumented

Parameters
link:LinkUndocumented
Returns
Tuple[None, str, str]Undocumented
def edge_While(self, link): (source)

Undocumented

Parameters
link:LinkUndocumented
Returns
Tuple[None, str, str]Undocumented
def find_path(self, finalblock): (source)

Undocumented

Parameters
finalblock:BlockUndocumented
Returns
Deque[Link]Undocumented
def highlight_blocks(self, lines, blocks=None): (source)

In interactive mode, highlight the block at lineno

Returns
intUndocumented
def node_ClassDef(self, block, typeobj): (source)

Undocumented

Parameters
block:BlockUndocumented
typeobj:typeUndocumented
Returns
Tuple[str, str, str]Undocumented
def node_Try(self, block, typeobj): (source)

Undocumented

Parameters
block:BlockUndocumented
typeobj:typeUndocumented
Returns
Tuple[str, str, str]Undocumented
def outline_block(self, lineno, lst=None): (source)

In interactive mode, outline the block at lineno

Returns
intUndocumented
def own_blocks(self): (source)

Generator that yields all blocks in the current graph, excluding any subgraphs

Returns
Iterator[Block]Undocumented
def stylize_edge(self, link, default=None, default_target=None): (source)

Undocumented

Parameters
link:LinkUndocumented
default:NoneUndocumented
default_target:NoneUndocumented
Returns
tupleUndocumented
def stylize_node(self, block, default=None): (source)

Undocumented

Parameters
block:BlockUndocumented
default:NoneUndocumented
Returns
tupleUndocumented

Undocumented

Value
node_styles['default']
node_styles = (source)

Undocumented

subgraphs: dict = (source)

Undocumented

Undocumented

classcfgs: dict = (source)

Undocumented

end_lineno: int = (source)

Undocumented

entryblock: Optional[Block] = (source)

Undocumented

finalblocks: List[Block] = (source)

Undocumented

functioncfgs: dict = (source)

Undocumented

highlighted_blocks = (source)

Undocumented

Undocumented

Undocumented

Undocumented

outlined_block = (source)

Undocumented

qualname: str = (source)

Undocumented

def _build_key_subgraph(self, format): (source)

Undocumented

Parameters
format:strUndocumented
Returns
DigraphUndocumented
def _build_visual(self, format='pdf', calls=True, interactive=False, build_own=False): (source)

Undocumented

Parameters
format:strUndocumented
calls:boolUndocumented
interactive:boolUndocumented
build_ownUndocumented
Returns
DigraphUndocumented
def _edge_handler(self, link): (source)

Undocumented

Parameters
link:LinkUndocumented
Returns
Tuple[None, str, str]Undocumented
def _style_handler(self, block, typeobject): (source)

Undocumented

Parameters
block:BlockUndocumented
typeobject:AnyUndocumented
Returns
Tuple[str, str, str]Undocumented
def _visit_blocks(self, graph, block, visited=set(), calls=True, format=None, interactive=False): (source)

Undocumented

Parameters
graph:DigraphUndocumented
block:BlockUndocumented
visited:Set[Block]Undocumented
calls:boolUndocumented
format:strUndocumented
interactive:boolUndocumented
def _visit_func(self, graph, block, last=None, visited=set(), interactive=False): (source)

Undocumented

Parameters
graph:DigraphUndocumented
block:FuncBlockUndocumented
last:strUndocumented
visited:Set[Block]Undocumented
interactive:boolUndocumented