tfm-report/img/breakpdg.dot
2019-10-18 08:54:33 +00:00

22 lines
No EOL
757 B
Text

digraph g {
"f()" [shape=box, rank=min];
// Rank adjustment
{ rank = same; "int a = 1"; "while (a > 0)"; }
{ rank = same; "print(a)"; "a++"; }
{ rank = max; "a++"; "print(a)"; }
// Control flow
"f()" -> "int a = 1" [style=bold];
"f()" -> "while (a > 0)" [style=bold];
"while (a > 0)" -> "if (a > 10)" [style=bold];
"if (a > 10)" -> "break" [style=bold];
"break" -> "print(a)" [style=bold];
"break" -> "a++" [style=bold];
"break" -> "while (a > 0)" [style=bold];
// Data flow
"int a = 1" -> "while (a > 0)" [color=red];
"int a = 1" -> "if (a > 10)" [color=red];
"int a = 1" -> "print(a)" [color=red];
"a++" -> "a++" -> "while (a > 0)" [color=red];
"a++" -> "if (a > 10)" [color=red];
"a++" -> "print(a)" [color=red];
}