1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;
|