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
|
module T = ImportExpression.T
let empty : 'a T.t = T.Empty
let path : 'a -> 'a T.t = fun v -> T.Path v
let literal_test : 'a T.t = T.Literal "test"
let literal_quoted : 'a T.t = T.Literal "'"
let literal_zero : 'a T.t = T.Literal "0"
let integer_zero : 'a T.t = T.Integer "0"
let integer_neg_one : 'a T.t = T.Integer "-1"
let integer_one : 'a T.t = T.Integer "1"
let concat : 'a T.t = T.Concat [ T.Empty; T.Literal "test" ]
let expr : 'a T.t = T.Function ("expr", [ literal_test; T.Literal "NOT NULL" ])
let equal : 'a T.t -> 'a T.t -> 'a T.t =
fun e1 e2 -> T.BOperator (T.Equal, e1, e2)
let different : 'a T.t -> 'a T.t -> 'a T.t =
fun e1 e2 -> T.BOperator (T.Different, e1, e2)
let divide : 'a T.t -> 'a T.t -> 'a T.t =
fun e1 e2 -> T.BOperator (T.Division, e1, e2)
let nvl : 'a T.t -> 'a T.t -> 'a T.t = fun e1 e2 -> T.Nvl [ e1; e2 ]
let if_ : 'a T.t -> 'a T.t -> 'a T.t -> 'a T.t =
fun pred e1 e2 -> T.Function ("if", [ pred; e1; e2 ])
let in_ : 'a T.t -> 'a T.t list -> 'a T.t =
fun e1 group -> T.GEquality (T.Equal, e1, group)
let not_in : 'a T.t -> 'a T.t list -> 'a T.t =
fun e1 group -> T.GEquality (T.Different, e1, group)
let max : 'a T.t -> 'a T.t list -> 'a T.t list -> 'a T.t =
fun e group order -> T.Window (T.Max e, group, order)
let counter : 'a T.t list -> 'a T.t list -> 'a T.t =
fun group order -> T.Window (T.Counter, group, order)
let function' : T.funct -> 'a T.t list -> 'a T.t =
fun name param -> T.Function' (name, param)
module Make (Sym : ImportExpression.Sym.SYM_EXPR) = struct
module M = ImportExpression.Sym.M (Sym)
let eval : 'a T.t -> path_repr:'b Sym.path_repr -> 'a Sym.repr =
fun v ~path_repr -> M.eval ~path_repr v
end
|