Skip to content

Commit c753450

Browse files
committed
Added XBNF file for config for later use
1 parent 81e91f2 commit c753450

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/config.xbnf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@SKIP \ \r\n\t
2+
@CASESENSITIVE true
3+
@LINECOMMENTSTART \/\/
4+
@BLOCKCOMMENTSTART \/\*
5+
@BLOCKCOMMENTEND \*\/
6+
7+
8+
class => class ? notoken;
9+
ident => (a-zA-Z0-9\_)+;
10+
curlyo = "{" > \{ ? notoken;
11+
curlyc = "}" > \} ? notoken;
12+
roundo = "(" > \( ? notoken;
13+
roundc = ")" > \) ? notoken;
14+
squareo = "[" > \[ ? notoken;
15+
squarec = "]" > \] ? notoken;
16+
colon = ":" > \: ? notoken;
17+
semicolon = ";" > \; ? notoken;
18+
equalsign = "=" > \=;
19+
plusequal = "+=" > \+\=;
20+
comma = "," > \, ? notoken;
21+
dot = "." > \. ? notoken;
22+
minus = "-" > \. ? notoken;
23+
number => (0-9)+;
24+
string =? 0;
25+
true => true;
26+
false => false;
27+
delete => delete;
28+
29+
CONFIGROOT = { CLASS };
30+
CLASS = class ident [ colon ident ] [ curlyo { CLASS | VARIABLE | DELETE } curlyc ] semicolon;
31+
DELETE = delete ident semicolon;
32+
VARIABLE = ident ( curlyo curlyc ( equalsign | plusequal ) ARRAY | equalsign VALUE ) semicolon;
33+
VALUE = STRING | NUMBER | BOOLEAN;
34+
ARRAY = curlyo [ ( ARRAY | VALUE ) { comma ( ARRAY | VALUE ) } ] curlyc;
35+
STRING = string;
36+
NUMBER = [ minus ] number [ dot number ];
37+
BOOLEAN = true | false;

0 commit comments

Comments
 (0)