comment "--" ; token FIdent letter (letter | digit | '_')*; entrypoints Program, Exp ; -- Top level definitions Prog. Program ::= [Func] ; terminator Func ";" ; Func. Func ::= "def" FIdent "=" Exp; EVar. Exp9 ::= FIdent ; EInt. Exp9 ::= Integer ; ETrue. Exp9 ::= "true" ; EFalse. Exp9 ::= "false" ; EApp. Exp8 ::= Exp8 Exp9 ; ENeg. Exp7 ::= "-" Exp7 ; EMul. Exp6 ::= Exp6 "*" Exp7 ; EDiv. Exp6 ::= Exp6 "/" Exp7 ; EAdd. Exp5 ::= Exp5 "+" Exp6 ; ESub. Exp5 ::= Exp5 "-" Exp6 ; ELt. Exp4 ::= Exp4 "<" Exp5 ; EGt. Exp4 ::= Exp4 ">" Exp5 ; ELEq. Exp4 ::= Exp4 "<=" Exp5 ; EGEq. Exp4 ::= Exp4 ">=" Exp5 ; EEq. Exp3 ::= Exp3 "==" Exp4 ; ENEq. Exp3 ::= Exp3 "!=" Exp4 ; EIf. Exp2 ::= "if" Exp3 "then" Exp3 "else" Exp3 ; ELambda. Exp ::= "\\" FIdent ":" Type "." Exp ; coercions Exp 9 ; separator Exp "," ; TBool. Type1 ::= "Bool" ; TInt. Type1 ::= "Int" ; TFun. Type ::= Type1 "->" Type ; coercions Type 1 ;