Graphviz: more global decls
This commit is contained in:
parent
366bd7b0e2
commit
fa065a9d67
5 changed files with 77 additions and 37 deletions
34
graphviz/functions/gen_decl.dot
Normal file
34
graphviz/functions/gen_decl.dot
Normal 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;
|
||||||
|
}
|
|
@ -4,19 +4,22 @@ digraph fn_gen_function {
|
||||||
node [fontname = "cc wild words"];
|
node [fontname = "cc wild words"];
|
||||||
edge [fontname = "cc wild words"];
|
edge [fontname = "cc wild words"];
|
||||||
|
|
||||||
label="fn_gen_function(Vec<GazType>, return: GazType)";
|
label="fn_gen_subroutine(SubRoutine)";
|
||||||
fontname=lovebeat;
|
fontname=lovebeat;
|
||||||
rankdir=TB;
|
rankdir=TB;
|
||||||
newrank=true;
|
newrank=true;
|
||||||
|
|
||||||
A [label="push args into scope"];
|
a [label="push args into scope"];
|
||||||
B [label="new scope"];
|
b [label="new scope"];
|
||||||
C [label="gen_statement()" shape=diamond style=filled
|
c [label="gen_statement()" shape=diamond style=filled
|
||||||
fillcolor=lightcoral];
|
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];
|
fillcolor=lightcoral];
|
||||||
F [label="return" style=filled fillcolor=lightskyblue1];
|
f [label="return" style=filled fillcolor=lightskyblue1];
|
||||||
|
|
||||||
A -> B -> C -> D -> F;
|
a -> b -> c -> d;
|
||||||
C -> C [dir=back];
|
c -> c [dir=back];
|
||||||
|
d -> e -> f;
|
||||||
|
d -> f;
|
||||||
}
|
}
|
||||||
|
|
31
graphviz/functions/gen_global_decl.dot
Normal file
31
graphviz/functions/gen_global_decl.dot
Normal 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;
|
||||||
|
}
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
declare path=""
|
declare path=""
|
||||||
declare -ra fnames=( 'functions' 'global_flow' )
|
|
||||||
|
|
||||||
if [[ "$1" == -h || "$1" == --help ]]; then
|
if [[ "$1" == -h || "$1" == --help ]]; then
|
||||||
cat <<HELP
|
cat <<HELP
|
||||||
|
@ -19,10 +18,6 @@ HELP
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for name in ${path}/*.dot; do
|
for name in $(find "${path}" -type f -name '*.dot'); do
|
||||||
dot -Tsvg -o "${name%.*}.svg" "$name"
|
|
||||||
done
|
|
||||||
|
|
||||||
for name in ${path}/**/*.dot; do
|
|
||||||
dot -Tsvg -o "${name%.*}.svg" "$name"
|
dot -Tsvg -o "${name%.*}.svg" "$name"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue