module documentation

This implementation provides interface to build CFG(Control Flow Graph) of python files using AST (Abstract Syntax Tree). The CFGBuilder class works by walking through an AST and creating a new block for each statement. The blocks are then linked together by adding exits from one block to another. This implementation is partly adapted from the static cfg project https://github.com/coetaur0/staticfg

Class CFGBuilder Control flow graph builder.
Function invert Invert the operation in an ast node object (get its negation).
Function merge_exitcases Merge the exitcases of two Links.
Constant NAMECONSTANT_TYPE Undocumented
Variable is_py38_or_higher Undocumented
def invert(node): (source)

Invert the operation in an ast node object (get its negation).

Parameters
nodeAn ast node object.
Returns
An ast node object containing the inverse (negation) of the input node.
def merge_exitcases(exit1, exit2): (source)

Merge the exitcases of two Links.

Parameters
exit1The exitcase of a Link object.
exit2Another exitcase to merge with exit1.
Returns
The merged exitcases.
NAMECONSTANT_TYPE = (source)

Undocumented

Value
(ast.Constant if is_py38_or_higher() else ast.NameConstant)
is_py38_or_higher = (source)

Undocumented