Source file interfaces.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module type PARSER =
sig
type token
type state
type final
type expect
type semantic
type t
val needs_more: t -> bool
val has_ended: t -> bool
val put: token -> t -> t
val put_end: t -> t
val has_succeeded: t -> bool
val has_failed_syntax: t -> bool
val has_failed_semantic: t -> bool
val final: t -> final
val failed_expectations: t -> expect list
val failed_semantic: t -> semantic
val state: t -> state
val has_lookahead: t -> bool
val lookaheads: t -> token array * bool
end
module type COMBINATOR =
sig
type state
type expect
type semantic
type _ t
val (>>=): 'a t -> ('a -> 'b t) -> 'b t
val (let* ): 'a t -> ('a -> 'b t) -> 'b t
val map: ('a -> 'b) -> 'a t -> 'b t
val succeed: 'a -> 'a t
val return: 'a -> 'a t
val unexpected: expect -> 'a t
val clear_last_expectation: 'a -> 'a t
val fail: semantic -> 'a t
val (</>): 'a t -> 'a t -> 'a t
val choices: 'a t -> 'a t list -> 'a t
val (<?>): 'a t -> expect -> 'a t
val get: state t
val update: (state -> state) -> unit t
val get_and_update: (state -> state) -> state t
val optional: 'a t -> 'a option t
val zero_or_more: 'r -> ('item -> 'r -> 'r) -> 'item t -> 'r t
val one_or_more:
('item -> 'r)
-> ('item -> 'r -> 'r)
-> 'item t
-> 'r t
val list_zero_or_more: 'a t -> 'a list t
val list_one_or_more: 'a t -> ('a * 'a list) t
val skip_zero_or_more: 'a t -> int t
val skip_one_or_more: 'a t -> int t
val one_or_more_separated:
('item -> 'r)
-> ('r -> 'sep -> 'item -> 'r)
-> 'item t
-> 'sep t
-> 'r t
val backtrack: 'a t -> expect -> 'a t
val followed_by: 'a t -> expect -> 'a t
val not_followed_by: 'a t -> expect -> unit t
end