aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorKazuhiko Sakaguchi2019-02-22 15:22:46 +0100
committerKazuhiko Sakaguchi2019-02-22 16:34:55 +0100
commit25a1164023a46c035411d4fe3698d1a7c9912c4f (patch)
tree4afb9a9d023b92d114d681c49425719ecb9b1b7d /etc
parent5d7a5724a9d784cfa0d2c126897ca9841c3c9c23 (diff)
Add a tool to draw the hierarchy diagram
Diffstat (limited to 'etc')
-rwxr-xr-xetc/utils/hierarchy-diagram20
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 "}"