diff --git a/graphviz/functions/gen_decl.dot b/graphviz/functions/gen_decl.dot new file mode 100644 index 0000000..a228499 --- /dev/null +++ b/graphviz/functions/gen_decl.dot @@ -0,0 +1,34 @@ +digraph fn_gen_decl { + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + label="fn_gen_decl(qual: QualifierType, type: GazType)"; + fontname=lovebeat; + rankdir=LR; + newrank=true; + + a [label="fork on type"]; + b [label="gen_boolean()" shape=diamond style=filled fillcolor=lightcoral]; + c [label="gen_character()" shape=diamond style=filled fillcolor=lightcoral]; + d [label="create real"] + e [label="gen_integer()" shape=diamond style=filled fillcolor=lightcoral]; + f [label="gen_real()" shape=diamond style=filled fillcolor=lightcoral]; + g [label="gen_tuple()" shape=diamond style=filled fillcolor=lightcoral]; + h [label="fork on qual"]; + i [label="push to mut scope"]; + j [label="push to const scope"]; + k [label="return" style=filled fillcolor=lightskyblue1]; + + a -> b -> h; + a -> c -> h; + a -> e -> h; + a -> g -> h; + a -> d; + d -> e; + d -> f -> h; + + h -> i -> k; + h -> j -> k; +} diff --git a/graphviz/functions/gen_function.dot b/graphviz/functions/gen_function.dot index 9bf981d..63de13d 100644 --- a/graphviz/functions/gen_function.dot +++ b/graphviz/functions/gen_function.dot @@ -4,19 +4,22 @@ digraph fn_gen_function { node [fontname = "cc wild words"]; edge [fontname = "cc wild words"]; - label="fn_gen_function(Vec, return: GazType)"; + label="fn_gen_subroutine(SubRoutine)"; fontname=lovebeat; rankdir=TB; newrank=true; - A [label="push args into scope"]; - B [label="new scope"]; - C [label="gen_statement()" shape=diamond style=filled + 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 + d [label="fork on return"]; + e [label="gen_return(GazType)" shape=diamond style=filled fillcolor=lightcoral]; - F [label="return" style=filled fillcolor=lightskyblue1]; + f [label="return" style=filled fillcolor=lightskyblue1]; - A -> B -> C -> D -> F; - C -> C [dir=back]; + a -> b -> c -> d; + c -> c [dir=back]; + d -> e -> f; + d -> f; } diff --git a/graphviz/functions/gen_global_decl.dot b/graphviz/functions/gen_global_decl.dot new file mode 100644 index 0000000..08866d2 --- /dev/null +++ b/graphviz/functions/gen_global_decl.dot @@ -0,0 +1,31 @@ +digraph fn_gen_decl { + labelloc="t"; + graph [fontname = "cc wild words"]; + node [fontname = "cc wild words"]; + edge [fontname = "cc wild words"]; + + label="fn_gen_decl_global(type: GazType)"; + fontname=lovebeat; + rankdir=LR; + newrank=true; + + a [label="fork on type"]; + b [label="gen_boolean(global=true)" shape=diamond style=filled fillcolor=lightcoral]; + c [label="gen_character(global=true)" shape=diamond style=filled fillcolor=lightcoral]; + d [label="create real"] + e [label="gen_integer(global=true)" shape=diamond style=filled fillcolor=lightcoral]; + f [label="gen_real(global=true)" shape=diamond style=filled fillcolor=lightcoral]; + g [label="gen_tuple(global=true)" shape=diamond style=filled fillcolor=lightcoral]; + h [label="push to global scope"]; + i [label="return" style=filled fillcolor=lightskyblue1]; + + a -> b -> h; + a -> c -> h; + a -> e -> h; + a -> g -> h; + a -> d; + d -> e; + d -> f -> h; + + h -> i; +} diff --git a/graphviz/functions/gen_global_type.dot b/graphviz/functions/gen_global_type.dot deleted file mode 100644 index cc11192..0000000 --- a/graphviz/functions/gen_global_type.dot +++ /dev/null @@ -1,23 +0,0 @@ -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/scripts/build_graphs.sh b/scripts/build_graphs.sh index 2bddfd1..47332ef 100755 --- a/scripts/build_graphs.sh +++ b/scripts/build_graphs.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash declare path="" -declare -ra fnames=( 'functions' 'global_flow' ) if [[ "$1" == -h || "$1" == --help ]]; then cat <