Mercurial > urweb
comparison src/lacweb.grm @ 211:e86411f647c6
Initial type class support
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 Aug 2008 14:32:18 -0400 |
parents | f4033abd6ab1 |
children | ba4d7c33a45f |
comparison
equal
deleted
inserted
replaced
210:f4033abd6ab1 | 211:e86411f647c6 |
---|---|
87 | STRING of string | INT of Int64.int | FLOAT of Real64.real | 87 | STRING of string | INT of Int64.int | FLOAT of Real64.real |
88 | SYMBOL of string | CSYMBOL of string | 88 | SYMBOL of string | CSYMBOL of string |
89 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE | 89 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE |
90 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR | 90 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR |
91 | DIVIDE | GT | DOTDOTDOT | 91 | DIVIDE | GT | DOTDOTDOT |
92 | CON | LTYPE | VAL | REC | AND | FOLD | UNIT | KUNIT | 92 | CON | LTYPE | VAL | REC | AND | FOLD | UNIT | KUNIT | CLASS |
93 | DATATYPE | OF | 93 | DATATYPE | OF |
94 | TYPE | NAME | 94 | TYPE | NAME |
95 | ARROW | LARROW | DARROW | STAR | 95 | ARROW | LARROW | DARROW | STAR |
96 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE | 96 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE |
97 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN | 97 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN |
239 [] => raise Fail "Impossible mpath parse [3]" | 239 [] => raise Fail "Impossible mpath parse [3]" |
240 | m :: ms => (DOpenConstraints (m, ms), s (OPENleft, mpathright))) | 240 | m :: ms => (DOpenConstraints (m, ms), s (OPENleft, mpathright))) |
241 | CONSTRAINT cterm TWIDDLE cterm (DConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright)) | 241 | CONSTRAINT cterm TWIDDLE cterm (DConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright)) |
242 | EXPORT spath (DExport spath, s (EXPORTleft, spathright)) | 242 | EXPORT spath (DExport spath, s (EXPORTleft, spathright)) |
243 | TABLE SYMBOL COLON cexp (DTable (SYMBOL, entable cexp), s (TABLEleft, cexpright)) | 243 | TABLE SYMBOL COLON cexp (DTable (SYMBOL, entable cexp), s (TABLEleft, cexpright)) |
244 | CLASS SYMBOL EQ cexp (DClass (SYMBOL, cexp), s (CLASSleft, cexpright)) | |
245 | CLASS SYMBOL SYMBOL EQ cexp (let | |
246 val loc = s (CLASSleft, cexpright) | |
247 val k = (KType, loc) | |
248 val c = (CAbs (SYMBOL2, SOME k, cexp), loc) | |
249 in | |
250 (DClass (SYMBOL1, c), s (CLASSleft, cexpright)) | |
251 end) | |
244 | 252 |
245 dargs : ([]) | 253 dargs : ([]) |
246 | SYMBOL dargs (SYMBOL :: dargs) | 254 | SYMBOL dargs (SYMBOL :: dargs) |
247 | 255 |
248 barOpt : () | 256 barOpt : () |
297 (SgnFun (CSYMBOL2, sgn1, sgn2), s (FUNCTORleft, sgn2right))), | 305 (SgnFun (CSYMBOL2, sgn1, sgn2), s (FUNCTORleft, sgn2right))), |
298 s (FUNCTORleft, sgn2right)) | 306 s (FUNCTORleft, sgn2right)) |
299 | INCLUDE sgn (SgiInclude sgn, s (INCLUDEleft, sgnright)) | 307 | INCLUDE sgn (SgiInclude sgn, s (INCLUDEleft, sgnright)) |
300 | CONSTRAINT cterm TWIDDLE cterm (SgiConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright)) | 308 | CONSTRAINT cterm TWIDDLE cterm (SgiConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright)) |
301 | TABLE SYMBOL COLON cexp (SgiTable (SYMBOL, entable cexp), s (TABLEleft, cexpright)) | 309 | TABLE SYMBOL COLON cexp (SgiTable (SYMBOL, entable cexp), s (TABLEleft, cexpright)) |
310 | CLASS SYMBOL (SgiClassAbs SYMBOL, s (CLASSleft, SYMBOLright)) | |
311 | CLASS SYMBOL EQ cexp (SgiClass (SYMBOL, cexp), s (CLASSleft, cexpright)) | |
312 | CLASS SYMBOL SYMBOL EQ cexp (let | |
313 val loc = s (CLASSleft, cexpright) | |
314 val k = (KType, loc) | |
315 val c = (CAbs (SYMBOL2, SOME k, cexp), loc) | |
316 in | |
317 (SgiClass (SYMBOL1, c), s (CLASSleft, cexpright)) | |
318 end) | |
302 | 319 |
303 sgis : ([]) | 320 sgis : ([]) |
304 | sgi sgis (sgi :: sgis) | 321 | sgi sgis (sgi :: sgis) |
305 | 322 |
306 str : STRUCT decls END (StrConst decls, s (STRUCTleft, ENDright)) | 323 str : STRUCT decls END (StrConst decls, s (STRUCTleft, ENDright)) |
457 | XML_BEGIN xml XML_END (xml) | 474 | XML_BEGIN xml XML_END (xml) |
458 | XML_BEGIN XML_END (EApp ((EVar (["Basis"], "cdata"), s (XML_BEGINleft, XML_ENDright)), | 475 | XML_BEGIN XML_END (EApp ((EVar (["Basis"], "cdata"), s (XML_BEGINleft, XML_ENDright)), |
459 (EPrim (Prim.String ""), s (XML_BEGINleft, XML_ENDright))), | 476 (EPrim (Prim.String ""), s (XML_BEGINleft, XML_ENDright))), |
460 s (XML_BEGINleft, XML_ENDright)) | 477 s (XML_BEGINleft, XML_ENDright)) |
461 | LPAREN query RPAREN (query) | 478 | LPAREN query RPAREN (query) |
479 | UNDER (EWild, s (UNDERleft, UNDERright)) | |
462 | 480 |
463 idents : ident ([ident]) | 481 idents : ident ([ident]) |
464 | ident DOT idents (ident :: idents) | 482 | ident DOT idents (ident :: idents) |
465 | 483 |
466 etuple : eexp COMMA eexp ([eexp1, eexp2]) | 484 etuple : eexp COMMA eexp ([eexp1, eexp2]) |
631 | FALSE (sql_inject (EVar (["Basis"], "False"), | 649 | FALSE (sql_inject (EVar (["Basis"], "False"), |
632 EVar (["Basis"], "sql_bool"), | 650 EVar (["Basis"], "sql_bool"), |
633 s (FALSEleft, FALSEright))) | 651 s (FALSEleft, FALSEright))) |
634 | 652 |
635 | LBRACE eexp RBRACE (sql_inject (#1 eexp, | 653 | LBRACE eexp RBRACE (sql_inject (#1 eexp, |
636 ESqlInfer, | 654 EWild, |
637 s (LBRACEleft, RBRACEright))) | 655 s (LBRACEleft, RBRACEright))) |
638 | 656 |
639 wopt : (sql_inject (EVar (["Basis"], "True"), | 657 wopt : (sql_inject (EVar (["Basis"], "True"), |
640 EVar (["Basis"], "sql_bool"), | 658 EVar (["Basis"], "sql_bool"), |
641 ErrorMsg.dummySpan)) | 659 ErrorMsg.dummySpan)) |