Mercurial > urweb
annotate src/sql.sig @ 2212:388ba4dc7c96
Small cleanup.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Mon, 15 Sep 2014 20:01:16 -0400 |
parents | 01c8aceac480 |
children | 365727ff68f4 |
rev | line source |
---|---|
ziv@2203 | 1 signature SQL = sig |
ziv@2203 | 2 |
ziv@2203 | 3 val debug : bool ref |
ziv@2203 | 4 |
ziv@2204 | 5 type lvar = int |
ziv@2203 | 6 |
ziv@2203 | 7 datatype func = |
ziv@2203 | 8 DtCon0 of string |
ziv@2203 | 9 | DtCon1 of string |
ziv@2203 | 10 | UnCon of string |
ziv@2203 | 11 | Other of string |
ziv@2203 | 12 |
ziv@2203 | 13 datatype exp = |
ziv@2203 | 14 Const of Prim.t |
ziv@2203 | 15 | Var of int |
ziv@2203 | 16 | Lvar of lvar |
ziv@2203 | 17 | Func of func * exp list |
ziv@2203 | 18 | Recd of (string * exp) list |
ziv@2203 | 19 | Proj of exp * string |
ziv@2203 | 20 |
ziv@2203 | 21 datatype reln = |
ziv@2203 | 22 Known |
ziv@2203 | 23 | Sql of string |
ziv@2203 | 24 | PCon0 of string |
ziv@2203 | 25 | PCon1 of string |
ziv@2203 | 26 | Eq |
ziv@2203 | 27 | Ne |
ziv@2203 | 28 | Lt |
ziv@2203 | 29 | Le |
ziv@2203 | 30 | Gt |
ziv@2203 | 31 | Ge |
ziv@2203 | 32 |
ziv@2203 | 33 datatype prop = |
ziv@2203 | 34 True |
ziv@2203 | 35 | False |
ziv@2203 | 36 | Unknown |
ziv@2203 | 37 | And of prop * prop |
ziv@2203 | 38 | Or of prop * prop |
ziv@2203 | 39 | Reln of reln * exp list |
ziv@2203 | 40 | Cond of exp * prop |
ziv@2203 | 41 |
ziv@2212 | 42 type 'a parser |
ziv@2204 | 43 |
ziv@2204 | 44 val parse : 'a parser -> Mono.exp -> 'a option |
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@2204 | 64 datatype ('a,'b) sum = inl of 'a | inr of 'b |
ziv@2204 | 65 |
ziv@2203 | 66 datatype sitem = |
ziv@2203 | 67 SqField of string * string |
ziv@2203 | 68 | SqExp of sqexp * string |
ziv@2203 | 69 |
ziv@2204 | 70 type query1 = {Select : sitem list, |
ziv@2204 | 71 From : (string * string) list, |
ziv@2204 | 72 Where : sqexp option} |
ziv@2203 | 73 |
ziv@2203 | 74 datatype query = |
ziv@2203 | 75 Query1 of query1 |
ziv@2203 | 76 | Union of query * query |
ziv@2203 | 77 |
ziv@2204 | 78 val query : query parser |
ziv@2204 | 79 |
ziv@2203 | 80 datatype dml = |
ziv@2203 | 81 Insert of string * (string * sqexp) list |
ziv@2203 | 82 | Delete of string * sqexp |
ziv@2203 | 83 | Update of string * (string * sqexp) list * sqexp |
ziv@2203 | 84 |
ziv@2204 | 85 val dml : dml parser |
ziv@2204 | 86 |
ziv@2203 | 87 end |