churf/Grammar.cf
sebastianselander 6218efac20 Renamer done.
It renames bound variables to numbers, converts let to lambda, and
removes all variables from binds
2023-02-14 16:44:38 +01:00

31 lines
669 B
CFEngine3

Program. Program ::= [Bind] ;
Bind. Bind ::= Ident [Ident] "=" Exp ;
EAnn. Exp5 ::= Exp5 ":" Type ;
EId. Exp4 ::= Ident ;
EConst. Exp4 ::= Const ;
EApp. Exp3 ::= Exp3 Exp4 ;
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
ELet. Exp ::= "let" Ident "=" Exp "in" Exp ;
EAbs. Exp ::= "\\" Ident "." Exp ;
CInt. Const ::= Integer ;
CStr. Const ::= String ;
TMono. Type ::= "Mono" Ident ;
TPoly. Type ::= "Poly" Ident ;
TArrow. Type ::= Type "->" Type1 ;
-- token Upper (upper (letter | digit | '_')*) ;
-- token Lower (lower (letter | digit | '_')*) ;
separator Bind ";" ;
separator Ident " ";
coercions Type 1 ;
coercions Exp 5 ;
comment "--" ;
comment "{-" "-}" ;