tfm-report/img/breakpdg.dot

29 lines
757 B
Text
Raw Normal View History

2019-10-18 10:54:33 +02:00
digraph g {
"f()" [shape=box, rank=min, style = filled];
2019-10-18 10:54:33 +02:00
// Rank adjustment
{ node [style=filled]
2019-10-18 10:54:33 +02:00
{ rank = same; "int a = 1"; "while (a > 0)"; }
"if (a > 10)"; break;
}
2019-10-18 10:54:33 +02:00
{ rank = same; "print(a)"; "a++"; }
{ rank = max; "a++"; "print(a)"; }
"a++" [style="filled,bold"];
2019-10-18 10:54:33 +02:00
// Control flow
"f()" -> "while (a > 0)";
"f()" -> "int a = 1";
"while (a > 0)" -> "if (a > 10)";
"if (a > 10)" -> "break";
"break" -> "print(a)";
"break" -> "a++";
"break" -> "while (a > 0)";
2019-10-18 10:54:33 +02:00
// Data flow
{ edge [color = red];
"int a = 1" -> "while (a > 0)";
"int a = 1" -> "if (a > 10)";
"int a = 1" -> "print(a)";
"a++" -> "a++";
"a++" -> "while (a > 0)";
"a++" -> "if (a > 10)";
"a++" -> "print(a)" [constraint = true];
}
2019-10-18 10:54:33 +02:00
}