30 lines
663 B
CFEngine3
30 lines
663 B
CFEngine3
Program. Program ::= [Bind];
|
|
|
|
EId. Exp3 ::= Ident;
|
|
EInt. Exp3 ::= Integer;
|
|
EAnn. Exp3 ::= "(" Exp ":" Type ")";
|
|
ELet. Exp3 ::= "let" Bind "in" Exp;
|
|
EApp. Exp2 ::= Exp2 Exp3;
|
|
EAdd. Exp1 ::= Exp1 "+" Exp2;
|
|
EAbs. Exp ::= "\\" Ident ":" Type "." Exp;
|
|
ECase. Exp ::= "case" Exp "of" "{" [CaseMatch] "}";
|
|
CaseMatch. CaseMatch ::= Case "=>" Exp ;
|
|
separator CaseMatch ",";
|
|
|
|
CInt. Case ::= Integer ;
|
|
|
|
Bind. Bind ::= Ident ":" Type ";"
|
|
Ident [Ident] "=" Exp;
|
|
|
|
separator Bind ";";
|
|
separator Ident "";
|
|
|
|
coercions Exp 3;
|
|
|
|
TInt. Type1 ::= "Int" ;
|
|
TPol. Type1 ::= Ident ;
|
|
TFun. Type ::= Type1 "->" Type ;
|
|
coercions Type 1 ;
|
|
|
|
comment "--";
|
|
comment "{-" "-}";
|