1.1 KB56 lines
Blame
1grammar RadarGrammar
2import "../common/common";
3
4entry Radar:
5 NEWLINE*
6 ('radar-beta' | 'radar-beta:' | 'radar-beta' ':')
7 NEWLINE*
8 (
9 TitleAndAccessibilities
10 | 'axis' axes+=Axis (',' axes+=Axis)*
11 | 'curve' curves+=Curve (',' curves+=Curve)*
12 | options+=Option (',' options+=Option)*
13 | NEWLINE
14 )*
15;
16
17fragment Label:
18 '[' label=STRING ']'
19;
20
21Axis:
22 name=ID (Label)?
23;
24
25Curve:
26 name=ID (Label)? '{' Entries '}'
27;
28
29fragment Entries:
30 NEWLINE* entries+=NumberEntry (',' NEWLINE* entries+=NumberEntry)* NEWLINE* |
31 NEWLINE* entries+=DetailedEntry (',' NEWLINE* entries+=DetailedEntry)* NEWLINE*
32;
33
34interface Entry {
35 axis?: @Axis;
36 value: number;
37}
38DetailedEntry returns Entry:
39 axis=[Axis:ID] ':'? value=NUMBER
40;
41NumberEntry returns Entry:
42 value=NUMBER
43;
44
45Option:
46 (
47 name='showLegend' value=BOOLEAN
48 | name='ticks' value=NUMBER
49 | name='max' value=NUMBER
50 | name='min' value=NUMBER
51 | name='graticule' value=GRATICULE
52 )
53;
54
55terminal GRATICULE returns string: 'circle' | 'polygon';
56