comparison src/lacweb.grm @ 243:2b9dfaffb008

Transactions and queries, at source level
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 Aug 2008 14:48:33 -0400
parents cc193f680193
children
comparison
equal deleted inserted replaced
242:cc193f680193 243:2b9dfaffb008
152 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR 152 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR
153 | DIVIDE | DOTDOTDOT 153 | DIVIDE | DOTDOTDOT
154 | CON | LTYPE | VAL | REC | AND | FUN | FOLD | UNIT | KUNIT | CLASS 154 | CON | LTYPE | VAL | REC | AND | FUN | FOLD | UNIT | KUNIT | CLASS
155 | DATATYPE | OF 155 | DATATYPE | OF
156 | TYPE | NAME 156 | TYPE | NAME
157 | ARROW | LARROW | DARROW | STAR 157 | ARROW | LARROW | DARROW | STAR | SEMI
158 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE 158 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE
159 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN 159 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN
160 | INCLUDE | OPEN | CONSTRAINT | CONSTRAINTS | EXPORT | TABLE 160 | INCLUDE | OPEN | CONSTRAINT | CONSTRAINTS | EXPORT | TABLE
161 | CASE | IF | THEN | ELSE 161 | CASE | IF | THEN | ELSE
162 162
275 %eop EOF 275 %eop EOF
276 %noshift EOF 276 %noshift EOF
277 277
278 %name Lacweb 278 %name Lacweb
279 279
280 %right SEMI
281 %nonassoc LARROW
280 %nonassoc IF THEN ELSE 282 %nonassoc IF THEN ELSE
281 %nonassoc DARROW 283 %nonassoc DARROW
282 %nonassoc COLON 284 %nonassoc COLON
283 %nonassoc DCOLON TCOLON 285 %nonassoc DCOLON TCOLON
284 %left UNION INTERSECT EXCEPT 286 %left UNION INTERSECT EXCEPT
285 %right COMMA 287 %right COMMA
286 %right OR 288 %right OR
287 %right CAND 289 %right CAND
288 %nonassoc EQ NE LT LE GT GE 290 %nonassoc EQ NE LT LE GT GE
289 %right ARROW LARROW 291 %right ARROW
290 %right PLUSPLUS MINUSMINUS 292 %right PLUSPLUS MINUSMINUS
291 %right STAR 293 %right STAR
292 %left NOT 294 %left NOT
293 %nonassoc TWIDDLE 295 %nonassoc TWIDDLE
294 %nonassoc DOLLAR 296 %nonassoc DOLLAR
583 | IF eexp THEN eexp ELSE eexp (let 585 | IF eexp THEN eexp ELSE eexp (let
584 val loc = s (IFleft, eexp3right) 586 val loc = s (IFleft, eexp3right)
585 in 587 in
586 (ECase (eexp1, [((PCon (["Basis"], "True", NONE), loc), eexp2), 588 (ECase (eexp1, [((PCon (["Basis"], "True", NONE), loc), eexp2),
587 ((PCon (["Basis"], "False", NONE), loc), eexp3)]), loc) 589 ((PCon (["Basis"], "False", NONE), loc), eexp3)]), loc)
590 end)
591 | SYMBOL LARROW eexp SEMI eexp (let
592 val loc = s (SYMBOLleft, eexp2right)
593 val e = (EVar (["Basis"], "bind"), loc)
594 val e = (EApp (e, eexp1), loc)
595 in
596 (EApp (e, (EAbs (SYMBOL, NONE, eexp2), loc)), loc)
588 end) 597 end)
589 598
590 eargs : earg (earg) 599 eargs : earg (earg)
591 | eargl (eargl) 600 | eargl (eargl)
592 601
723 | LPAREN ptuple RPAREN (PRecord (ListUtil.mapi (fn (i, p) => (Int.toString (i + 1), p)) ptuple, 732 | LPAREN ptuple RPAREN (PRecord (ListUtil.mapi (fn (i, p) => (Int.toString (i + 1), p)) ptuple,
724 false), 733 false),
725 s (LPARENleft, RPARENright)) 734 s (LPARENleft, RPARENright))
726 735
727 rpat : CSYMBOL EQ pat ([(CSYMBOL, pat)], false) 736 rpat : CSYMBOL EQ pat ([(CSYMBOL, pat)], false)
737 | INT EQ pat ([(Int64.toString INT, pat)], false)
728 | DOTDOTDOT ([], true) 738 | DOTDOTDOT ([], true)
729 | CSYMBOL EQ pat COMMA rpat ((CSYMBOL, pat) :: #1 rpat, #2 rpat) 739 | CSYMBOL EQ pat COMMA rpat ((CSYMBOL, pat) :: #1 rpat, #2 rpat)
740 | INT EQ pat COMMA rpat ((Int64.toString INT, pat) :: #1 rpat, #2 rpat)
730 741
731 ptuple : pat COMMA pat ([pat1, pat2]) 742 ptuple : pat COMMA pat ([pat1, pat2])
732 | pat COMMA ptuple (pat :: ptuple) 743 | pat COMMA ptuple (pat :: ptuple)
733 744
734 rexp : ([]) 745 rexp : ([])
890 | table COMMA tables (table :: tables) 901 | table COMMA tables (table :: tables)
891 902
892 tname : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) 903 tname : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
893 | LBRACE cexp RBRACE (cexp) 904 | LBRACE cexp RBRACE (cexp)
894 905
895 table : SYMBOL ((CName SYMBOL, s (SYMBOLleft, SYMBOLright)), 906 table : SYMBOL ((CName (capitalize SYMBOL), s (SYMBOLleft, SYMBOLright)),
896 (EVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright))) 907 (EVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright)))
897 | SYMBOL AS tname (tname, (EVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright))) 908 | SYMBOL AS tname (tname, (EVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright)))
898 | LBRACE LBRACE eexp RBRACE RBRACE AS tname (tname, eexp) 909 | LBRACE LBRACE eexp RBRACE RBRACE AS tname (tname, eexp)
899 910
900 tident : SYMBOL (CName SYMBOL, s (SYMBOLleft, SYMBOLright)) 911 tident : SYMBOL (CName (capitalize SYMBOL), s (SYMBOLleft, SYMBOLright))
901 | CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) 912 | CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
902 | LBRACE LBRACE cexp RBRACE RBRACE (cexp) 913 | LBRACE LBRACE cexp RBRACE RBRACE (cexp)
903 914
904 fident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) 915 fident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
905 | LBRACE cexp RBRACE (cexp) 916 | LBRACE cexp RBRACE (cexp)