Adjust old type checker to new syntax, and refactor lambda lifter to use typed AST
This commit is contained in:
parent
514c809b1e
commit
210e55bb15
18 changed files with 554 additions and 145 deletions
14
Grammar.cf
14
Grammar.cf
|
|
@ -7,14 +7,22 @@ EInt. Exp3 ::= Integer;
|
|||
ELet. Exp3 ::= "let" [Bind] "in" Exp;
|
||||
EApp. Exp2 ::= Exp2 Exp3;
|
||||
EAdd. Exp1 ::= Exp1 "+" Exp2;
|
||||
EAbs. Exp ::= "\\" Ident "." Exp;
|
||||
EAbs. Exp ::= "\\" Ident ":" Type "." Exp;
|
||||
EAnn. Exp3 ::= "(" Exp ":" Type ")";
|
||||
|
||||
Bind. Bind ::= Ident ":" Type ";"
|
||||
Ident [Ident] "=" Exp ;
|
||||
|
||||
Bind. Bind ::= Ident [Ident] "=" Exp;
|
||||
separator Bind ";";
|
||||
separator Ident " ";
|
||||
separator Ident "";
|
||||
|
||||
coercions Exp 3;
|
||||
|
||||
TInt. Type1 ::= "Int" ;
|
||||
TPol. Type1 ::= Ident ;
|
||||
TFun. Type ::= Type1 "->" Type ;
|
||||
coercions Type 1 ;
|
||||
|
||||
comment "--";
|
||||
comment "{-" "-}";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue