-
Notifications
You must be signed in to change notification settings - Fork 1
/
MIML.cf
35 lines (26 loc) · 846 Bytes
/
MIML.cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
entrypoints Exp;
EIf . Exp1 ::= "if" Exp2 "then" Exp2 "else" Exp2 "fi" ;
EEq . Exp2 ::= Exp3 "==" Exp3 ;
ENe . Exp2 ::= Exp3 "!=" Exp3 ;
ELe . Exp2 ::= Exp3 "<" Exp3 ;
EGe . Exp2 ::= Exp3 ">" Exp3 ;
EPlus . Exp3 ::= Exp3 "+" Exp4 ;
EMinus . Exp3 ::= Exp3 "-" Exp4 ;
ETimes . Exp4 ::= Exp4 "*" Exp5 ;
EDiv . Exp4 ::= Exp4 "/" Exp5 ;
ECons . Exp5 ::= Exp6 ":" Exp5 ;
ENil . Exp5 ::= "[]" ;
EList . Exp5 ::= "[" [Exp] "]" ;
separator Exp "," ;
ENeg . Exp6 ::= "-" Exp6 ;
EApp . Exp7 ::= Exp7 Exp8;
EVar . Exp8 ::= Ident ;
EInt . Exp8 ::= Integer ;
ELet . Exp8 ::= "let" Ident "=" Exp "in" Exp "end" ;
EFun . Exp8 ::= "let" Ident [Ident] "=" Exp "in" Exp "end" ;
ELam . Exp8 ::= "lambda" Ident "=" Exp "end";
separator nonempty Ident "" ;
coercions Exp 8;
comment "//" ;
comment "#" ;
comment "/*" "*/" ;