summaryrefslogtreecommitdiff
path: root/web/yacco2/diagrams/TS_la1.mp
blob: 0b03dfa6fb4d4763e73996967c81ee2d0f136122 (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
60
% file: TS_la1.mp - grammar railroad diagrams for mpost program

% date: Wed Nov 08 16:30:09 2006 
input "/yacco2/library/o2diag.mp"
numeric no_of_rules,Box_solid,Box_dotted,Circle_solid,Circle_dotted;
Box_solid:=1;Box_dotted:=2;Circle_solid:=3;Circle_dotted:=4;
string rule_names[].literal;
string rule_names[].vname;
numeric rule_s_no_rhs[];
string rhs_elems[][][].literal;
string rhs_elems[][][].vname;
numeric rhs_elems[][][].Drw_how;
numeric rule_s_subrule_no_elems[][];
no_of_rules := 2;
rule_names[1].literal := "Reol";rule_names[1].vname := "Reol";
rule_s_no_rhs[1] := 1;
rule_s_subrule_no_elems[1][1]:= 1;
rhs_elems[1][1][1].literal := "Rdelimiters";
rhs_elems[1][1][1].Drw_how := Box_solid;
rhs_elems[1][1][1].vname := "aaaaaa";
rule_names[2].literal := "Rdelimiters";rule_names[2].vname := "Rdelimiters";
rule_s_no_rhs[2] := 3;
rule_s_subrule_no_elems[2][1]:= 1;
rhs_elems[2][1][1].literal := "x0a";
rhs_elems[2][1][1].Drw_how := Circle_solid;
rhs_elems[2][1][1].vname := "abaaaa";
rule_s_subrule_no_elems[2][2]:= 2;
rhs_elems[2][2][1].literal := "x0d";
rhs_elems[2][2][1].Drw_how := Circle_solid;
rhs_elems[2][2][1].vname := "ababaa";
rhs_elems[2][2][2].literal := "|.|";
rhs_elems[2][2][2].Drw_how := Circle_solid;
rhs_elems[2][2][2].vname := "ababab";
rule_s_subrule_no_elems[2][3]:= 2;
rhs_elems[2][3][1].literal := "x0d";
rhs_elems[2][3][1].Drw_how := Circle_solid;
rhs_elems[2][3][1].vname := "abacaa";
rhs_elems[2][3][2].literal := "x0a";
rhs_elems[2][3][2].Drw_how := Circle_solid;
rhs_elems[2][3][2].vname := "abacab";
init_variables;
beginfig(1);
  drw_rule(1);
endfig;
beginfig(2);
  drw_rule_a_rhs(1,1);
endfig;
beginfig(3);
  drw_rule(2);
endfig;
beginfig(4);
  drw_rule_a_rhs(2,1);
endfig;
beginfig(5);
  drw_rule_a_rhs(2,2);
endfig;
beginfig(6);
  drw_rule_a_rhs(2,3);
endfig;
end;