
Creating a visual map between code and its parse tree - signa11
http://blog.loadzero.com/blog/parse-tree-vis/
======
w_t_payne
Nice. Would be good to do it with Python.

~~~
loadzero
Author here. I am guessing you mean display the parse trees for python
snippets?

It wouldn't be too difficult to do in backend code, using something like
[https://docs.python.org/2/library/ast.html](https://docs.python.org/2/library/ast.html).

It might be tricky to get it to work completely in the frontend, like the
demos in this article.

~~~
w_t_payne
Yeah ... I've turned the parse tree output from Baron
([https://github.com/PyCQA/baron](https://github.com/PyCQA/baron)) into HTML
-- using span elements to represent the subtrees in the Baron AST. It was
quite trivial (less than 200 lines including comments). I am now trying to see
how I can add different representations to the rendered html output. I would
like to show the abstract syntax tree, the data dependency graph, the control
flow graph; the output of git blame; perhaps deltas over time; test coverage
and various bits of requirements and test results traceability information
alongside the code somehow. Lots of stuff. :-)

~~~
w_t_payne
All in the back-end --- I just want it as standalone single-file HTML w/ no
server infrastructure required.

