diff --git a/.gitignore b/.gitignore index 72dfbc8..dc2618e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -graphviz/*.svg +*.svg diff --git a/graphviz/functions.dot b/graphviz/functions.dot deleted file mode 100644 index eba1157..0000000 --- a/graphviz/functions.dot +++ /dev/null @@ -1,58 +0,0 @@ -digraph functions { - rankdir=TB; - graph [fontname = "cc wild words"]; - node [fontname = "cc wild words"]; - edge [fontname = "cc wild words"]; - rank=TB; - - subgraph cluster_fn_args_1 { - label="fn_args(GazType)"; - fontname=lovebeat; - rankdir=TB; - newrank=true; - - A1 [label="gen_type(GazType)" shape=diamond style=filled fillcolor=lightcoral]; - B1 [label="pack into var"]; - C1 [label="return" style=filled fillcolor=lightskyblue1]; - A1 -> B1 -> A1; - B1 -> C1; - } - - subgraph cluster_fn_gen_type_2 { - label="fn_gen_type(GazType)"; - fontname=lovebeat; - rankdir=TB; - newrank=true; - - A2 [label="expr for type"]; - B2 [label="literal"]; - C2 [label="variable"]; - D2 [label="subroutine"]; - F2 [label="return" style=filled fillcolor=lightskyblue1]; - - A2 -> A2 [dir=back]; - A2 -> B2 -> A2; - A2 -> C2 -> A2; - A2 -> D2 -> A2; - A2 -> F2; - } - - subgraph cluster_fn_gen_global_type_3 { - label="fn_gen_global_type(GazType)"; - fontname=lovebeat; - rankdir=TB; - newrank=true; - - A3 [label="expr for type"]; - B3 [label="literal"]; - C3 [label="global"]; - D3 [label="function"]; - F3 [label="return" style=filled fillcolor=lightskyblue1]; - - A3 -> A3 [dir=back]; - A3 -> B3 -> A3; - A3 -> C3 -> A3; - A3 -> D3 -> A3; - A3 -> F3; - } -} diff --git a/graphviz/functions/args.dot b/graphviz/functions/args.dot new file mode 100644 index 0000000..e54f060 --- /dev/null +++ b/graphviz/functions/args.dot @@ -0,0 +1,19 @@ +digraph fn_args { + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + + label="fn_args(Vec)"; + fontname=lovebeat; + rankdir=TB; + newrank=true; + + A [label="for each type"]; + B [label="gen_type(GazType)" shape=diamond style=filled fillcolor=lightcoral]; + C [label="pack into var"]; + D [label="return" style=filled fillcolor=lightskyblue]; + A -> B -> C -> A; + A -> D; +} diff --git a/graphviz/functions/gen_function.dot b/graphviz/functions/gen_function.dot new file mode 100644 index 0000000..9bf981d --- /dev/null +++ b/graphviz/functions/gen_function.dot @@ -0,0 +1,22 @@ +digraph fn_gen_function { + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + label="fn_gen_function(Vec, return: GazType)"; + fontname=lovebeat; + rankdir=TB; + newrank=true; + + A [label="push args into scope"]; + B [label="new scope"]; + C [label="gen_statement()" shape=diamond style=filled + fillcolor=lightcoral]; + D [label="gen_return(GazType)" shape=diamond style=filled + fillcolor=lightcoral]; + F [label="return" style=filled fillcolor=lightskyblue1]; + + A -> B -> C -> D -> F; + C -> C [dir=back]; +} diff --git a/graphviz/functions/gen_global_type.dot b/graphviz/functions/gen_global_type.dot new file mode 100644 index 0000000..cc11192 --- /dev/null +++ b/graphviz/functions/gen_global_type.dot @@ -0,0 +1,23 @@ +digraph fn_gen_global_type { + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + label="fn_gen_global_type(GazType)"; + fontname=lovebeat; + rankdir=TB; + newrank=true; + + A [label="expr for type"]; + B [label="literal"]; + C [label="global"]; + D [label="function"]; + F [label="return" style=filled fillcolor=lightskyblue1]; + + A -> A [dir=back]; + A -> B -> A; + A -> C -> A; + A -> D -> A; + A -> F; +} diff --git a/graphviz/functions/gen_type.dot b/graphviz/functions/gen_type.dot new file mode 100644 index 0000000..93d5fd7 --- /dev/null +++ b/graphviz/functions/gen_type.dot @@ -0,0 +1,24 @@ +digraph fn_gen_type { + rankdir=TB; + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + label="fn_gen_type(GazType)"; + fontname=lovebeat; + rankdir=TB; + newrank=true; + + A [label="expr for type"]; + B [label="literal"]; + C [label="variable"]; + D [label="subroutine"]; + F [label="return" style=filled fillcolor=lightskyblue1]; + + A -> A [dir=back]; + A -> B -> A; + A -> C -> A; + A -> D -> A; + A -> F; +} diff --git a/scripts/build_graphs.sh b/scripts/build_graphs.sh index 1fb0fac..2bddfd1 100755 --- a/scripts/build_graphs.sh +++ b/scripts/build_graphs.sh @@ -19,6 +19,10 @@ HELP exit 1 fi -for name in "${fnames[@]}"; do - dot -Tsvg -o "${path}/${name}.svg" "${path}/${name}.dot" +for name in ${path}/*.dot; do + dot -Tsvg -o "${name%.*}.svg" "$name" +done + +for name in ${path}/**/*.dot; do + dot -Tsvg -o "${name%.*}.svg" "$name" done