]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/bin/roles/rolesParser.mly
update in basic_2 + new tool "roles"
[helm.git] / matita / matita / contribs / lambdadelta / bin / roles / rolesParser.mly
diff --git a/matita/matita/contribs/lambdadelta/bin/roles/rolesParser.mly b/matita/matita/contribs/lambdadelta/bin/roles/rolesParser.mly
new file mode 100644 (file)
index 0000000..1c92ba9
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+    ||M||  This file is part of HELM, an Hypertextual, Electronic
+    ||A||  Library of Mathematics, developed at the Computer Science
+    ||T||  Department, University of Bologna, Italy.
+    ||I||
+    ||T||  HELM is free software; you can redistribute it and/or
+    ||A||  modify it under the terms of the GNU General Public License
+    \   /  version 2 or (at your option) any later version.
+     \ /   This software is distributed as is, NO WARRANTY.
+      V_______________________________________________________________ */
+
+%{
+  module EU = RolesUtils
+  module ET = RolesTypes
+%}
+
+%token EOF SC OP CP VER OLD NEW REL BASE TOP ROLES
+%token <string> TEXT
+
+%start status
+%type <RolesTypes.status> status
+
+%%
+
+version:
+  | TEXT { EU.version_of_string $1 }
+;
+
+obj:
+  | TEXT { false, EU.obj_of_string $1 }
+;
+
+name:
+  | TEXT { false, EU.name_of_string $1 }
+;
+
+role:
+  | OP REL ver olds news CP {
+      false, {ET.v = $3; ET.o = $4; ET.n = $5} 
+    }
+;
+
+objs:
+  |          { []       }
+  | obj objs { $1 :: $2 }
+;
+
+names:
+  |            { []       }
+  | name names { $1 :: $2 }
+;
+
+roles:
+  |            { []       }
+  | role roles { $1 :: $2 }
+;
+
+ver:
+  | OP VER version CP { $3 }
+;
+
+olds:
+  | OP OLD objs CP { $3 }
+;
+
+news:
+  | OP NEW names CP { $3 }
+;
+
+base:
+  | OP BASE roles CP { $3 }
+;
+
+status:
+  | ROLES SC OP TOP base ver olds news CP EOF {
+      {ET.r = $5; ET.s = $6; ET.t = $7; ET.w = $8} 
+    }
+;