/
gram_def.ml
55 lines (55 loc) · 1.05 KB
/
gram_def.ml
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
open Astf
type name = {
id: vid;
tvar: string;
loc: loc;}
type styp =
[ vid' | `App of (loc* styp* styp)
| `Quote of (loc* position_flag* alident) | `Self of loc
| `Type of ctyp ]
type entry = {
name: name;
pos: exp option;
local: bool;
level: level;}
and level = {
assoc: exp option;
rules: rule list;}
and action =
| E of exp option
| Ant of Tokenf.ant
and rule = {
env: (locid* exp) list;
prod: osymbol list;
action: action;}
and label = string option
and kind =
| KNone
| KSome
| KNormal
and locid = (loc* string)
and symbol = {
text: text;
styp: styp;
bounds: (locid* label) list;}
and 'a decorate = {
kind: kind;
txt: 'a;}
and osymbol =
{
text: text;
styp: styp;
bounds: (locid* label) list;
outer_pattern: locid option;}
and text =
| List of (loc* bool* osymbol* osymbol option)
| Nterm of (loc* name* int option)
| Try of (loc* text)
| Peek of (loc* text)
| Self of loc
| Keyword of (loc* string)
| Token of (loc* exp)
type entries = {
items: entry list;
gram: vid option;
safe: bool;}