astree.py combines the Python
ast module with
pydot_ng to draw abstract syntax trees specified in DOT language scripts.
An abstract syntax tree is a tree representation of the abstract
syntactic structure of source code written in a programming language (e.g. Python).
Jumpstart -- running the program:
1) Clone repository
$ pip install -r requirements.txt
$ python astree.py
Input modules, methods, declarations, statements, expressions, etc.
View video example here.
For example, let's look at the
>>> Input a method name, expression, etc.:
Note: please report bugs to issues.
As a command line user or module implementer, It would be great if to be able to pass a file or folder as an argument and generate a dot file.
For example, https://github.com/Persper/js-callgraph
allows this feature but for js projects.
js-callgraph --cg input-scripts/simple-scripts/functioncall-arithmetic.js --output filename.json
astree syntax-trees abstract-syntax-tree graphviz-dot pydot