-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCFG
61 lines (39 loc) · 1.26 KB
/
CFG
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
<Module> -> <ModuleDefs>
<ModuleDefs> -> <ModuleDef> [<EOL> <ModuleDefs>]
<ModuleDef> -> <AbsDef>
| <TypeDef>
| <ConceptDef>
<AbsDef> -> def <Decl>
<TypeDef> -> type <TypeCon> = <Type>
<ConceptDef> -> concept { <LDecls> }
<Decls> -> <Decl> <Sep> <Decls>
| <Decl>
<Decl> -> <LDecl> = <Expr>
<LDecl> -> <Ident> [: <Type>]
<LDecls> -> <LDecl> [<SemiSep> <LDecls]
<Type> -> <BType> [-> <Type>]
<BType> -> [<BType>] <AType>
<AType> -> <TypeCon>
| <TypeVar>
| <AType> * <AType>
| ( <Type> )
<SemiExprs> -> <Expr> [<SemiSep> <SemiExprs>]
<CommaExprs> -> <Expr> [<CommaSep> <CommaExprs>]
<Expr> -> <Expr[0]> : <Type>
| <Expr[0]>
<Expr[i]> -> <Expr[i+1]> [<Op(n, i)> <Expr[i+1]>]
| <LExpr[i]>
| <RExpr[i]>
<LExpr[i]> -> (<LExpr[i]> | <Expr[i+1]>) <Op(l, i)> <Expr[i+1]>
<RExpr[i]> -> <Expr[i+1]> <Op(r, i)> (<RExpr[i]> | <Expr[i+1]>)
<Expr[10]> -> (<Params>) [: Type] -> <Expr>
| <Ident>
| <Literal>
| let <Decls> in <Expr>
| if (<Expr>) <Expr> else <Expr>
| { <SemiExprs> }
| [ <CommaExprs> ]
| <Expr> ( <CommaExprs> )
<Params> -> <Ident> [: <Type>] [, <Params>]
<SemiSep> -> ; | <EOL>
<CommaSep> -> ,