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/example2b.gv | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docs/chapter10/example2b.gv (limited to 'docs/chapter10/example2b.gv') diff --git a/docs/chapter10/example2b.gv b/docs/chapter10/example2b.gv new file mode 100644 index 00000000..d732e874 --- /dev/null +++ b/docs/chapter10/example2b.gv @@ -0,0 +1,56 @@ +digraph chapter10 { +/* +struct Bar { + int a; + int b; +} +struct Foo { + int x; +} +Foo? foo = null; +Bar bar = new Bar; +bar.a = 1; +bar.a = 2; +return bar.a; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$2$3$4
+
> + ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + new10 [ label="new Bar" ]; + Con_11 [ label="#0" ]; + Store13 [ label=".b =" ]; + Con_16 [ label="#2" ]; + Store17 [ label=".a =" ]; + Load18 [ label=".a" ]; + Return19 [ shape=box style=filled fillcolor=yellow label="Return" ]; + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return19[taillabel=0 color=red]; + new10 -> Start2:p0[taillabel=0 color=green]; + Store13 -> Start2:p3[taillabel=1 color=blue]; + Store13 -> new10[taillabel=2]; + Store13 -> Con_11[taillabel=3]; + Store17 -> Start2:p2[taillabel=1 color=blue]; + Store17 -> new10[taillabel=2]; + Store17 -> Con_16[taillabel=3]; + Load18 -> Store17[taillabel=1 color=blue]; + Load18 -> new10[taillabel=2]; + Return19 -> Start2:p0[taillabel=0 color=red]; + Return19 -> Load18[taillabel=1]; + Return19 -> Store17[taillabel=2 color=blue]; + Return19 -> Store13[taillabel=3 color=blue]; + Return19 -> Start2:p4[taillabel=4 color=blue]; +} -- cgit v1.2.3