Skip to content

Commit

Permalink
Add script to generate graphviz
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Nov 26, 2019
1 parent 0847e2f commit 98089de
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions OMCompiler/Compiler/boot/graphviz-import.sh
@@ -0,0 +1,13 @@
echo "digraph depends {" > depends.dot
for f in `grep ALL_SOURCES Makefile.sources | cut -d= -f2`; do
f2=`echo $f | cut -d/ -f3 | cut -d. -f1`
echo " \"$f2\" [label=\"$f2\"];" >> depends.dot
for i in `egrep "^ *(public|protected)? *import" "$f" | grep -o "import \+[A-Za-z0-9_]\+ *;" | cut -d" " -f2 | cut -d";" -f1`; do
echo " \"$f2\" -> \"$i\";" >> depends.dot
done
for i in `egrep "^ *(public|protected)? *import" "$f" | grep -o "import \+[A-Za-z0-9_]\+ *= *[A-Za-z0-9_]\+ *;" | cut -d= -f2 | cut -d";" -f1`; do
echo " \"$f2\" -> \"$i\";" >> depends.dot
done
done
echo "}" >> depends.dot
gv2gml depends.dot > depends.gml

0 comments on commit 98089de

Please sign in to comment.