2019-11-15 22:34:58 +01:00
|
|
|
digraph g {
|
2019-12-04 16:47:37 +01:00
|
|
|
Start [shape=box,label=<Start<br/>x = x_in>];
|
2019-12-09 21:47:09 +01:00
|
|
|
End [shape=box,label=<End>];
|
|
|
|
NE [label = <x_out = x<br/>Normal exit>];
|
2019-11-15 22:34:58 +01:00
|
|
|
Start -> "if (x < 0)" -> "throw" -> "Error exit" -> End;
|
2019-12-09 21:47:09 +01:00
|
|
|
"throw" -> "x = Math.sqrt(x)" [style=dashed];
|
|
|
|
"if (x < 0)" -> "x = Math.sqrt(x)" -> NE -> End;
|
2019-12-04 16:47:37 +01:00
|
|
|
// pdg
|
|
|
|
f [label="f()",shape=rect];
|
|
|
|
x_in [label = "x = x_in", style = dashed];
|
2019-12-09 21:47:09 +01:00
|
|
|
x_out [label = "x = x_out", style = dashed];
|
2019-12-04 16:47:37 +01:00
|
|
|
if [label = "if (x < 0)"];
|
|
|
|
t [label = "throw"];
|
2019-12-09 21:47:09 +01:00
|
|
|
ret [label = "x = Math.sqrt(x)"];
|
2019-12-04 16:47:37 +01:00
|
|
|
ee [label = "error exit", style = dashed];
|
|
|
|
ne [label = "normal exit", style = dashed];
|
|
|
|
f -> x_in;
|
|
|
|
f -> if -> t -> {ret ee ne};
|
2019-12-09 21:47:09 +01:00
|
|
|
ne -> x_out;
|
2019-12-04 16:47:37 +01:00
|
|
|
{ edge [color = red, constraint = false];
|
|
|
|
x_in -> {if ret};
|
2019-12-09 21:47:09 +01:00
|
|
|
ret -> x_out;
|
2019-12-04 16:47:37 +01:00
|
|
|
}
|
|
|
|
}
|