Mercurial > urweb
comparison src/urweb.grm @ 751:f95d652086cd
RIGHT and FULL JOIN
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 28 Apr 2009 11:14:24 -0400 |
parents | 059074c8d2fc |
children | 8688e01ae469 |
comparison
equal
deleted
inserted
replaced
750:059074c8d2fc | 751:f95d652086cd |
---|---|
211 | ASC | DESC | 211 | ASC | DESC |
212 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS | 212 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS |
213 | CURRENT_TIMESTAMP | 213 | CURRENT_TIMESTAMP |
214 | NE | LT | LE | GT | GE | 214 | NE | LT | LE | GT | GE |
215 | CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES | 215 | CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES |
216 | JOIN | INNER | CROSS | LEFT | 216 | JOIN | INNER | CROSS | OUTER | LEFT | RIGHT | FULL |
217 | 217 |
218 %nonterm | 218 %nonterm |
219 file of decl list | 219 file of decl list |
220 | decls of decl list | 220 | decls of decl list |
221 | decl of decl list | 221 | decl of decl list |
359 %nonassoc DARROW | 359 %nonassoc DARROW |
360 %nonassoc COLON | 360 %nonassoc COLON |
361 %nonassoc DCOLON TCOLON | 361 %nonassoc DCOLON TCOLON |
362 %left UNION INTERSECT EXCEPT | 362 %left UNION INTERSECT EXCEPT |
363 %right COMMA | 363 %right COMMA |
364 %right JOIN INNER CROSS LEFT | 364 %right JOIN INNER CROSS OUTER LEFT RIGHT FULL |
365 %right OR | 365 %right OR |
366 %right CAND | 366 %right CAND |
367 %nonassoc EQ NE LT LE GT GE IS | 367 %nonassoc EQ NE LT LE GT GE IS |
368 %right ARROW | 368 %right ARROW |
369 %right CARET PLUSPLUS MINUSMINUS MINUSMINUSMINUS | 369 %right CARET PLUSPLUS MINUSMINUS MINUSMINUSMINUS |
1476 val e = (EApp (e, #2 fitem2), loc) | 1476 val e = (EApp (e, #2 fitem2), loc) |
1477 in | 1477 in |
1478 (#1 fitem1 @ #1 fitem2, | 1478 (#1 fitem1 @ #1 fitem2, |
1479 (EApp (e, sqlexp), loc)) | 1479 (EApp (e, sqlexp), loc)) |
1480 end) | 1480 end) |
1481 | fitem LEFT OUTER JOIN fitem ON sqlexp (let | |
1482 val loc = s (fitem1left, sqlexpright) | |
1483 | |
1484 val e = (EVar (["Basis"], "sql_left_join", Infer), loc) | |
1485 val e = (EApp (e, #2 fitem1), loc) | |
1486 val e = (EApp (e, #2 fitem2), loc) | |
1487 in | |
1488 (#1 fitem1 @ #1 fitem2, | |
1489 (EApp (e, sqlexp), loc)) | |
1490 end) | |
1491 | fitem RIGHT JOIN fitem ON sqlexp (let | |
1492 val loc = s (fitem1left, sqlexpright) | |
1493 | |
1494 val e = (EVar (["Basis"], "sql_right_join", Infer), loc) | |
1495 val e = (EApp (e, #2 fitem1), loc) | |
1496 val e = (EApp (e, #2 fitem2), loc) | |
1497 in | |
1498 (#1 fitem1 @ #1 fitem2, | |
1499 (EApp (e, sqlexp), loc)) | |
1500 end) | |
1501 | fitem RIGHT OUTER JOIN fitem ON sqlexp (let | |
1502 val loc = s (fitem1left, sqlexpright) | |
1503 | |
1504 val e = (EVar (["Basis"], "sql_right_join", Infer), loc) | |
1505 val e = (EApp (e, #2 fitem1), loc) | |
1506 val e = (EApp (e, #2 fitem2), loc) | |
1507 in | |
1508 (#1 fitem1 @ #1 fitem2, | |
1509 (EApp (e, sqlexp), loc)) | |
1510 end) | |
1511 | fitem FULL JOIN fitem ON sqlexp (let | |
1512 val loc = s (fitem1left, sqlexpright) | |
1513 | |
1514 val e = (EVar (["Basis"], "sql_full_join", Infer), loc) | |
1515 val e = (EApp (e, #2 fitem1), loc) | |
1516 val e = (EApp (e, #2 fitem2), loc) | |
1517 in | |
1518 (#1 fitem1 @ #1 fitem2, | |
1519 (EApp (e, sqlexp), loc)) | |
1520 end) | |
1521 | fitem FULL OUTER JOIN fitem ON sqlexp (let | |
1522 val loc = s (fitem1left, sqlexpright) | |
1523 | |
1524 val e = (EVar (["Basis"], "sql_full_join", Infer), loc) | |
1525 val e = (EApp (e, #2 fitem1), loc) | |
1526 val e = (EApp (e, #2 fitem2), loc) | |
1527 in | |
1528 (#1 fitem1 @ #1 fitem2, | |
1529 (EApp (e, sqlexp), loc)) | |
1530 end) | |
1481 | 1531 |
1482 tname : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) | 1532 tname : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) |
1483 | LBRACE cexp RBRACE (cexp) | 1533 | LBRACE cexp RBRACE (cexp) |
1484 | 1534 |
1485 table : SYMBOL ((CName (capitalize SYMBOL), s (SYMBOLleft, SYMBOLright)), | 1535 table : SYMBOL ((CName (capitalize SYMBOL), s (SYMBOLleft, SYMBOLright)), |