comparison src/lacweb.grm @ 232:a338da9d82f3

OFFSET
author Adam Chlipala <adamc@hcoop.net>
date Thu, 21 Aug 2008 16:03:45 -0400
parents eadeea528f75
children c466678af854
comparison
equal deleted inserted replaced
231:eadeea528f75 232:a338da9d82f3
162 | NOTAGS of string 162 | NOTAGS of string
163 | BEGIN_TAG of string | END_TAG of string 163 | BEGIN_TAG of string | END_TAG of string
164 164
165 | SELECT | FROM | AS | CWHERE | GROUP | ORDER | BY | HAVING 165 | SELECT | FROM | AS | CWHERE | GROUP | ORDER | BY | HAVING
166 | UNION | INTERSECT | EXCEPT 166 | UNION | INTERSECT | EXCEPT
167 | LIMIT | OFFSET 167 | LIMIT | OFFSET | ALL
168 | TRUE | FALSE | CAND | OR | NOT 168 | TRUE | FALSE | CAND | OR | NOT
169 | NE | LT | LE | GT | GE 169 | NE | LT | LE | GT | GE
170 170
171 %nonterm 171 %nonterm
172 file of decl list 172 file of decl list
245 | gopt of group_item list option 245 | gopt of group_item list option
246 | hopt of exp 246 | hopt of exp
247 | obopt of exp 247 | obopt of exp
248 | obexps of exp 248 | obexps of exp
249 | lopt of exp 249 | lopt of exp
250 | ofopt of exp
250 | sqlint of exp 251 | sqlint of exp
251 252
252 253
253 %verbose (* print summary of errors *) 254 %verbose (* print summary of errors *)
254 %pos int (* positions *) 255 %pos int (* positions *)
659 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) 660 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright))
660 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) 661 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright))
661 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) 662 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright))
662 | LBRACE eexp RBRACE (eexp) 663 | LBRACE eexp RBRACE (eexp)
663 664
664 query : query1 obopt lopt (let 665 query : query1 obopt lopt ofopt (let
665 val loc = s (query1left, query1right) 666 val loc = s (query1left, query1right)
666 667
667 val re = (ERecord [((CName "Rows", loc), 668 val re = (ERecord [((CName "Rows", loc),
668 query1), 669 query1),
669 ((CName "OrderBy", loc), 670 ((CName "OrderBy", loc),
670 obopt), 671 obopt),
671 ((CName "Limit", loc), 672 ((CName "Limit", loc),
672 lopt)], loc) 673 lopt),
674 ((CName "Offset", loc),
675 ofopt)], loc)
673 in 676 in
674 (EApp ((EVar (["Basis"], "sql_query"), loc), re), loc) 677 (EApp ((EVar (["Basis"], "sql_query"), loc), re), loc)
675 end) 678 end)
676 679
677 query1 : SELECT select FROM tables wopt gopt hopt 680 query1 : SELECT select FROM tables wopt gopt hopt
849 in 852 in
850 (EApp (e, obexps), loc) 853 (EApp (e, obexps), loc)
851 end) 854 end)
852 855
853 lopt : (EVar (["Basis"], "sql_no_limit"), dummy) 856 lopt : (EVar (["Basis"], "sql_no_limit"), dummy)
857 | LIMIT ALL (EVar (["Basis"], "sql_no_limit"), dummy)
854 | LIMIT sqlint (let 858 | LIMIT sqlint (let
855 val loc = s (LIMITleft, sqlintright) 859 val loc = s (LIMITleft, sqlintright)
856 in 860 in
857 (EApp ((EVar (["Basis"], "sql_limit"), loc), sqlint), loc) 861 (EApp ((EVar (["Basis"], "sql_limit"), loc), sqlint), loc)
858 end) 862 end)
859 863
864 ofopt : (EVar (["Basis"], "sql_no_offset"), dummy)
865 | OFFSET sqlint (let
866 val loc = s (OFFSETleft, sqlintright)
867 in
868 (EApp ((EVar (["Basis"], "sql_offset"), loc), sqlint), loc)
869 end)
870
860 sqlint : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) 871 sqlint : INT (EPrim (Prim.Int INT), s (INTleft, INTright))
861 | LBRACE eexp RBRACE (eexp) 872 | LBRACE eexp RBRACE (eexp)