41 lines
782 B
Text
41 lines
782 B
Text
digraph g {
|
|
subgraph cluster_a {
|
|
Start [shape=box,label="Enter 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 cluster_b {
|
|
StartF [shape=box,label="Enter 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}
|
|
}
|
|
}
|
|
|
|
l4 -> StartF [style=bold,constraint=false];
|
|
}
|