示例#1
0
 def renderCFG(self, graphName="defaultCFG_", view=False):
     graphName = graphName + self.fn_name
     graph = to_graph(gen_cfg(self.fn_source))
     graph.render(graphName, view=view)
示例#2
0
def show_cfg(fn, **kwargs):
    return Source(to_graph(gen_cfg(inspect.getsource(fn)), **kwargs))
示例#3
0
from ControlFlow import gen_cfg, to_graph
from graphviz import Source
cfg = gen_cfg(inspect.getsource(my_function))
graph = to_graph(cfg)
Source(graph)