summaryrefslogtreecommitdiff
path: root/docs/chapter10/example1.gv
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-04-23 17:23:16 +0100
committerCliff Click <cliffc@acm.org>2025-02-07 08:58:36 -0800
commitc2b00feb2613e12ef4cafb2b6e022cb2831f68b8 (patch)
tree1b9d47f47e3c33373c19b26dc20a34ce7061409c /docs/chapter10/example1.gv
parentcba428d358f6027cb2cfe63f814f0a535daba613 (diff)
downloadSimple-c2b00feb2613e12ef4cafb2b6e022cb2831f68b8.tar.gz
Simple-c2b00feb2613e12ef4cafb2b6e022cb2831f68b8.zip
Chapter 10: Structs and Memory
Co-authored-by: Thalia Archibald <thalia@archibald.dev> Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: tannal <tannal2409@gmail.com> Co-authored-by: hadha <helsgithub15@gmail.com> Co-authored-by: XmiliaH <xmilia.hermit@gmail.com> Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com>
Diffstat (limited to 'docs/chapter10/example1.gv')
-rw-r--r--docs/chapter10/example1.gv78
1 files changed, 78 insertions, 0 deletions
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=<
+ <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
+ <TR><TD BGCOLOR="yellow">Start</TD></TR>
+ <TR><TD>
+ <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
+ <TR><TD PORT="p0" BGCOLOR="yellow">$ctrl</TD><TD PORT="p1">arg</TD><TD PORT="p2">$2</TD><TD PORT="p3">$3</TD></TR>
+ </TABLE>
+ </TD></TR>
+ </TABLE>>
+ ];
+ 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=<
+ <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
+ <TR><TD BGCOLOR="yellow">If</TD></TR>
+ <TR><TD>
+ <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
+ <TR><TD PORT="p0" BGCOLOR="yellow">True</TD><TD PORT="p1" BGCOLOR="yellow">False</TD></TR>
+ </TABLE>
+ </TD></TR>
+ </TABLE>>
+ ];
+ 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="&phi;_$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];
+}