annotate src/sql.sig @ 2203:39faa4a037f4

ML half of initial prototype. (Doesn't compile because there's no C yet.)
author Ziv Scully <ziv@mit.edu>
date Tue, 25 Mar 2014 02:04:06 -0400
parents
children 01c8aceac480
rev   line source
ziv@2203 1 signature SQL = sig
ziv@2203 2
ziv@2203 3 val fu : Mono.file -> unit
ziv@2203 4
ziv@2203 5 val debug : bool ref
ziv@2203 6
ziv@2203 7 type lvar
ziv@2203 8
ziv@2203 9 datatype func =
ziv@2203 10 DtCon0 of string
ziv@2203 11 | DtCon1 of string
ziv@2203 12 | UnCon of string
ziv@2203 13 | Other of string
ziv@2203 14
ziv@2203 15 datatype exp =
ziv@2203 16 Const of Prim.t
ziv@2203 17 | Var of int
ziv@2203 18 | Lvar of lvar
ziv@2203 19 | Func of func * exp list
ziv@2203 20 | Recd of (string * exp) list
ziv@2203 21 | Proj of exp * string
ziv@2203 22
ziv@2203 23 datatype reln =
ziv@2203 24 Known
ziv@2203 25 | Sql of string
ziv@2203 26 | PCon0 of string
ziv@2203 27 | PCon1 of string
ziv@2203 28 | Eq
ziv@2203 29 | Ne
ziv@2203 30 | Lt
ziv@2203 31 | Le
ziv@2203 32 | Gt
ziv@2203 33 | Ge
ziv@2203 34
ziv@2203 35 datatype prop =
ziv@2203 36 True
ziv@2203 37 | False
ziv@2203 38 | Unknown
ziv@2203 39 | And of prop * prop
ziv@2203 40 | Or of prop * prop
ziv@2203 41 | Reln of reln * exp list
ziv@2203 42 | Cond of exp * prop
ziv@2203 43
ziv@2203 44 datatype ('a, 'b) sum = inl of 'a | inr of 'b
ziv@2203 45
ziv@2203 46 datatype Rel =
ziv@2203 47 Exps of exp * exp -> prop
ziv@2203 48 | Props of prop * prop -> prop
ziv@2203 49
ziv@2203 50 datatype sqexp =
ziv@2203 51 SqConst of Prim.t
ziv@2203 52 | SqTrue
ziv@2203 53 | SqFalse
ziv@2203 54 | SqNot of sqexp
ziv@2203 55 | Field of string * string
ziv@2203 56 | Computed of string
ziv@2203 57 | Binop of Rel * sqexp * sqexp
ziv@2203 58 | SqKnown of sqexp
ziv@2203 59 | Inj of Mono.exp
ziv@2203 60 | SqFunc of string * sqexp
ziv@2203 61 | Unmodeled
ziv@2203 62 | Null
ziv@2203 63
ziv@2203 64 datatype sitem =
ziv@2203 65 SqField of string * string
ziv@2203 66 | SqExp of sqexp * string
ziv@2203 67
ziv@2203 68 type query1
ziv@2203 69
ziv@2203 70 datatype query =
ziv@2203 71 Query1 of query1
ziv@2203 72 | Union of query * query
ziv@2203 73
ziv@2203 74 datatype dml =
ziv@2203 75 Insert of string * (string * sqexp) list
ziv@2203 76 | Delete of string * sqexp
ziv@2203 77 | Update of string * (string * sqexp) list * sqexp
ziv@2203 78
ziv@2203 79 end