check.mli 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. (** This module is a meta-checker. It will take many checkers and aggregate
  2. their result together before providing an unified result.
  3. The modules required to be declared before being used, using the [build]
  4. method, and provided as an array :
  5. {[
  6. let _, e1 = build (module …)
  7. let _, e2 = build (module …)
  8. module Check = Make (struct
  9. let t = [| e1; e2 |]
  10. end)
  11. ]}
  12. *)
  13. module Id : sig
  14. type 'a t
  15. (** The type created on-the-fly. *)
  16. end
  17. type t
  18. (** Type of check to apply *)
  19. val build :
  20. (module S.Analyzer
  21. with type Expression.t = _
  22. and type Expression.t' = _
  23. and type Instruction.t = _
  24. and type Instruction.t' = _
  25. and type Location.t = 'a
  26. and type context = _) ->
  27. 'a Id.t * t
  28. (** Build a new check from a module following S.Analyzer signature.
  29. ypeid
  30. Return the result type which hold the final result value, and checker
  31. itself. *)
  32. val get_module : t -> (module S.Analyzer)
  33. type result
  34. val get : 'a Id.t -> result -> 'a option
  35. (** The method [get] can be used to get the internal value for one of the
  36. checker used.
  37. *)
  38. module Make (A : sig
  39. val t : t array
  40. end) : sig
  41. include S.Analyzer with type Location.t = result array
  42. end
  43. [@@warning "-67"]