churf/Grammar.cf
sebastianselander 73dc2e4b6a Inference on most expressions. HM based.
Still have to figure out how to infer type of lambda variables, as well
as how function application on polymorphic should work
2023-02-13 12:17:49 +01:00

28 lines
537 B
CFEngine3

Program. Program ::= [Bind];
Bind. Bind ::= Ident [Ident] "=" Exp;
EAnn. Exp5 ::= Exp5 ":" Type ;
EId. Exp4 ::= Ident;
EConst. Exp4 ::= Const;
EApp. Exp3 ::= Exp3 Exp4;
ELet. Exp2 ::= "let" Bind "in" Exp;
EAdd. Exp1 ::= Exp1 "+" Exp2;
EAbs. Exp ::= "\\" Ident "." Exp;
CInt. Const ::= Integer ;
CStr. Const ::= String ;
TMono. Type1 ::= Ident ;
TPoly. Type1 ::= Ident ;
TFun. Type ::= Type1 "->" Type ;
separator Bind ";";
separator Ident " ";
coercions Type 1 ;
coercions Exp 5;
comment "--";
comment "{-" "-}";