beanmachine.ppl.compiler.ast_tools module

Debugging tools for working with ASTs

beanmachine.ppl.compiler.ast_tools.print_graph(node: ast.AST) str

Takes an AST and produces a string containing a DOT representation of the tree as a graph.

beanmachine.ppl.compiler.ast_tools.print_python(node: ast.AST) str

Takes an AST and produces a string containing a human-readable Python expression that builds the AST node.

beanmachine.ppl.compiler.ast_tools.print_tree(node: ast.AST, unicode: bool = True) str

Takes an AST and produces a string containing a hierarchical view of the tree structure.