diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /web/yacco2/diagrams/parse_stk_env.mp |
Initial commit
Diffstat (limited to 'web/yacco2/diagrams/parse_stk_env.mp')
-rw-r--r-- | web/yacco2/diagrams/parse_stk_env.mp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/web/yacco2/diagrams/parse_stk_env.mp b/web/yacco2/diagrams/parse_stk_env.mp new file mode 100644 index 0000000000..8f41b2bed8 --- /dev/null +++ b/web/yacco2/diagrams/parse_stk_env.mp @@ -0,0 +1,53 @@ +% file: yacco2_stbl.mp +input boxes +beginfig(1); +u=1cc; + +% parse stack +pair sw,se,ne,nw; +pair zx,zy; + +sw:=(5u,0); +se:=(6u,0); +ne:=(6u,4u); +nw:=(5u,4u); +draw sw--se--ne--nw--cycle; +%outline the bytes +for i=1 upto 3: + zx:=(5u,i*u);zy:=(6u,i*u); + if i = 3: + draw zx{dir 45} .. .5[zx,zy] {dir -45} .. zy; + else: + draw zx--zy; + fi +endfor + +% label subscripts +defaultscale:=.6; +for i=0 upto 3: + zy:=(6u,i*u); + string a; + if i=3: + a := "max stk items"; + label.rt(a,zy); + else: + a:=decimal (i); + label.rt(substring(0,1)of a,zy); + fi +endfor +label.bot(btex parse stack[].parse$\_$record etex,(6u,0u)); + +defaultscale:=1; + + +%outline parse record +label.rt(btex parse$\_$record: etex,(9u,6u)); +label.rt(btex $\bullet\ $symbol$\uparrow$ etex,(10u,5u)); +label.rt(btex $\bullet\ $state$\uparrow$ etex,(10u,4u)); +label.rt(btex $\bullet\ $aborted\ boolean valued etex,(10u,3u)); +label.rt(btex $\bullet\ $Rule$\_$s$\_$reuse$\_$entry$\uparrow$ etex,(10u,2u)); +label.rt(btex $\bullet\ $recycled rule$\uparrow$ etex,(12u,1u)); +label.rt(btex $\bullet\ $used on stack --- boolean valued etex,(12u,0u)); +endfig; + +end; |