def draw_lattice(cfg, output_filename='output'):
"""Draw CFG and output as pdf."""
graph = Digraph(format='pdf')
ll = [s.label for s in cfg.nodes if isinstance(s, AssignmentNode)]
root = make_lattice(ll,len(ll)-1)
l = list()
draw_node(l, graph, root)
graph = apply_styles(graph, lattice_styles)
graph.render(filename = output_filename+'.dot')
add_anchor(output_filename)
run_dot(output_filename)
评论列表
文章目录