aboutsummaryrefslogtreecommitdiff
path: root/lib/checks/default.ml
blob: a2b53f6f5914e23b9897cf08db3c56fed025914c (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
(** Default implementation which does nothing. 

This module is expected to be used when you only need to implement an analyze
over a limited part of the whole syntax. *)

module S = Qsp_syntax.S
module T = Qsp_syntax.T
module Report = Qsp_syntax.Report

module type T = sig
  type t

  val default : t
end

module Expression (T' : T) = struct
  (** 
      Describe a variable, using the name in capitalized text, and an optionnal
      index.

      If missing, the index should be considered as [0].
   *)

  type t' = T'.t

  let ident : (S.pos, T'.t) S.variable -> T'.t = fun _ -> T'.default

  (*
        Basic values, text, number…
   *)

  let integer : S.pos -> string -> T'.t = fun _ _ -> T'.default
  let literal : S.pos -> T'.t T.literal list -> T'.t = fun _ _ -> T'.default

  (** Call a function. The functions list is hardcoded in lib/lexer.mll *)
  let function_ : S.pos -> T.function_ -> T'.t list -> T'.t =
   fun _ _ _ -> T'.default

  (** Unary operator like [-123] or [+'Text']*)
  let uoperator : S.pos -> T.uoperator -> T'.t -> T'.t = fun _ _ _ -> T'.default

  (** Binary operator, for a comparaison, or an operation *)
  let boperator : S.pos -> T.boperator -> T'.t -> T'.t -> T'.t =
   fun _ _ _ _ -> T'.default
end