-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlight.ebnf
47 lines (30 loc) · 986 Bytes
/
light.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
<program> ::= <expression>
<expression> ::= <atom>
| '(' <function> <arguments> ')'
<function> ::= <atom>
<arguments> ::= <expression> <arguments>
| ε ; ε represents an empty string
<atom> ::= <variable>
| <number>
| <string>
| <boolean>
| <nil>
<variable> ::= <identifier>
<identifier> ::= <letter> <rest-of-identifier>
<rest-of-identifier> ::= <letter> <rest-of-identifier>
| <digit> <rest-of-identifier>
| ε
<number> ::= <integer>
| <float>
<integer> ::= <digit> <digits>
| '-' <digit> <digits>
<digits> ::= <digit> <digits>
| ε
<digit> ::= '0' | '1' | '2' | ... | '9'
<float> ::= <integer> '.' <digits>
<string> ::= '"' <string-content> '"'
<string-content> ::= <char> <string-content>
| ε
<char> ::= any valid character, excluding double quotes and control characters
<boolean> ::= 'true' | 'false'
<nil> ::= 'nil'