review of paper

This commit is contained in:
Carlos Galindo 2019-12-03 14:12:13 +00:00
parent 40bffb73a8
commit ee58837daf
13 changed files with 340 additions and 306 deletions

View file

@ -1,6 +1,13 @@
digraph g {
Start [shape=box];
End [shape=box];
f [label=<x_in = a<br/>y_in = b<br/>f (a, b)<br/>b = x_out>]
Start -> "a = 10" -> "b = 20" -> f -> "print(a)" -> End;
subgraph a {
Start [shape=box];
End [shape=box];
f [label=<f (a, b)>]
Start -> "a = 10" -> "b = 20" -> f -> End;
}
subgraph b {
s [shape=box,label=<Start>];
End2 [shape=box,label=<End>];
s -> "while (x > y)" -> "x = x - 1" -> "while (x > y)" -> "print(x)" -> End2;
}
}

Binary file not shown.

View file

@ -0,0 +1,58 @@
digraph g {
// nodes g()
subgraph cluster_g {
enter_g [label=<entry<br/>g()>,shape=rect,style=filled];
a_in [label="a = a_in",style="dashed,filled"];
l14 [label="if (a == 0)",style=filled]
l15 [label="throw new Exception()",style=filled];
l17 [label="System.out.println(a)",style="filled,bold"];
gee [label="error exit",style="dashed"];
gne [label="normal exit",style="dashed"];
}
// nodes f()
subgraph cluster_f {
enter_f [label=<entry<br/>f()>,shape=rect,style=filled];
fee [label="error exit",style="dashed"]
x_in [label="x = x_in",style="dashed,filled"];
l3 [label="g(x)",style=filled];
l3_in [label="a_in = x",style="dashed,filled"];
nr3 [label="normal return",style="dashed"];
nr10 [label="normal return",style="dashed"];
l4 [label="catch (Exception e)"];
l5 [label="System.err.println(\"Error\")"];
l8 [label="System.out.println(\"g() was ok\")"];
l10 [label="g(x + 1)",style=filled];
l10_in [label="a_in = x + 1",style="dashed,filled"];
try [style=filled];
//{rank=same; l3_in nr3}
//{rank=same; l10_in nr10 fee}
//{rank=same; x_in try}
}
// control g()
enter_g -> a_in;
enter_g -> l14 -> l15 -> gee;
{l14 l15} -> l17;
l14 -> gne;
// control f()
enter_f -> {x_in l10};
enter_f -> try -> l3 -> {nr3; l4};
nr3 -> l8;
l4 -> l5;
l10 -> {nr10; fee};
l3 -> l3_in;
l10 -> l10_in;
{ // data
edge [color=red,constraint=false];
a_in -> l14 [constraint=true];
a_in -> l17;
x_in -> {l3_in l10_in};
}
{ // order
edge [style=invis];
//a_in -> gne -> gee;
//x_in -> try;
//l3_in -> nr3 -> l4;
//l10_in -> nr10 -> fee;
}
}

Binary file not shown.

26
img/parameter-passing.dot Normal file
View file

@ -0,0 +1,26 @@
digraph G {
// p [label=<x_in = a + b<br/>y_in = c<br/>f()<br/>c = y_out>,shape=rect];
f_call [label="f()"]
x_in [label="x_in = a + b"]
y_in [label="y_in = c"]
y_out [label="c = y_out"]
f_call -> {x_in y_in y_out};
f_start [label="enter f"];
fx_in [label="x = x_in"];
fy_in [label="y = y_in"];
fy_out [label="y_out = y"];
f_start -> {fx_in fy_in fy_out};
f_call -> f_start [style=bold];
y_in -> f_start [style=invis];
x_in -> fx_in [style=dashed];
y_in -> fy_in [style=dashed];
fy_out -> y_out [constraint=false,style=dashed];
invis [height=0.001,width=0.001,style=invis];
invis2 [height=0.001,width=0.001,style=invis];
{rank=same; x_in y_in y_out invis};
{rank=same; fx_in fy_in invis2 fy_out};
{edge [style=invis];
x_in -> y_in -> invis -> y_out;
fx_in -> fy_in -> invis2 -> fy_out;
}
}

BIN
img/parameter-passing.pdf Normal file

Binary file not shown.

View file

@ -1,50 +1,41 @@
digraph g {
subgraph {
l1; l2; l3; l4; l5;
"x_in = a"; "y_in = b"; "a = x_out";
subgraph cluster_a {
Start [shape=box,label="Start main()"];
l2 [label="a = 10"];
l3 [label="b = 20"];
l4 [label="f(a, b)"];
// Rank
{ rank = same; l2; l3; l4; }
{ rank = min; Start; }
// Control
{ edge [style = bold];
Start -> { l2 l3 l4 };
}
// Data
{ edge [color = red];
{l2 l3} -> l4;
}
// Order
{ edge [style = invis];
l2 -> l3 -> l4;
}
}
subgraph {
l8; l9; l10; l12;
"x = x_in"; "y = y_in"; "x_out = x";
subgraph cluster_b {
StartF [shape=box,label="Start f()"];
l8 [label="while (x > y)"];
l9 [label="x = x + 1"];
l11 [label="print(x)"];
{rank=max; l9}
{rank=same; l8 l11}
{rank=min; StartF}
StartF -> {l8 l11}
l8 -> l9;
{ edge [color = red, constraint = false];
StartF -> {l8 l9 l11}
l9 -> {l8 l9 l11}
}
}
l1 [label="main()"];
l2 [label="a = 10"];
l3 [label="b = 20"];
l4 [label="f(a, b)"];
l5 [label="print(a)"];
l8 [label="f()"];
l9 [label="while (x > y)"];
l10 [label="x = x + 1"];
l12 [label="print(x)"];
// Rank
{ rank = same; l9; l12; }
// s0 -> s2 [style=invis];
// Control
{
edge [style = bold];
l1 -> {l2 l3 l4 l5};
l4 -> {"x_in = a" "y_in = b" "a = x_out"};
l8 -> {"x = x_in" "y = y_in" l9 l12 "x_out = x"};
l9 -> l10;
}
// Data
{
edge [color = red];
edge [constraint = false];
l2 -> "x_in = a";
l3 -> "y_in = b";
"a = x_out" -> l5;
{"x = x_in" l10} -> {l9 l10 l12 "x_out = x"};
"y = y_in" -> l9;
}
{
edge [style=dashed];
edge [constraint=false];
"x_in = a" -> "x = x_in";
"y_in = b" -> "y = y_in";
l4 -> l8 [constraint=true];
"x_out = x" -> "a = x_out";
}
{edge [color=blue,constraint=false]; {"x_in = a" "y_in = b"} -> "a = x_out"}
{edge [style=invis]; "y_in = b" -> l8; "y = y_in" -> l9; }
l4 -> StartF [style=bold,constraint=false];
}

Binary file not shown.