-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathferrolexAst.ml
59 lines (47 loc) · 1.06 KB
/
ferrolexAst.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
56
57
58
59
type ichar = char * int;;
type regexpOld =
| EpsilonOld
| CharacterOld of ichar
| UnionOld of regexpOld * regexpOld
| ConcatOld of regexpOld * regexpOld
| StarOld of regexpOld;;
type charSet =
| Single of int
| Segment of int * int
| Rule
| Except of charSet * charSet
| Any
| SetUnion of charSet * charSet
;;
type icharSet = charSet * int
type regexp =
| Epsilon
| Character of icharSet
| Union of regexp * regexp
| Concat of regexp * regexp
| Star of regexp
;;
module CsetOld = Set.Make(struct type t = ichar let compare = compare end);;
module Cset = Set.Make(struct type t = icharSet let compare = compare end);;
type state =
Cset.t
;;
module Cmap = Map.Make(Int);;
module Smap = Map.Make(Cset);;
module Imap = Map.Make(Int);;
module Iset = Set.Make(Int);;
type autom = {
start : Cset.t;
trans : state Cmap.t Smap.t;
term : int option Smap.t
};;
type autom2 = {
start2 : int;
trans2 : int Cmap.t Imap.t;
term2 : int option Imap.t
}
type file = {
header : string;
reg_list : (string * regexp * string) list;
bottom : string;
}