first running version

This commit is contained in:
Jan-Niclas Loosen
2026-01-22 00:18:15 +01:00
parent 36ef2fd23d
commit c66222050b
12 changed files with 529 additions and 83 deletions

View File

@@ -1,64 +1,63 @@
digraph CFG {
node [fontname="Helvetica"];
n31 [label="START", shape=circle];
n31 -> n59;
n59 [label="f(2,3)", shape=box];
n59 -> n33;
n33 [label="f(['x', 'y', 'z']) { y = 2; z = 3; let g(['x']) { x = 7; if ((y > 0)) then { g(y) } else { x = 8 }; x } in (g(x) + x) }", shape=box];
n33 -> n35;
n35 [label="2", shape=box];
n35 -> n36;
n36 [label="y = 2", shape=box];
n36 [label="2", shape=box];
n36 -> n37;
n37 [label="3", shape=box];
n37 -> n38;
n38 [label="z = 3", shape=box];
n38 -> n55;
n55 [label="g(x)", shape=box];
n55 -> n39;
n39 [label="g(['x']) { x = 7; if ((y > 0)) then { g(y) } else { x = 8 }; x }", shape=box];
n39 -> n41;
n41 [label="7", shape=box];
n41 -> n42;
n42 [label="x = 7", shape=box];
n42 -> n43;
n43 [label="y", shape=box];
n43 -> n44;
n44 [label="0", shape=box];
n44 -> n45;
n45 [label="(y > 0)", shape=box];
n45 -> n46;
n46 [label="(y > 0)", shape=diamond];
n46 -> n47;
n47 [label="", shape=box];
n47 -> n50;
n50 [label="g(y)", shape=box];
n50 -> n39;
n46 -> n48;
n48 [label="", shape=box];
n48 -> n52;
n52 [label="8", shape=box];
n52 -> n53;
n53 [label="x = 8", shape=box];
n53 -> n49;
n49 [label="", shape=box];
n49 -> n54;
n54 [label="x", shape=box];
n54 -> n40;
n40 [label="g(['x']) { x = 7; if ((y > 0)) then { g(y) } else { x = 8 }; x }", shape=box];
n40 -> n51;
n51 [label="", shape=box];
n51 -> n49;
n40 -> n56;
n56 [label="", shape=box];
n56 -> n57;
n57 [label="x", shape=box];
n57 -> n58;
n58 [label="(g(x) + x)", shape=box];
n58 -> n34;
n34 [label="f(['x', 'y', 'z']) { y = 2; z = 3; let g(['x']) { x = 7; if ((y > 0)) then { g(y) } else { x = 8 }; x } in (g(x) + x) }", shape=box];
n34 -> n60;
n60 [label="", shape=box];
n60 -> n32;
n32 [label="END", shape=doublecircle];
n37 [label="CALL f(2, 3)", shape=box, style=filled, color=orange];
n37 -> n4;
n4 [label="START f(x, y, z)", shape=box, style=filled, color=green];
n4 -> n6;
n6 [label="2", shape=box];
n6 -> n7;
n7 [label="y = 2", shape=box];
n7 -> n8;
n8 [label="3", shape=box];
n8 -> n9;
n9 [label="z = 3", shape=box];
n9 -> n29;
n29 [label="x", shape=box];
n29 -> n30;
n30 [label="CALL g(x)", shape=box, style=filled, color=orange];
n30 -> n11;
n11 [label="START g(x)", shape=box, style=filled, color=green];
n11 -> n13;
n13 [label="7", shape=box];
n13 -> n14;
n14 [label="x = 7", shape=box];
n14 -> n15;
n15 [label="y", shape=box];
n15 -> n16;
n16 [label="0", shape=box];
n16 -> n17;
n17 [label="(y > 0)", shape=box];
n17 -> n18;
n18 [label="<>", shape=diamond];
n18 -> n22 [label="T"];
n22 [label="y", shape=box];
n22 -> n23;
n23 [label="CALL g(y)", shape=box, style=filled, color=orange];
n23 -> n11;
n23 -> n25;
n25 [label="RET g(y)", shape=box, style=filled, color=orange];
n28 [label="x", shape=box];
n28 -> n12;
n12 [label="END g(x)", shape=box, style=filled, color=green];
n12 -> n25;
n12 -> n32;
n32 [label="RET g(x)", shape=box, style=filled, color=orange];
n32 -> n33;
n33 [label="x", shape=box];
n33 -> n34;
n34 [label="(g(x) + x)", shape=box];
n34 -> n5;
n5 [label="END f(x, y, z)", shape=box, style=filled, color=green];
n5 -> n39;
n39 [label="RET f(2, 3)", shape=box, style=filled, color=orange];
n34 -> n5;
n18 -> n26 [label="F"];
n26 [label="8", shape=box];
n26 -> n27;
n27 [label="x = 8", shape=box];
n27 -> n28;
n30 -> n32;
n37 -> n39;
}