Graphviz: statements

This commit is contained in:
Akemi Izuko 2023-11-14 18:11:43 -07:00
parent 777522a048
commit 483832e7a4
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
10 changed files with 110 additions and 7 deletions

View file

@ -11,7 +11,7 @@ digraph fn_args {
newrank=true; newrank=true;
A [label="for each type"]; A [label="for each type"];
B [label="gen_type(GazType)" shape=diamond style=filled fillcolor=lightcoral]; B [label="get_instant(GazType)" shape=diamond style=filled fillcolor=lightcoral];
C [label="pack into var"]; C [label="pack into var"];
D [label="return" style=filled fillcolor=lightskyblue]; D [label="return" style=filled fillcolor=lightskyblue];
A -> B -> C -> A; A -> B -> C -> A;

View file

@ -21,6 +21,8 @@ digraph fn_gen_decl {
j [label="push to const scope"]; j [label="push to const scope"];
k [label="return" style=filled fillcolor=lightskyblue1]; k [label="return" style=filled fillcolor=lightskyblue1];
{rank=same; b c e f g}
a -> b -> h; a -> b -> h;
a -> c -> h; a -> c -> h;
a -> e -> h; a -> e -> h;

View file

@ -13,7 +13,7 @@ digraph fn_gen_return {
b [label="gen_if_statement_with_return()" shape=diamond style=filled fillcolor=lightcoral]; b [label="gen_if_statement_with_return()" shape=diamond style=filled fillcolor=lightcoral];
c [label="gen_loop_with_return()" shape=diamond style=filled fillcolor=lightcoral]; c [label="gen_loop_with_return()" shape=diamond style=filled fillcolor=lightcoral];
d [label="return"]; d [label="return"];
e [label="gen_type()" shape=diamond style=filled fillcolor=lightcoral]; e [label="gen correct type"];
f [label="return" style=filled fillcolor=lightskyblue1]; f [label="return" style=filled fillcolor=lightskyblue1];
a -> b -> f; a -> b -> f;

View file

@ -4,7 +4,7 @@ digraph fn_get_instant {
node [fontname = "cc wild words"]; node [fontname = "cc wild words"];
edge [fontname = "cc wild words"]; edge [fontname = "cc wild words"];
label="fn_gen_boolean()"; label="fn_gen_instant(type: GazType)";
fontname=lovebeat; fontname=lovebeat;
rankdir=TB; rankdir=TB;
newrank=true; newrank=true;

View file

@ -0,0 +1,31 @@
digraph fn_gen_assignment {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_assignment(type: GazType)";
fontname=lovebeat;
rankdir=LR;
newrank=true;
a [label="fork on type"];
// read from stdinput
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];
k [label="return" style=filled fillcolor=lightskyblue1];
{rank=same; b c e f g}
a -> b -> k;
a -> c -> k;
a -> e -> k;
a -> g -> k;
a -> d;
d -> e;
d -> f -> k;
}

View file

@ -0,0 +1,32 @@
digraph fn_gen_if_statement {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_if_statement(with_return: Option<GazType>)";
fontname=lovebeat;
rankdir=TB;
newrank=true;
a [label="gen_boolean()" shape=diamond style=filled fillcolor=lightcoral];
b [label="push new scope"];
c [label="gen_statement(with_return)" shape=diamond style=filled fillcolor=lightcoral];
d [label="choice"];
e [label="else if"];
f [label="gen_if_statement(with_return)" shape=diamond style=filled fillcolor=lightcoral];
g [label="else"];
h [label="push new scope"];
i [label="gen_statement(with_return)" shape=diamond style=filled fillcolor=lightcoral];
j [label="return" style=filled fillcolor=lightskyblue1];
{rank=same; e g}
{rank=same; f i}
a -> b -> c -> d;
d -> e -> f -> d;
d -> g -> h -> i -> j;
d -> j;
c -> c [dir=back];
i -> i [dir=back];
}

View file

@ -0,0 +1,22 @@
digraph fn_gen_loop {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_loop(with_return: Option<GazType>)";
fontname=lovebeat;
rankdir=TB;
newrank=true;
a0 [label="choice"];
a1 [label="infinite_loop"];
a2 [label="gen_statement(with_break)" shape=diamond style=filled fillcolor=lightcoral];
a3 [label="predicate_loop"];
a4 [label="todo" style=filled fillcolor=magenta];
a5 [label="return" style=filled fillcolor=lightskyblue1];
a0 -> a1 -> a2 -> a5;
a0 -> a3 -> a4;
a2 -> a2 [dir=back];
}

View file

@ -0,0 +1,17 @@
digraph fn_gen_std_output {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_std_output(type: GazType)";
fontname=lovebeat;
rankdir=TB;
newrank=true;
a [label="fork on type"];
b [label="get_instant(type)" shape=diamond style=filled fillcolor=lightcoral];
c [label="return" style=filled fillcolor=lightskyblue1];
a -> b -> c;
}

View file

@ -3,22 +3,21 @@ digraph flow {
graph [fontname = "cc wild words"]; graph [fontname = "cc wild words"];
node [fontname = "cc wild words"]; node [fontname = "cc wild words"];
edge [fontname = "cc wild words"]; edge [fontname = "cc wild words"];
rank=TB; rankdir=LR;
A0 [label="Global" style=filled fillcolor=gold]; A0 [label="Global" style=filled fillcolor=gold];
B0 [label="declare global"];
C0 [label="end generation"]; C0 [label="end generation"];
D0 [label="for each undefined subroutine"]; D0 [label="for each undefined subroutine"];
F0 [label="return" style=filled fillcolor=lightskyblue1]; F0 [label="return" style=filled fillcolor=lightskyblue1];
node [shape=diamond style=filled fillcolor=lightsalmon]; node [shape=diamond style=filled fillcolor=lightsalmon];
FA0 [label="fn_gen_global_type(GazType)"]; FA0 [label="fn_gen_global_decl()"];
FB0 [label="fn_gen_main()"]; FB0 [label="fn_gen_main()"];
FC0 [label="fn_define_subroutine(SubRoutine)"]; FC0 [label="fn_define_subroutine(SubRoutine)"];
FD0 [label="fn_declare_subroutine()"]; FD0 [label="fn_declare_subroutine()"];
FE0 [label="fn_gen_typedef()"]; FE0 [label="fn_gen_typedef()"];
A0 -> B0 -> FA0 -> A0; A0 -> FA0 -> A0;
A0 -> C0 -> FB0 -> D0; A0 -> C0 -> FB0 -> D0;
A0 -> FD0 -> A0; A0 -> FD0 -> A0;
A0 -> FE0 -> A0; A0 -> FE0 -> A0;