summaryrefslogtreecommitdiff
path: root/web/yacco2/diagrams/o2_structures.mp
blob: 0ff0d10909f1f0e4c917f1fd2af1c5e5facc0fcf (plain)
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
54
55
56
57
58
59
% file: o2_structures.mp
input boxes
beginfig(1);
u=1cc;
% state anatomy
boxit.state(btex State etex);
boxit.svectors_map(btex Vectors map etex);
boxit.follow_set_map(btex Follow set map etex);
boxit.e_symbol(btex Entry symbol etex);
boxit.conflict_states(btex Conflict states list etex);

.5[state.e,state.w] - (0,3u) = .5[follow_set_map.e,e_symbol.w];
svectors_map.e + (2u,0) = follow_set_map.w;
follow_set_map.e + (2u,0) = e_symbol.w;
e_symbol.e + (2u,0) = conflict_states.w;
drawboxed(state);
drawboxed(svectors_map,follow_set_map,e_symbol,conflict_states);
draw state.sw -- svectors_map.ne;
draw .6[state.se,state.sw] -- .5[follow_set_map.ne,follow_set_map.nw];
draw .3[state.se,state.sw] -- .5[e_symbol.ne,e_symbol.nw];
draw state.se -- .5[conflict_states.ne,conflict_states.nw];
endfig;

beginfig(2);
% outline state's vectors-map 
label.rt(btex vectors$\_$map$[$ eno $]$: symbol's enumerate etex,(1u,11u));
label.rt(btex $\bullet\ $state's element list etex,(2u,10u));
label.rt(btex $\bullet\ $state$\_$element\ $\uparrow$ etex,(2u,9u));
	label.rt(btex $\bullet\ $grammar tree node $\uparrow$ etex,(3u,8u));
	label.rt(btex $\bullet\ $closure state $\uparrow$ etex,(3u,7u));
	label.rt(btex $\bullet\ $go$\_$to state $\uparrow$ etex,(3u,6u));
	label.rt(btex $\bullet\ $previous state $\uparrow$ etex,(3u,5u));
	label.rt(btex $\bullet\ $reduced state $\uparrow$  etex,(3u,4u));
	label.rt(btex $\bullet\ $previous state element etex,(3u,3u));
	label.rt(btex $\bullet\ $next state element etex,(3u,2u));
	label.rt(btex $\bullet\ $LA set $\uparrow$  etex,(3u,1u));
	label.rt(btex $\bullet\ $Common LA set index  etex,(3u,0u));


% outline follow set 
label.rt(btex follow$\_$set$\_$map$[$ eno $]$: rule's enumerate etex,(13u,10u));
label.rt(btex $\bullet\ $follow$\_$set$\_$element\ $\uparrow$ etex,(15u,9u));
	label.rt(btex $\bullet\ $rule no \ $\bullet\ $ rule def tree $\uparrow$ etex,(15u,8u));
	label.rt(btex $\bullet\ $state element $\uparrow$ \ $\bullet\ $ it's state $\uparrow$ etex,(15u,7u));
	label.rt(btex $\bullet\ $follow set of T$-$in$-$stbl $\uparrow$ etex,(15u,6u));
	label.rt(btex $\bullet\ $transitions: follow$\_$set$\_$element $\uparrow$ etex,(15u,5u));
	label.rt(btex $\bullet\ $merges: etex,(15u,4u));

%label.rt(btex follow$\_$set$\_$map$[$ eno $]$: rule's enumerate etex,(1u,-1u));
%label.rt(btex $\bullet\ $follow$\_$set$\_$element\ $\uparrow$ etex,(2u,-2u));
	%label.rt(btex $\bullet\ $rule no \ $\bullet\ $ rule def tree $\uparrow$ etex,(3u,-3u));
	%label.rt(btex $\bullet\ $state element $\uparrow$ \ $\bullet\ $ it's state $\uparrow$ etex,(3u,-4u));
	%label.rt(btex $\bullet\ $follow set of T$-$in$-$stbl $\uparrow$ etex,(3u,-5u));
	%label.rt(btex $\bullet\ $transitions: follow$\_$set$\_$element $\uparrow$ etex,(3u,-6u));
	%label.rt(btex $\bullet\ $merges: etex,(3u,-7u));

endfig;

end;