diff options
| author | Kazuhiko Sakaguchi | 2019-02-22 15:22:46 +0100 |
|---|---|---|
| committer | Kazuhiko Sakaguchi | 2019-02-22 16:34:55 +0100 |
| commit | 25a1164023a46c035411d4fe3698d1a7c9912c4f (patch) | |
| tree | 4afb9a9d023b92d114d681c49425719ecb9b1b7d /etc | |
| parent | 5d7a5724a9d784cfa0d2c126897ca9841c3c9c23 (diff) | |
Add a tool to draw the hierarchy diagram
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/utils/hierarchy-diagram | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/etc/utils/hierarchy-diagram b/etc/utils/hierarchy-diagram new file mode 100755 index 0000000..ee96b8d --- /dev/null +++ b/etc/utils/hierarchy-diagram @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "digraph structures {" + +{ +cat <<EOT +Set Printing Width 4611686018427387903. +Require Import all.all. +Print Graph. +EOT +} | \ +coqtop -w none -R mathcomp mathcomp 2>/dev/null | \ +grep '^\[[^ ;]*\] : [a-zA-Z_\.]*\.class_of >-> [a-zA-Z_\.]*\.class_of$' | \ +while read -r line; do + echo $line | \ + sed 's/^\[\([^]]*\)\] : \([a-zA-Z_\.]*\)\.class_of >-> \([a-zA-Z_\.]*\)\.class_of$/"\2" -> "\3";/' + #sed 's/^\[\([^]]*\)\] : \([a-zA-Z_\.]*\)\.class_of >-> \([a-zA-Z_\.]*\)\.class_of$/"\2" -> "\3" [label="\1"];/' +done + +echo "}" |
