aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/analyzer.ml
blob: 22c1696cae234a4f9d2e70ed47989782da9a274f (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
module type T = sig
  type ex
  (** The type is not given, but we do not have much choice. Because of
      recursive definition, the type is left blank here, but constraint will be
      defined later, and this type shall be a [ex] *)

  val depends : ex list
  (** Dependencies are module required to be executed before. The result for
      them can be accessed with the ctx argument given in the functions *)

  val identifier : string
  (** Identifier for the module *)

  val description : string
  (** Short description*)

  val active : bool ref
  (** Is the test active or not *)

  val is_global : bool
  (** Declare the checker as global. It requires to run over the whole file and
      will be disabled if the application only check a single location.

      Also, the test will be disabled if a syntax error is reported during the
      parsing, because this tell that I haven’t been able to analyse the whole
      source code. *)

  type context
  (** Context used to keep information during the whole test *)

  val initialize : unit -> context
  (** Initialize the context before starting to parse the content *)

  module Expression : S.Expression
  module Instruction : S.Instruction with type expression := Expression.t'

  module Location :
    S.Location
      with type instruction := Instruction.t'
       and type context := context

  val finalize : context -> (string * Report.t) list
end