-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.ebnf
47 lines (46 loc) · 1.28 KB
/
grammar.ebnf
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
<script> -> <cexprs> Ω
<funcmods> -> ( <expr> ; ) <funcmods>
| ε
<argdecls> -> <argdecl> <argdecls>
| ε
<argdecl> -> id
| [ <argdecls> ; ]
<expr> -> <single> <args> <switch> <slot> <chain>
<args> -> <single> <args>
| ε
<chain> -> -> <expr>
| -- <expr>
| -| <expr>
| ε
<slot> -> : <argdecl>
| ε
<single> -> number
| string
| <import>
| <lambda>
| <array>
| <subbable>
<subbable> -> id <sub>
| <compound> <sub>
<sub> -> . <subbable>
| ε
<array> -> [ <aexprs> ]
<aexprs> -> <exprs>
| ;
<switch> -> { <switches> }
| ε
<compound> -> ( <cexprs> )
| (| <cexprs> |)
<exprs> -> <expr> ; <exprs>
| ε
<switches> -> <expr> => <expr> ; <switches>
| ε
<cexprs> -> <expr> ; <cexprs>
| <letexpr> ; <cexprs>
| ε
<lambda> -> (@ <funcmods> id <argdecls> => <cexprs> )
<letexpr> -> let <letassign>
<letassign> -> <funcmods> id <argdecls> => <expr>
| <argdecl> => <expr>
<import> -> import string
# vim: ts=2 sw=2 et