Mercurial > urweb
comparison src/urweb.grm @ 1572:5530a8075b62
IF THEN ELSE conditional for SQL.
author | Karn Kallio <kkallio@eka> |
---|---|
date | Fri, 14 Oct 2011 02:33:03 -0430 |
parents | a0caa991cdad |
children | 644558d9c756 |
comparison
equal
deleted
inserted
replaced
1571:f403e129c276 | 1572:5530a8075b62 |
---|---|
247 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS | 247 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS |
248 | CURRENT_TIMESTAMP | 248 | CURRENT_TIMESTAMP |
249 | NE | LT | LE | GT | GE | 249 | NE | LT | LE | GT | GE |
250 | CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES | 250 | CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES |
251 | JOIN | INNER | CROSS | OUTER | LEFT | RIGHT | FULL | 251 | JOIN | INNER | CROSS | OUTER | LEFT | RIGHT | FULL |
252 | CIF | CTHEN | CELSE | |
252 | 253 |
253 %nonterm | 254 %nonterm |
254 file of decl list | 255 file of decl list |
255 | decls of decl list | 256 | decls of decl list |
256 | decl of decl list | 257 | decl of decl list |
1826 in | 1827 in |
1827 (EApp ((EVar (["Basis"], "sql_is_null", Infer), loc), | 1828 (EApp ((EVar (["Basis"], "sql_is_null", Infer), loc), |
1828 sqlexp), loc) | 1829 sqlexp), loc) |
1829 end) | 1830 end) |
1830 | 1831 |
1832 | CIF sqlexp CTHEN sqlexp CELSE sqlexp (let | |
1833 val loc = s (CIFleft, sqlexp3right) | |
1834 val e = (EVar (["Basis"], "sql_if_then_else", Infer), loc) | |
1835 in | |
1836 (EApp ((EApp ((EApp (e, sqlexp1), loc), sqlexp2), loc), sqlexp3), loc) | |
1837 end) | |
1838 | |
1831 | LBRACE LBRACK eexp RBRACK RBRACE (sql_inject (#1 eexp, | 1839 | LBRACE LBRACK eexp RBRACK RBRACE (sql_inject (#1 eexp, |
1832 s (LBRACEleft, RBRACEright))) | 1840 s (LBRACEleft, RBRACEright))) |
1833 | LPAREN sqlexp RPAREN (sqlexp) | 1841 | LPAREN sqlexp RPAREN (sqlexp) |
1834 | 1842 |
1835 | NULL (sql_inject ((EVar (["Basis"], "None", Infer), | 1843 | NULL (sql_inject ((EVar (["Basis"], "None", Infer), |