| 1 | grammar RadarGrammar |
| 2 | import "../common/common"; |
| 3 | |
| 4 | entry 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 | |
| 17 | fragment Label: |
| 18 | '[' label=STRING ']' |
| 19 | ; |
| 20 | |
| 21 | Axis: |
| 22 | name=ID (Label)? |
| 23 | ; |
| 24 | |
| 25 | Curve: |
| 26 | name=ID (Label)? '{' Entries '}' |
| 27 | ; |
| 28 | |
| 29 | fragment Entries: |
| 30 | NEWLINE* entries+=NumberEntry (',' NEWLINE* entries+=NumberEntry)* NEWLINE* | |
| 31 | NEWLINE* entries+=DetailedEntry (',' NEWLINE* entries+=DetailedEntry)* NEWLINE* |
| 32 | ; |
| 33 | |
| 34 | interface Entry { |
| 35 | axis?: @Axis; |
| 36 | value: number; |
| 37 | } |
| 38 | DetailedEntry returns Entry: |
| 39 | axis=[Axis:ID] ':'? value=NUMBER |
| 40 | ; |
| 41 | NumberEntry returns Entry: |
| 42 | value=NUMBER |
| 43 | ; |
| 44 | |
| 45 | Option: |
| 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 | |
| 55 | terminal GRATICULE returns string: 'circle' | 'polygon'; |
| 56 | |