Mercurial > urweb
comparison src/lacweb.grm @ 231:eadeea528f75
LIMIT
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 21 Aug 2008 16:00:01 -0400 |
parents | 87d41ac28b30 |
children | a338da9d82f3 |
comparison
equal
deleted
inserted
replaced
230:87d41ac28b30 | 231:eadeea528f75 |
---|---|
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 | TRUE | FALSE | CAND | OR | NOT | 168 | TRUE | FALSE | CAND | OR | NOT |
168 | NE | LT | LE | GT | GE | 169 | NE | LT | LE | GT | GE |
169 | 170 |
170 %nonterm | 171 %nonterm |
171 file of decl list | 172 file of decl list |
243 | groupis of group_item list | 244 | groupis of group_item list |
244 | gopt of group_item list option | 245 | gopt of group_item list option |
245 | hopt of exp | 246 | hopt of exp |
246 | obopt of exp | 247 | obopt of exp |
247 | obexps of exp | 248 | obexps of exp |
249 | lopt of exp | |
250 | sqlint of exp | |
248 | 251 |
249 | 252 |
250 %verbose (* print summary of errors *) | 253 %verbose (* print summary of errors *) |
251 %pos int (* positions *) | 254 %pos int (* positions *) |
252 %start file | 255 %start file |
656 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) | 659 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) |
657 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) | 660 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) |
658 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) | 661 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) |
659 | LBRACE eexp RBRACE (eexp) | 662 | LBRACE eexp RBRACE (eexp) |
660 | 663 |
661 query : query1 obopt (let | 664 query : query1 obopt lopt (let |
662 val loc = s (query1left, query1right) | 665 val loc = s (query1left, query1right) |
663 | 666 |
664 val re = (ERecord [((CName "Rows", loc), | 667 val re = (ERecord [((CName "Rows", loc), |
665 query1), | 668 query1), |
666 ((CName "OrderBy", loc), | 669 ((CName "OrderBy", loc), |
667 obopt)], loc) | 670 obopt), |
671 ((CName "Limit", loc), | |
672 lopt)], loc) | |
668 in | 673 in |
669 (EApp ((EVar (["Basis"], "sql_query"), loc), re), loc) | 674 (EApp ((EVar (["Basis"], "sql_query"), loc), re), loc) |
670 end) | 675 end) |
671 | 676 |
672 query1 : SELECT select FROM tables wopt gopt hopt | 677 query1 : SELECT select FROM tables wopt gopt hopt |
842 val e = (EApp ((EVar (["Basis"], "sql_order_by_Cons"), loc), | 847 val e = (EApp ((EVar (["Basis"], "sql_order_by_Cons"), loc), |
843 sqlexp), loc) | 848 sqlexp), loc) |
844 in | 849 in |
845 (EApp (e, obexps), loc) | 850 (EApp (e, obexps), loc) |
846 end) | 851 end) |
852 | |
853 lopt : (EVar (["Basis"], "sql_no_limit"), dummy) | |
854 | LIMIT sqlint (let | |
855 val loc = s (LIMITleft, sqlintright) | |
856 in | |
857 (EApp ((EVar (["Basis"], "sql_limit"), loc), sqlint), loc) | |
858 end) | |
859 | |
860 sqlint : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) | |
861 | LBRACE eexp RBRACE (eexp) |