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).

Method __del__ Undocumented
Method __init__ The constructor of CFG class. Only name of this graph is required.
Method __iter__ Generator that yields all the blocks in the current graph, then recursively yields from any sub graphs
Method __str__ Undocumented
Method build_visual Build a visualisation of the CFG with graphviz and output it in a DOT file.
Method flatten Undocumented
Method get_all_blocks Get a list of code blocks in this CFG; This is generated by BFS order.
Method remove_comments Undocumented
Instance Variable asynchr Undocumented
Instance Variable class_args Undocumented
Instance Variable class_cfgs Undocumented
Instance Variable entryblock Undocumented
Instance Variable finalblocks Undocumented
Instance Variable function_args Undocumented
Instance Variable functioncfgs Undocumented
Instance Variable name Undocumented
Method _build_visual Undocumented
Method _visit_blocks Undocumented
def __del__(self): (source)

Undocumented

def __init__(self, name, asynchr=False): (source)

The constructor of CFG class. Only name of this graph is required.

def __iter__(self): (source)

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

def __str__(self): (source)

Undocumented

def build_visual(self, format, calls=True, show=True): (source)

Build a visualisation of the CFG with graphviz and output it in a DOT file.

Parameters
formatThe format to use for the output file (PDF, ...).
callsUndocumented
showA boolean indicating whether to automatically open the output file after building the visualisation.
filenameThe name of the output file in which the visualisation must be saved.
def flatten(self): (source)

Undocumented

def get_all_blocks(self): (source)

Get a list of code blocks in this CFG; This is generated by BFS order.

Returns
A list of code blocks.
def remove_comments(self, src): (source)

Undocumented

Undocumented

class_args: dict = (source)

Undocumented

class_cfgs: dict = (source)

Undocumented

entryblock = (source)

Undocumented

finalblocks: list = (source)

Undocumented

function_args: dict = (source)

Undocumented

functioncfgs: dict = (source)

Undocumented

Undocumented

def _build_visual(self, format='pdf', calls=True): (source)

Undocumented

def _visit_blocks(self, graph, block, visited=[], calls=True): (source)

Undocumented