comparison src/lacweb.grm @ 12:d89477f07c1e

Fun with records
author Adam Chlipala <adamc@hcoop.net>
date Fri, 28 Mar 2008 17:34:57 -0400
parents a455a9f85cc3
children f1c36df29ed7
comparison
equal deleted inserted replaced
11:e97c6d335869 12:d89477f07c1e
60 | rcone of (con * con) list 60 | rcone of (con * con) list
61 61
62 | eexp of exp 62 | eexp of exp
63 | eapps of exp 63 | eapps of exp
64 | eterm of exp 64 | eterm of exp
65 | rexp of (con * exp) list
65 66
66 %verbose (* print summary of errors *) 67 %verbose (* print summary of errors *)
67 %pos int (* positions *) 68 %pos int (* positions *)
68 %start file 69 %start file
69 %pure 70 %pure
145 | FN SYMBOL kcolon kind DARROW eexp (ECAbs (kcolon, SYMBOL, kind, eexp), s (FNleft, eexpright)) 146 | FN SYMBOL kcolon kind DARROW eexp (ECAbs (kcolon, SYMBOL, kind, eexp), s (FNleft, eexpright))
146 | FN SYMBOL COLON cexp DARROW eexp (EAbs (SYMBOL, SOME cexp, eexp), s (FNleft, eexpright)) 147 | FN SYMBOL COLON cexp DARROW eexp (EAbs (SYMBOL, SOME cexp, eexp), s (FNleft, eexpright))
147 | FN SYMBOL DARROW eexp (EAbs (SYMBOL, NONE, eexp), s (FNleft, eexpright)) 148 | FN SYMBOL DARROW eexp (EAbs (SYMBOL, NONE, eexp), s (FNleft, eexpright))
148 149
149 | LPAREN eexp RPAREN DCOLON cexp (EAnnot (eexp, cexp), s (LPARENleft, cexpright)) 150 | LPAREN eexp RPAREN DCOLON cexp (EAnnot (eexp, cexp), s (LPARENleft, cexpright))
151 | eterm DOT ident (EField (eterm, ident), s (etermleft, identright))
150 152
151 eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright)) 153 eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright))
152 154
153 | SYMBOL (EVar SYMBOL, s (SYMBOLleft, SYMBOLright)) 155 | SYMBOL (EVar SYMBOL, s (SYMBOLleft, SYMBOLright))
156 | LBRACE rexp RBRACE (ERecord rexp, s (LBRACEleft, RBRACEright))
157
158 rexp : ([])
159 | ident EQ eexp ([(ident, eexp)])
160 | ident EQ eexp COMMA rexp ((ident, eexp) :: rexp)