]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/bin/roles/rolesParser.mly
990ca672ecaa352a35278cbbff726c890adec944
[helm.git] / matita / matita / contribs / lambdadelta / bin / roles / rolesParser.mly
1 /*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic
3     ||A||  Library of Mathematics, developed at the Computer Science
4     ||T||  Department, University of Bologna, Italy.
5     ||I||
6     ||T||  HELM is free software; you can redistribute it and/or
7     ||A||  modify it under the terms of the GNU General Public License
8     \   /  version 2 or (at your option) any later version.
9      \ /   This software is distributed as is, NO WARRANTY.
10       V_______________________________________________________________ */
11
12 %{
13   module EU = RolesUtils
14   module ET = RolesTypes
15 %}
16
17 %token EOF SC OP CP VER OLD NEW REL BASE TOP ROLES
18 %token <string> TEXT
19
20 %start status
21 %type <RolesTypes.status> status
22
23 %%
24
25 version:
26   | TEXT { EU.version_of_string $1 }
27 ;
28
29 obj:
30   | TEXT { false, EU.obj_of_string $1 }
31 ;
32
33 name:
34   | TEXT { false, EU.name_of_string $1 }
35 ;
36
37 role:
38   | OP REL ver olds news CP {
39       false, {ET.v = $3; ET.o = $4; ET.n = $5}
40     }
41 ;
42
43 objs:
44   |          { []       }
45   | obj objs { $1 :: $2 }
46 ;
47
48 names:
49   |            { []       }
50   | name names { $1 :: $2 }
51 ;
52
53 roles:
54   |            { []       }
55   | role roles { $1 :: $2 }
56 ;
57
58 ver:
59   | OP VER version CP { $3 }
60 ;
61
62 olds:
63   | OP OLD objs CP { $3 }
64 ;
65
66 news:
67   | OP NEW names CP { $3 }
68 ;
69
70 base:
71   | OP BASE roles CP { $3 }
72 ;
73
74 status:
75   | ROLES SC OP TOP base ver olds news CP EOF {
76       {ET.r = $5; ET.s = $6; ET.t = $7; ET.w = $8}
77     }
78 ;