aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/check.mli
blob: 759a07a825ff62749c5cdbff852cc6004134a091 (plain)
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
(** This module is a meta-checker. It will take many checkers and aggregate
    their result together before providing an unified result. 

    The modules required to be declared before being used, using the [build]
    method, and provided as an array :

    {[ 
    let _, e1 = build (module …)
    let _, e2 = build (module …)
    
    module Check = Make (struct
      let t = [| e1; e2 |]
    end)
    ]}
*)

module Id : sig
  type 'a typeid
  (** The type created on-the-fly. *)
end

type t
(** Type of check to apply *)

val build :
  (module S.Analyzer
     with type Expression.t = _
      and type Expression.t' = _
      and type Instruction.t = _
      and type Instruction.t' = _
      and type Location.t = 'a) ->
  'a Id.typeid * t
(** Build a new check from a module following S.Analyzer signature. 

    Return the result type which hold the final result value, and checker
    itself. *)

type result

val get : 'a Id.typeid -> result -> 'a option
(** The method [get] can be used to get the internal value for one of the
    checker used.
 *)

module Make (A : sig
  val t : t array
end) : sig
  include S.Analyzer with type Location.t = result array
end
[@@warning "-67"]