m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/schmim.bnfc
blob: 6fe294afd9d59d861d7bda6dda94d2568fbdb938 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ENum. Exp ::= Integer;
EVar. Exp ::= Ident;
EAbs. Exp ::= "(" "lambda" Ident ":" Type Exp ")";
EApp. Exp ::= "("Exp [Exp]")";
ETr. Exp ::= "true";
EFl. Exp ::= "false";
EAdd. Exp ::= "(" "+" Exp Exp")";
ESub. Exp ::= "(" "-" Exp Exp")";
EMul. Exp ::= "(" "*" Exp Exp")";
EDiv. Exp ::= "(" "/" Exp Exp")";
EEq. Exp ::= "(" "=" Exp Exp")";
ELeq. Exp ::= "(" "<=" Exp Exp")";
EGeq. Exp ::= "(" ">=" Exp Exp")";
ELess. Exp ::= "(" "<" Exp Exp")";
EGrt. Exp ::= "(" ">" Exp Exp")";
EAnd. Exp ::= "(" "and" Exp Exp")";
EOr. Exp ::= "(" "or" Exp Exp")";
ENot. Exp ::= "(" "not" Exp")";
EIfte. Exp ::= "(" "if" Exp Exp Exp")";
ELet. Exp ::= "(" "let" "("Ident [Param]")" Exp Exp")";
ELetrec. Exp ::= "(" "letrec" "("Ident ":" Type [Param]")" Exp Exp")";
EVrnt. Exp ::= "<" Ident Exp ">" ":" Type;
EMtch. Exp ::= "(" "match" Exp [Matching]")";
ETpl. Exp ::= "{" [Exp] "}";
EProj. Exp ::= Exp "." Integer;
ENil. Exp ::= "nil" ":" Type;
EIsnil. Exp ::= "(" "isnil" Exp")";
ECons. Exp ::= "(" "cons" Exp Exp")";
EHead. Exp ::= "(" "head" Exp")";
ETail. Exp ::= "(" "tail" Exp")";
EFix. Exp ::= "(" "fix" Exp")";
separator Exp "";

Param. Param ::= Ident ":" Type;
separator Param "";
Matching. Matching ::= "(<" Ident Ident ">" Exp ")";
separator Matching "";

_. Type ::= "(" Type ")";
TBool. Type ::= "Bool";
TInt. Type ::= "Int";
TFun. Type ::= Type "->" Type;
TVrnt. Type ::= "<" [Labeled] ">";
TTpl. Type ::= "{" [Type] "}";
TList. Type ::= "[" Type "]";
separator Type "";

Labeled. Labeled ::= Ident ":" Type;
separator Labeled "";

comment ";";