diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-02 16:21:02 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-02 16:21:02 -0700 |
| commit | 41ae6269689e2b3cde9f7ac4227923d4085dceda (patch) | |
| tree | 400bf2e5d6ae05564cb04aaea3104c031f321f9e /chapter10b/docs/example2a.svg | |
| parent | b33647231e20e2dc155beb2c8fe721f952d67a54 (diff) | |
| download | Simple-41ae6269689e2b3cde9f7ac4227923d4085dceda.tar.gz Simple-41ae6269689e2b3cde9f7ac4227923d4085dceda.zip | |
More better layout ch10a,b,11
Diffstat (limited to 'chapter10b/docs/example2a.svg')
| -rw-r--r-- | chapter10b/docs/example2a.svg | 185 |
1 files changed, 103 insertions, 82 deletions
diff --git a/chapter10b/docs/example2a.svg b/chapter10b/docs/example2a.svg index 47bc3a8f..b43a55b4 100644 --- a/chapter10b/docs/example2a.svg +++ b/chapter10b/docs/example2a.svg @@ -1,82 +1,103 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: Memory Pages: 1 --> -<svg width="498pt" height="105pt" - viewBox="0.00 0.00 497.99 105.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 101)"> -<title>Memory</title> -<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-101 493.99,-101 493.99,4 -4,4"/> -<!-- M --> -<g id="node1" class="node"> -<title>M</title> -<polygon fill="#dcecff" stroke="#758191" points="137.69,-71.54 137.69,-86.46 97.36,-97 40.33,-97 0,-86.46 0,-71.54 40.33,-61 97.36,-61 137.69,-71.54"/> -<text text-anchor="middle" x="68.84" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Default memory</text> -</g> -<!-- X --> -<g id="node2" class="node"> -<title>X</title> -<polygon fill="#dcecff" stroke="#758191" points="251.35,-71.54 251.35,-86.46 229.77,-97 199.26,-97 177.69,-86.46 177.69,-71.54 199.26,-61 229.77,-61 251.35,-71.54"/> -<text text-anchor="middle" x="214.52" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store x</text> -</g> -<!-- X->M --> -<g id="edge1" class="edge"> -<title>X->M</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M177.38,-79C177.38,-79 147.2,-79 147.2,-79"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="147.2,-76.55 140.2,-79 147.2,-81.45 147.2,-76.55"/> -</g> -<!-- Y --> -<g id="node3" class="node"> -<title>Y</title> -<polygon fill="#dcecff" stroke="#758191" points="251.35,-10.54 251.35,-25.46 229.77,-36 199.26,-36 177.69,-25.46 177.69,-10.54 199.26,0 229.77,0 251.35,-10.54"/> -<text text-anchor="middle" x="214.52" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store y</text> -</g> -<!-- Y->M --> -<g id="edge2" class="edge"> -<title>Y->M</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M177.51,-18C127.88,-18 45.9,-18 45.9,-18 45.9,-18 36.62,-18 36.62,-18"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="41.53,-52.16 45.41,-58.48 46.32,-51.12 41.53,-52.16"/> -</g> -<!-- MemMerge --> -<g id="node4" class="node"> -<title>MemMerge</title> -<polygon fill="#dcecff" stroke="#758191" points="395.99,-71.54 395.99,-86.46 365.34,-97 322,-97 291.35,-86.46 291.35,-71.54 322,-61 365.34,-61 395.99,-71.54"/> -<text text-anchor="middle" x="343.67" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">MemMerge</text> -</g> -<!-- MemMerge->M --> -<g id="edge3" class="edge"> -<title>MemMerge->M</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M361.11,-60.55C361.11,-54.13 361.11,-48.5 361.11,-48.5 361.11,-48.5 91.79,-48.5 91.79,-48.5 91.79,-48.5 91.79,-51.28 91.79,-51.28"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="89.34,-51.28 91.79,-58.28 94.24,-51.28 89.34,-51.28"/> -<text text-anchor="middle" x="244.96" y="-39.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">default</text> -</g> -<!-- MemMerge->X --> -<g id="edge4" class="edge"> -<title>MemMerge->X</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M291.14,-79C291.14,-79 260.84,-79 260.84,-79"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="260.84,-76.55 253.84,-79 260.84,-81.45 260.84,-76.55"/> -<text text-anchor="middle" x="278.24" y="-70.45" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">x</text> -</g> -<!-- MemMerge->Y --> -<g id="edge5" class="edge"> -<title>MemMerge->Y</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M326.23,-60.7C326.23,-42.73 326.23,-18 326.23,-18 326.23,-18 260.98,-18 260.98,-18"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="260.98,-15.55 253.98,-18 260.98,-20.45 260.98,-15.55"/> -<text text-anchor="middle" x="317.21" y="-9.45" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">y</text> -</g> -<!-- Return --> -<g id="node5" class="node"> -<title>Return</title> -<polygon fill="#fff1c4" stroke="#758191" points="489.99,-97 435.99,-97 435.99,-61 489.99,-61 489.99,-97"/> -<text text-anchor="middle" x="462.99" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> -</g> -<!-- Return->MemMerge --> -<g id="edge6" class="edge"> -<title>Return->MemMerge</title> -<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M435.61,-79C435.61,-79 405.55,-79 405.55,-79"/> -<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="405.55,-76.55 398.55,-79 405.55,-81.45 405.55,-76.55"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="598" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 598 454" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge MEM" id="e7i1" d="M84,118 L84,140 Q84,148 92,148 L135,148 Q143,148 143,156 L143,166" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#7[1] → #3 · MEM</title></path><path class="edge DATA" id="e7i2" d="M362,118 L362,123 Q362,128 357,128 L175,128 Q167,128 167,136 L167,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #5 · DATA</title></path><path class="edge DATA" id="e7i3" d="M204,118 L204,131.5 Q204,138 197.5,138 L197.5,138 Q191,138 191,144.5 L191,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[3] → #4 · DATA</title></path><path class="edge ASSOC" id="e8i0" d="M267,46 C267,70 514,41 514,65" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#8[0] → #1 · ASSOC</title></path><path class="edge MEM" id="e9i1" d="M84,118 L84,140 Q84,148 92,148 L287,148 Q295,148 295,156 L295,166" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#9[1] → #3 · MEM</title></path><path class="edge DATA" id="e9i2" d="M362,118 L362,123 Q362,128 357,128 L327,128 Q319,128 319,136 L319,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #5 · DATA</title></path><path class="edge DATA" id="e9i3" d="M514,118 L514,130 Q514,138 506,138 L351,138 Q343,138 343,146 L343,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[3] → #8 · DATA</title></path><path class="edge MEM" id="e10i1" d="M84,118 L84,224 Q84,232 92,232 L123,232 Q131,232 131,240 L131,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[1] → #3 · MEM</title></path><path class="edge MEM" id="e10i2" d="M155,222 L155,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[2] → #7 · MEM</title></path><path class="edge MEM" id="e10i3" d="M307,222 L307,227 Q307,232 302,232 L187,232 Q179,232 179,240 L179,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[3] → #9 · MEM</title></path><path class="edge MEM" id="e11i1" d="M143,326 L143,331 Q143,336 148,336 L339,336 Q347,336 347,344 L347,374" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#11[1] → #10 · MEM</title></path><path class="edge DATA" id="e11i2" d="M362,118 L362,123 Q362,128 367,128 L369.5,128 Q377,128 377,135.5 L377,374" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[2] → #5 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id"> #1</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id"> #3/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEM</title></g><g class="node" id="n4" data-id="4" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id"> #4/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 2 of #1 +Type not computed + +[0] → #1 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(302,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new Point</tspan><tspan class="node-id"> #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 new Point +Type not computed + +[0] → — CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="white"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n7" data-id="7" transform="translate(95,172)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Store p.x</tspan><tspan class="node-id"> #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60">MEM#2</text><title>#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n8" data-id="8" transform="translate(454,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#42</tspan><tspan class="node-id"> #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 #42 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n9" data-id="9" transform="translate(247,172)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Store p.y</tspan><tspan class="node-id"> #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60">MEM#3</text><title>#9 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #8 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n10" data-id="10" transform="translate(83,276)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id"> #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #7 MEM +[3] → #9 MEM</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n11" data-id="11" transform="translate(287,380)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id"> #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 Return +Type not computed + +[0] → — CTRL +[1] → #10 MEM +[2] → #5 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> |
