Diagramming syntactic analyses with graphviz
If you have saved an analysis from a marimo notebook or a command-line script, you can use the open-source graphviz application to diagram the analysis. The command-line script analysis_to_dot.py creates a graph in the dot format used by graphviz.
Create a dot file from an analysis file::
python3 utilities/analysis_to_dot.py analysis_file.cex > analysis_diagram.dotIf dot is installed, you can directly create a .png file:
python3 utilities/analysis_to_dot.py analysis_file.cex | dot -Tpng > analysis_diagram.pngHow to install dot
Mac OS:
brew install graphvizWindows: download from https://graphviz.org/download/ or
winget install --id Graphviz.GraphvizVerify it worked: print a version string.
dot -V