-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrammar.ebnf
More file actions
49 lines (38 loc) · 2.05 KB
/
grammar.ebnf
File metadata and controls
49 lines (38 loc) · 2.05 KB
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
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
integer = [ "+" | "-" ], digit, { digit };
decimal = [ "+" | "-" ], digit, { digit }, [ ".", digit, { digit } ];
lowercase letter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
"i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
"q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
"y" | "z";
uppercase letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" |
"I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" |
"Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" |
"Y" | "Z";
letter = lowercase letter | uppercase letter;
symbol = " " | "!" | '"' | "#" | "$" | "%" | "&" | "'" | "(" |
")" | "*" | "+" | "," | "-" | "." | "/" | ":" | ";" |
"<" | "=" | ">" | "?" | "@" | "\" | "^" | "_" | "`" |
"{" | "|" | "}" | "~";
repeat = digit;
sequence = lowercase letter;
voltage = "V", [ decimal ], { ",", [ decimal ] };
current = "I", [ decimal ], { ",", [ decimal ] };
temperature = "T", [ decimal ], { ",", [ decimal ] };
humidity = "H", [ decimal ], { ",", [ decimal ] };
pressure = "P", [ decimal ], { ",", [ decimal ] };
custom = "X", [ decimal ], { ",", [ decimal ] };
sun = "S", [ decimal ], { ",", [ decimal ] };
rssi = "R", [ decimal ], { ",", [ decimal ] };
count = "C", [ decimal ], { ",", [ decimal ] };
windspeed = "W", [ decimal ], [ ",", [ decimal ] ];
location = "L", ( ( [ decimal, ",", decimal ] ) | ","), [ ",", [ decimal ] ];
zombie = "Z", ( "0" | "1" );
data field = voltage | current | temperature | humidity | pressure | custom | sun |
rssi | windspeed | location | count | zombie;
data = { data field };
comment = ":", { letter | digit | symbol };
node name character = uppercase letter | digit;
node name = node name character, { node name character };
path = "[", node name, { ",", node name }, "]";
packet = repeat, sequence, data, [ comment ], path;