51 lines
1.1 KiB
Text
51 lines
1.1 KiB
Text
|
digraph g {
|
||
|
subgraph {
|
||
|
l1; l2; l3; l4; l5;
|
||
|
"x_in = a"; "y_in = b"; "a = x_out";
|
||
|
}
|
||
|
subgraph {
|
||
|
l8; l9; l10; l12;
|
||
|
"x = x_in"; "y = y_in"; "x_out = x";
|
||
|
}
|
||
|
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; }
|
||
|
}
|