From 2b61f5bcc096bb544658d6ee2c49ebfb053c3d70 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Tue, 23 Apr 2024 17:23:16 +0100 Subject: Chapter 10: Structs and Memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thalia Archibald Co-authored-by: Dibyendu Majumdar Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: tannal Co-authored-by: hadha Co-authored-by: XmiliaH Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: Robert Obkircher --- docs/chapter10/example1.gv | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 docs/chapter10/example1.gv (limited to 'docs/chapter10/example1.gv') diff --git a/docs/chapter10/example1.gv b/docs/chapter10/example1.gv new file mode 100644 index 00000000..cbb12cb5 --- /dev/null +++ b/docs/chapter10/example1.gv @@ -0,0 +1,78 @@ +digraph chapter10 { +/* +struct Vector2D { int x; int y; } +Vector2D v = new Vector2D; +v.x = 1; +if (arg) + v.y = 2; +else + v.y = 3; +return v; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrlarg$2$3
+
> + ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + new8 [ label="new Vector2D" ]; + Con_9 [ label="#0" ]; + Store11 [ label=".y =" ]; + Con_12 [ label="#1" ]; + Store13 [ label=".x =" ]; + If14 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Con_18 [ label="#2" ]; + Store19 [ label=".y =" ]; + Con_22 [ label="#3" ]; + Store23 [ label=".y =" ]; + Region24 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_326 [ style=filled fillcolor=lightyellow label="φ_$3" ]; + Return27 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Region24;Phi_326;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return27[taillabel=0 color=red]; + new8 -> Start2:p0[taillabel=0 color=green]; + Store11 -> Start2:p3[taillabel=1 color=blue]; + Store11 -> new8[taillabel=2]; + Store11 -> Con_9[taillabel=3]; + Store13 -> Start2:p2[taillabel=1 color=blue]; + Store13 -> new8[taillabel=2]; + Store13 -> Con_12[taillabel=3]; + If14 -> Start2:p0[taillabel=0 color=red]; + If14 -> Start2:p1[taillabel=1]; + Store19 -> Store11[taillabel=1 color=blue]; + Store19 -> new8[taillabel=2]; + Store19 -> Con_18[taillabel=3]; + Store23 -> Store11[taillabel=1 color=blue]; + Store23 -> new8[taillabel=2]; + Store23 -> Con_22[taillabel=3]; + Region24 -> If14:p0[taillabel=1 color=red]; + Region24 -> If14:p1[taillabel=2 color=red]; + Phi_326 -> Region24 [style=dotted taillabel=0]; + Phi_326 -> Store19[taillabel=1 color=blue]; + Phi_326 -> Store23[taillabel=2 color=blue constraint=false]; + Return27 -> Region24[taillabel=0 color=red]; + Return27 -> new8[taillabel=1]; + Return27 -> Store13[taillabel=2 color=blue]; + Return27 -> Phi_326[taillabel=3 color=blue]; +} -- cgit v1.2.3