summaryrefslogtreecommitdiff
path: root/docs/chapter06/06-graph4-true.gv
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2023-11-11 23:17:22 +0000
committerCliff Click <cliffc@acm.org>2025-02-07 08:58:36 -0800
commit553bc38e3e0ec56eefe4b1f7aae6dc194beffa0e (patch)
tree0c5ab0ff0f207b3f0eecb4af2c3ad1daca2723a0 /docs/chapter06/06-graph4-true.gv
parente0dabd29347b2cccce4e8d0a075a0600d5fffdb2 (diff)
downloadSimple-553bc38e3e0ec56eefe4b1f7aae6dc194beffa0e.tar.gz
Simple-553bc38e3e0ec56eefe4b1f7aae6dc194beffa0e.zip
Chapter 6: Peepholes for If
Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Co-authored-by: Thalia Archibald <thalia@archibald.dev> Co-authored-by: Yichen Yan <oraluben@outlook.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: Tamas Hadhazy <helsgithub15@gmail.com> Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com>
Diffstat (limited to 'docs/chapter06/06-graph4-true.gv')
-rw-r--r--docs/chapter06/06-graph4-true.gv37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/chapter06/06-graph4-true.gv b/docs/chapter06/06-graph4-true.gv
new file mode 100644
index 00000000..6e48ee7d
--- /dev/null
+++ b/docs/chapter06/06-graph4-true.gv
@@ -0,0 +1,37 @@
+digraph chapter06 {
+/*
+int a = 0;
+int b = 1;
+int c = 0;
+if( arg ) {
+ a = 1;
+ if( arg==2 ) { c=2; } else { c=3; }
+ if( arg ) { b = 2; }
+ else b = 3;
+}
+return a+b+c;
+
+*/
+ rankdir=BT;
+ ordering="in";
+ concentrate="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_44 [ label="#6" ];
+ Return45 [ shape=box style=filled fillcolor=yellow label="Return" ];
+ }
+ edge [ fontname=Helvetica, fontsize=8 ];
+ Stop3 -> Return45[taillabel=0 color=red];
+ Return45 -> Start2:p0[taillabel=0 color=red];
+ Return45 -> Con_44[taillabel=1];
+}