Graphviz: more global decls

This commit is contained in:
Akemi Izuko 2023-11-14 16:54:02 -07:00
parent 366bd7b0e2
commit fa065a9d67
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
5 changed files with 77 additions and 37 deletions

View file

@ -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;
}

View file

@ -4,19 +4,22 @@ digraph fn_gen_function {
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_function(Vec<GazType>, 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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -1,7 +1,6 @@
#!/usr/bin/env bash
declare path=""
declare -ra fnames=( 'functions' 'global_flow' )
if [[ "$1" == -h || "$1" == --help ]]; then
cat <<HELP
@ -19,10 +18,6 @@ HELP
exit 1
fi
for name in ${path}/*.dot; do
dot -Tsvg -o "${name%.*}.svg" "$name"
done
for name in ${path}/**/*.dot; do
for name in $(find "${path}" -type f -name '*.dot'); do
dot -Tsvg -o "${name%.*}.svg" "$name"
done