comparison src/lacweb.grm @ 7:2ce5bf227d01

Add type keyword
author Adam Chlipala <adamc@hcoop.net>
date Sat, 26 Jan 2008 16:51:39 -0500
parents 38bf996e1c2e
children a455a9f85cc3
comparison
equal deleted inserted replaced
6:38bf996e1c2e 7:2ce5bf227d01
37 %term 37 %term
38 EOF 38 EOF
39 | SYMBOL of string | CSYMBOL of string 39 | SYMBOL of string | CSYMBOL of string
40 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE 40 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE
41 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH 41 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH
42 | CON | TYPE | NAME 42 | CON | LTYPE
43 | TYPE | NAME
43 | ARROW | LARROW | DARROW 44 | ARROW | LARROW | DARROW
44 | FN | PLUSPLUS | DOLLAR 45 | FN | PLUSPLUS | DOLLAR
45 46
46 %nonterm 47 %nonterm
47 file of decl list 48 file of decl list
83 decls : ([]) 84 decls : ([])
84 | decl decls (decl :: decls) 85 | decl decls (decl :: decls)
85 86
86 decl : CON SYMBOL EQ cexp (DCon (SYMBOL, NONE, cexp), s (CONleft, cexpright)) 87 decl : CON SYMBOL EQ cexp (DCon (SYMBOL, NONE, cexp), s (CONleft, cexpright))
87 | CON SYMBOL DCOLON kind EQ cexp (DCon (SYMBOL, SOME kind, cexp), s (CONleft, cexpright)) 88 | CON SYMBOL DCOLON kind EQ cexp (DCon (SYMBOL, SOME kind, cexp), s (CONleft, cexpright))
89 | LTYPE SYMBOL EQ cexp (DCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp),
90 s (LTYPEleft, cexpright))
88 91
89 kind : TYPE (KType, s (TYPEleft, TYPEright)) 92 kind : TYPE (KType, s (TYPEleft, TYPEright))
90 | NAME (KName, s (NAMEleft, NAMEright)) 93 | NAME (KName, s (NAMEleft, NAMEright))
91 | LBRACE kind RBRACE (KRecord kind, s (LBRACEleft, RBRACEright)) 94 | LBRACE kind RBRACE (KRecord kind, s (LBRACEleft, RBRACEright))
92 | kind ARROW kind (KArrow (kind1, kind2), s (kind1left, kind2right)) 95 | kind ARROW kind (KArrow (kind1, kind2), s (kind1left, kind2right))