use menhir features, extend grammar
[sqlgg.git] / syntax.ml
blob015ee88bf9d90f0da5d0886007698663e6e5b652
1 (* SQL syntax and RA *)
3 open Stmt.Raw
4 open Operators
6 let resolve columns tables =
7 let all = tables >> List.map snd >> List.flatten in
8 let scheme name = name >> Tables.get_from tables >> snd in
9 let resolve1 = function
10 | All -> all
11 | AllOf t -> scheme t
12 | OneOf (col,t) -> [ RA.Scheme.find (scheme t) col ]
13 | One col -> [ RA.Scheme.find all col ]
15 columns >> List.map resolve1 >> List.flatten