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.