diff --git a/img/try-catch-example.dot b/img/try-catch-example.dot new file mode 100644 index 0000000..da882c1 --- /dev/null +++ b/img/try-catch-example.dot @@ -0,0 +1,40 @@ +digraph G { + subgraph a { + enter [shape=rect]; + exit [shape=rect]; + enter -> try; + try -> X -> f; + f [label = y_in = y
f()>]; + f -> { "normal return"; catch; }; + "normal return" -> "x = x_out" -> Y -> Z; + catch -> "y = y_out" -> "print(error)" -> Z -> "normal exit" -> exit; + { edge [style = dashed, constraint = false]; + enter -> exit; + try -> Z; + catch -> Z; + "normal return" -> Z; + } + } + + subgraph b { + method [label="Start", shape=rect]; + t [label = "try"]; + x [label = "X"]; + x_in [label = "x_in = x"]; + y_in [label = "y_in = y"]; + call [label = "f()"]; + nr [style=dashed]; + data [style=dashed, label = "x = x_out"]; + y [label = "Y"]; + c [label = "catch"]; + data_catch [style=dashed,label="y = y_out"]; + print [label = "print(error)"]; + z [label = "Z"]; + ne [style=dashed, label = "normal exit"]; + method -> {t z ne}; + t -> {x call} + call -> {x_in y_in nr c} + nr -> {data y} + c -> {data_catch print} + } +} \ No newline at end of file diff --git a/img/try-catch-example.pdf b/img/try-catch-example.pdf new file mode 100644 index 0000000..6f69f06 Binary files /dev/null and b/img/try-catch-example.pdf differ