Mercurial > urweb
comparison src/lacweb.grm @ 18:9a578171de9e
Unification wildcards
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 08 Jun 2008 14:25:27 -0400 |
parents | 1e645beb3f3b |
children | e6ccf961d8a3 |
comparison
equal
deleted
inserted
replaced
17:9bd8669d53c2 | 18:9a578171de9e |
---|---|
37 %term | 37 %term |
38 EOF | 38 EOF |
39 | STRING of string | INT of Int64.int | FLOAT of Real64.real | 39 | STRING of string | INT of Int64.int | FLOAT of Real64.real |
40 | SYMBOL of string | CSYMBOL of string | 40 | SYMBOL of string | CSYMBOL of string |
41 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE | 41 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE |
42 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | 42 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER |
43 | CON | LTYPE | VAL | 43 | CON | LTYPE | VAL |
44 | TYPE | NAME | 44 | TYPE | NAME |
45 | ARROW | LARROW | DARROW | 45 | ARROW | LARROW | DARROW |
46 | FN | PLUSPLUS | DOLLAR | 46 | FN | PLUSPLUS | DOLLAR |
47 | 47 |
100 kind : TYPE (KType, s (TYPEleft, TYPEright)) | 100 kind : TYPE (KType, s (TYPEleft, TYPEright)) |
101 | NAME (KName, s (NAMEleft, NAMEright)) | 101 | NAME (KName, s (NAMEleft, NAMEright)) |
102 | LBRACE kind RBRACE (KRecord kind, s (LBRACEleft, RBRACEright)) | 102 | LBRACE kind RBRACE (KRecord kind, s (LBRACEleft, RBRACEright)) |
103 | kind ARROW kind (KArrow (kind1, kind2), s (kind1left, kind2right)) | 103 | kind ARROW kind (KArrow (kind1, kind2), s (kind1left, kind2right)) |
104 | LPAREN kind RPAREN (#1 kind, s (LPARENleft, RPARENright)) | 104 | LPAREN kind RPAREN (#1 kind, s (LPARENleft, RPARENright)) |
105 | UNDERUNDER (KWild, s (UNDERUNDERleft, UNDERUNDERright)) | |
105 | 106 |
106 capps : cterm (cterm) | 107 capps : cterm (cterm) |
107 | capps cterm (CApp (capps, cterm), s (cappsleft, ctermright)) | 108 | capps cterm (CApp (capps, cterm), s (cappsleft, ctermright)) |
108 | 109 |
109 cexp : capps (capps) | 110 cexp : capps (capps) |
114 | 115 |
115 | FN SYMBOL DCOLON kind DARROW cexp (CAbs (SYMBOL, kind, cexp), s (FNleft, cexpright)) | 116 | FN SYMBOL DCOLON kind DARROW cexp (CAbs (SYMBOL, kind, cexp), s (FNleft, cexpright)) |
116 | 117 |
117 | LPAREN cexp RPAREN DCOLON kind (CAnnot (cexp, kind), s (LPARENleft, kindright)) | 118 | LPAREN cexp RPAREN DCOLON kind (CAnnot (cexp, kind), s (LPARENleft, kindright)) |
118 | 119 |
120 | UNDER DCOLON kind (CWild kind, s (UNDERleft, UNDERright)) | |
121 | |
119 kcolon : DCOLON (Explicit) | 122 kcolon : DCOLON (Explicit) |
120 | TCOLON (Implicit) | 123 | TCOLON (Implicit) |
121 | 124 |
122 cterm : LPAREN cexp RPAREN (#1 cexp, s (LPARENleft, RPARENright)) | 125 cterm : LPAREN cexp RPAREN (#1 cexp, s (LPARENleft, RPARENright)) |
123 | LBRACK rcon RBRACK (CRecord rcon, s (LBRACKleft, RBRACKright)) | 126 | LBRACK rcon RBRACK (CRecord rcon, s (LBRACKleft, RBRACKright)) |
125 s (LBRACEleft, RBRACEright)) | 128 s (LBRACEleft, RBRACEright)) |
126 | DOLLAR cterm (TRecord cterm, s (DOLLARleft, ctermright)) | 129 | DOLLAR cterm (TRecord cterm, s (DOLLARleft, ctermright)) |
127 | HASH CSYMBOL (CName CSYMBOL, s (HASHleft, CSYMBOLright)) | 130 | HASH CSYMBOL (CName CSYMBOL, s (HASHleft, CSYMBOLright)) |
128 | 131 |
129 | SYMBOL (CVar SYMBOL, s (SYMBOLleft, SYMBOLright)) | 132 | SYMBOL (CVar SYMBOL, s (SYMBOLleft, SYMBOLright)) |
133 | UNDER (CWild (KWild, s (UNDERleft, UNDERright)), s (UNDERleft, UNDERright)) | |
130 | 134 |
131 rcon : ([]) | 135 rcon : ([]) |
132 | ident EQ cexp ([(ident, cexp)]) | 136 | ident EQ cexp ([(ident, cexp)]) |
133 | ident EQ cexp COMMA rcon ((ident, cexp) :: rcon) | 137 | ident EQ cexp COMMA rcon ((ident, cexp) :: rcon) |
134 | 138 |