summaryrefslogtreecommitdiff
path: root/docs/chapter07/07-graph4.gv
diff options
context:
space:
mode:
authorDibyendu Majumdar <mobile@majumdar.org.uk>2023-12-03 23:23:04 +0000
committerDibyendu Majumdar <mobile@majumdar.org.uk>2026-08-10 11:11:18 -0700
commit43d3ee3722dc08d87f787cd6eae75cc0359af621 (patch)
treeb85dec25dafde51957d17d849f7e6e3426a32d9c /docs/chapter07/07-graph4.gv
parentbacc96cb93d078034390be678f8b986149d540ee (diff)
downloadSimple-43d3ee3722dc08d87f787cd6eae75cc0359af621.tar.gz
Simple-43d3ee3722dc08d87f787cd6eae75cc0359af621.zip
Chapter 7: While Statement
Co-authored-by: Cliff Click <cliffc@acm.org> Co-authored-by: Thalia Archibald <thalia@archibald.dev> Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: tannal <tannal2409@gmail.com> Co-authored-by: hadha <helsgithub15@gmail.com> Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: RobertObkircher <robert.obkircher@gmail.com> Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com>
Diffstat (limited to 'docs/chapter07/07-graph4.gv')
-rw-r--r--docs/chapter07/07-graph4.gv96
1 files changed, 96 insertions, 0 deletions
diff --git a/docs/chapter07/07-graph4.gv b/docs/chapter07/07-graph4.gv
new file mode 100644
index 00000000..24ace3da
--- /dev/null
+++ b/docs/chapter07/07-graph4.gv
@@ -0,0 +1,96 @@
+digraph chapter07 {
+/*
+int a = 1;
+int b = 2;
+while(a < 10) {
+ if (a == 2) a = 3;
+ else b = 4;
+}
+return b;
+
+*/
+ rankdir=BT;
+ ordering="in";
+ 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></TR>
+ </TABLE>
+ </TD></TR>
+ </TABLE>>
+ ];
+ Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ];
+ Con_6 [ label="1" ];
+ Con_7 [ label="2" ];
+ Loop8 [ shape=box style=filled fillcolor=yellow label="Loop" ];
+ Phi_a11 [ style=filled fillcolor=lightyellow label="&phi;_a" ];
+ Phi_b12 [ style=filled fillcolor=lightyellow label="&phi;_b" ];
+ Con_13 [ label="10" ];
+ LT14 [ label="<" ];
+ If15 [ 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_19 [ label="2" ];
+ EQ20 [ label="==" ];
+ If21 [ 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_25 [ label="3" ];
+ Con_26 [ label="4" ];
+ Region27 [ shape=box style=filled fillcolor=yellow label="Region" ];
+ Phi_a28 [ style=filled fillcolor=lightyellow label="&phi;_a" ];
+ Phi_b29 [ style=filled fillcolor=lightyellow label="&phi;_b" ];
+ Return30 [ shape=box style=filled fillcolor=yellow label="Return" ];
+ { rank=same; Loop8;Phi_a11;Phi_b12;}
+ { rank=same; Region27;Phi_b29;Phi_a28;}
+ }
+ node [shape=plaintext];
+ edge [ fontname=Helvetica, fontsize=8 ];
+ Stop3 -> Return30[taillabel=0 color=red];
+ Loop8 -> Start2:p0[taillabel=1 color=red];
+ Loop8 -> Region27[taillabel=2 color=red constraint=false];
+ Phi_a11 -> Loop8 [style=dotted taillabel=0];
+ Phi_a11 -> Con_6[taillabel=1];
+ Phi_a11 -> Phi_a28[taillabel=2 constraint=false];
+ Phi_b12 -> Loop8 [style=dotted taillabel=0];
+ Phi_b12 -> Con_7[taillabel=1];
+ Phi_b12 -> Phi_b29[taillabel=2 constraint=false];
+ LT14 -> Phi_a11[taillabel=1];
+ LT14 -> Con_13[taillabel=2];
+ If15 -> Loop8[taillabel=0 color=red];
+ If15 -> LT14[taillabel=1];
+ EQ20 -> Phi_a11[taillabel=1];
+ EQ20 -> Con_19[taillabel=2];
+ If21 -> If15:p0[taillabel=0 color=red];
+ If21 -> EQ20[taillabel=1];
+ Region27 -> If21:p0[taillabel=1 color=red];
+ Region27 -> If21:p1[taillabel=2 color=red];
+ Phi_a28 -> Region27 [style=dotted taillabel=0];
+ Phi_a28 -> Con_25[taillabel=1];
+ Phi_a28 -> Phi_a11[taillabel=2 constraint=false];
+ Phi_b29 -> Region27 [style=dotted taillabel=0];
+ Phi_b29 -> Phi_b12[taillabel=1];
+ Phi_b29 -> Con_26[taillabel=2 constraint=false];
+ Return30 -> If15:p1[taillabel=0 color=red];
+ Return30 -> Phi_b12[taillabel=1];
+ edge [style=dashed color=cornflowerblue];
+}