Implement lambda lifting passes: freeVars, abstract, and rename

This commit is contained in:
Martin Fredin 2023-02-09 05:19:51 +01:00
parent b64b49b1eb
commit 2a48b7477e
4 changed files with 211 additions and 23 deletions

View file

@ -1,15 +1,25 @@
Program. Program ::= "main" "=" Exp ;
Program. Program ::= [ScDef];
EId. Exp3 ::= Ident ;
EInt. Exp3 ::= Integer ;
EApp. Exp2 ::= Exp2 Exp3 ;
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
EAbs. Exp ::= "\\" Ident "." Exp ;
ScDef. ScDef ::= Bind;
separator ScDef ";";
coercions Exp 3 ;
separator Ident " ";
comment "--" ;
comment "{-" "-}" ;
EId. Exp3 ::= Ident;
EInt. Exp3 ::= Integer;
ELet. Exp3 ::= "let" [Bind] "in" Exp;
EApp. Exp2 ::= Exp2 Exp3;
EAdd. Exp1 ::= Exp1 "+" Exp2;
EAbs. Exp ::= "\\" Ident "." Exp;
Bind. Bind ::= Ident [Ident] "=" Exp;
separator Bind ";";
coercions Exp 3;
comment "--";
comment "{-" "-}";