summaryrefslogtreecommitdiff
path: root/devel/compiler/Src.cf
blob: 5a49b2341596b10b742e96f710c7ed483735e362 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Gr.  Grammar ::= [Def] ;

DPar.  Def ::= "param" Ident "=" [Constr] ;
DOper. Def ::= "oper" Ident ":" Type "=" Exp ;
DOpty. Def ::= "oper" Ident "=" Type ;
DLin.  Def ::= "lin" Ident ":" Type "=" Exp ;

terminator Def ";" ;

Con. Constr ::= Ident [Type] ;

separator nonempty Constr "|" ;

TBas. Type1 ::= Ident ;
TVal. Type1 ::= "Ints" Integer ;
TRec. Type1 ::= "{" [Typing] "}" ;
TFun. Type  ::= Type1 "->" Type ;

coercions Type 1 ;

terminator Type "" ;

FTyp. Typing ::= Label ":" Type ;

separator Typing ";" ;

Lab.  Label ::= Ident "#" Integer ;

EVar. Exp2 ::= "$" Ident ;
EOpr. Exp2 ::= "&" Ident ;
ECon. Exp2 ::= Ident ;
EVal. Exp2 ::= Integer ;
EStr. Exp2 ::= String ;
ECst. Exp2 ::= "(" Ident "@" [Exp] ")" ;
ERec. Exp2 ::= "{" [Assign] "}" ;
EApp. Exp1 ::= Exp1 Exp2 ;
ESel. Exp1 ::= Exp1 "!" Exp2 ;
EPro. Exp1 ::= Exp1 "." Label ;
ETab. Exp1 ::= "table" Type "{" [Case] "}" ;
ECat. Exp  ::= Exp "++" Exp1 ;
EAbs. Exp  ::= "\\" Ident "->" Exp ;

coercions Exp 2 ;

separator Exp "," ;

FExp. Assign ::= Label "=" Exp ;

separator Assign ";" ;

Cas.  Case ::= Patt "=>" Exp ;

separator Case ";" ;

PVal. Patt ::= Integer ;
PVar. Patt ::= "$" Ident ;
PRec. Patt ::= "{" [AssPatt] "}" ;
PCon. Patt ::= "(" Ident [Patt] ")" ;

terminator Patt "" ;

FPatt. AssPatt ::= Label "=" Patt ;

separator AssPatt ";" ;

comment "--" ;
comment "{-" "-}" ;