Specification
1
prog:
2
| v = value; SEMI_COLON
3
| EOF
4
​
5
value:
6
| SET; host = host;
7
| POST; data_items = data_items; TO; series = series;
8
| GET; func = func?; FROM; series = series; since = since; filter_items = filter_items?;
9
| GET; func = func?; FROM; series = series; range = range; filter_items = filter_items?;
10
| GET; func = func?; FROM; series = series; last = last; filter_items = filter_items?;
11
| DELETE; FROM; series = series; range = range; filter_items = filter_items?;
12
​
13
host:
14
HOST; s = STRING
15
16
data_items:
17
dpl = separated_list(COMMA, data_item)
18
​
19
ts:
20
TIMESTAMP; EQUALS; n = INT; COMMA
21
22
num:
23
VALUE?; EQUALS?; v = FLOAT;
24
​
25
data_item:
26
LEFT_PAREN?; ts = ts?; tag_items = tag_items?; num = num; RIGHT_PAREN?
27
​
28
tag_items:
29
TAG; EQUALS; LEFT_BRACK; tl = separated_list(COMMA, tag_item); RIGHT_BRACK; COMMA
30
​
31
tag_item:
32
LEFT_PAREN?; s1 = STRING; EQUALS; s2 = STRING; RIGHT_PAREN?
33
​
34
func:
35
MIN | MAX; | SUM; | COUNT; | MEAN; | SD;
36
37
series:
38
l = separated_nonempty_list(COMMA, STRING)
39
​
40
range:
41
| RANGE; n1 = INT; SECONDS; TO; n2 = INT; SECONDS
42
| RANGE; n1 = INT; TO; n2 = INT;
43
| RANGE; n1 = INT; MINUTES; TO; n2 = INT; MINUTES
44
| RANGE; n1 = INT; HOURS; TO; n2 = INT; HOURS
45
| RANGE; n1 = INT; DAYS; TO; n2 = INT; DAYS
46
​
47
last:
48
LAST; n = INT
49
​
50
filter_items:
51
| FILTER; lis = separated_nonempty_list(COMMA, filter_item)
52
​
53
filter_item:
54
s1 = STRING; IS; s2 = STRING
55
​
56
since:
57
| SINCE; n = INT; SECONDS
58
| SINCE; n = INT;
59
| SINCE; n = INT; MINUTES
60
| SINCE; n = INT; HOURS
61
| SINCE; n = INT; DAYS
Copied!
Last modified 1yr ago
Copy link