aboutsummaryrefslogtreecommitdiff
path: root/config.ebnf
blob: 51c1db772e03f33215076f9bc2c427d96b7a4c3c (plain) (blame)
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
Config          = Doc .
Doc             = Stmt { Stmt } .
Stmt            = Word (Assignment | Command) .

# Statements
Assignment      = "=" Values br .
Command         = [Values] ( Body | br ) .

# Value types
Values          = Value {Value} .
Value           = Word | String | Number | Boolean .
Body            = lbrace [ Doc ] rbrace .

# Atoms
Word            = word .
Number          = number .
Boolean         = boolean .
String          = str .

# Primitives
word            = (alpha | spec) {alpha | number | spec} .
alpha           = `[a-zA-Z]` .
spec            = `\$|_` .
number          =  `-?[0-9]+(\.[0-9]+)?` .
boolean         = `true|false` .
str             = `"[^"]*"` | `'[^']*'` | '`' { `[^\x60]` } '`' .
lbrace          = "{" .
rbrace          = "}" .
br              = ";" .
white_space     = ` |\t|\r|\n|#.*` .