@stordata/grammars 1.0.20230421155415
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +13 -0
- package/.gitlab-ci.yml +49 -0
- package/.nvmrc +2 -0
- package/README.md +26 -0
- package/dist/main.cjs +2 -0
- package/dist/main.cjs.LICENSE.txt +1 -0
- package/generated/src/grammars/CustomMetric.interp +55 -0
- package/generated/src/grammars/CustomMetric.tokens +30 -0
- package/generated/src/grammars/CustomMetricLexer.interp +80 -0
- package/generated/src/grammars/CustomMetricLexer.js +94 -0
- package/generated/src/grammars/CustomMetricLexer.tokens +30 -0
- package/generated/src/grammars/CustomMetricListener.js +81 -0
- package/generated/src/grammars/CustomMetricParser.js +579 -0
- package/package.json +42 -0
- package/src/GrammarSyntaxError.js +10 -0
- package/src/ThrowingErrorListener.js +11 -0
- package/src/grammars/CustomMetric.g4 +38 -0
- package/src/grammars/parseCustomMetric.js +7 -0
- package/src/grammars/parseCustomMetric.spec.js +50 -0
- package/src/index.js +20 -0
- package/src/parse.js +18 -0
- package/src/walk.js +7 -0
- package/webpack.config.js +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! For license information please see antlr4.web.js.LICENSE.txt */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
token literal names:
|
|
2
|
+
null
|
|
3
|
+
null
|
|
4
|
+
null
|
|
5
|
+
null
|
|
6
|
+
null
|
|
7
|
+
null
|
|
8
|
+
null
|
|
9
|
+
null
|
|
10
|
+
null
|
|
11
|
+
'.'
|
|
12
|
+
'('
|
|
13
|
+
')'
|
|
14
|
+
'+'
|
|
15
|
+
'-'
|
|
16
|
+
'*'
|
|
17
|
+
'/'
|
|
18
|
+
'"'
|
|
19
|
+
' '
|
|
20
|
+
null
|
|
21
|
+
null
|
|
22
|
+
null
|
|
23
|
+
null
|
|
24
|
+
|
|
25
|
+
token symbolic names:
|
|
26
|
+
null
|
|
27
|
+
NUMBER
|
|
28
|
+
STRING
|
|
29
|
+
WHITESPACE
|
|
30
|
+
ADD
|
|
31
|
+
SUBTRACT
|
|
32
|
+
MULTIPLY
|
|
33
|
+
DIVIDE
|
|
34
|
+
DIGIT
|
|
35
|
+
DOT
|
|
36
|
+
L_PARANT
|
|
37
|
+
R_PARANT
|
|
38
|
+
PLUS
|
|
39
|
+
MINUS
|
|
40
|
+
STAR
|
|
41
|
+
SLASH
|
|
42
|
+
DQUOTE
|
|
43
|
+
SPACE
|
|
44
|
+
TAB
|
|
45
|
+
CR
|
|
46
|
+
LF
|
|
47
|
+
ANY
|
|
48
|
+
|
|
49
|
+
rule names:
|
|
50
|
+
all
|
|
51
|
+
expression
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
atn:
|
|
55
|
+
[4, 1, 21, 34, 2, 0, 7, 0, 2, 1, 7, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 15, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 29, 8, 1, 10, 1, 12, 1, 32, 9, 1, 1, 1, 0, 1, 2, 2, 0, 2, 0, 0, 37, 0, 4, 1, 0, 0, 0, 2, 14, 1, 0, 0, 0, 4, 5, 3, 2, 1, 0, 5, 6, 5, 0, 0, 1, 6, 1, 1, 0, 0, 0, 7, 8, 6, 1, -1, 0, 8, 9, 5, 10, 0, 0, 9, 10, 3, 2, 1, 0, 10, 11, 5, 11, 0, 0, 11, 15, 1, 0, 0, 0, 12, 15, 5, 1, 0, 0, 13, 15, 5, 2, 0, 0, 14, 7, 1, 0, 0, 0, 14, 12, 1, 0, 0, 0, 14, 13, 1, 0, 0, 0, 15, 30, 1, 0, 0, 0, 16, 17, 10, 7, 0, 0, 17, 18, 5, 4, 0, 0, 18, 29, 3, 2, 1, 8, 19, 20, 10, 6, 0, 0, 20, 21, 5, 5, 0, 0, 21, 29, 3, 2, 1, 7, 22, 23, 10, 5, 0, 0, 23, 24, 5, 6, 0, 0, 24, 29, 3, 2, 1, 6, 25, 26, 10, 4, 0, 0, 26, 27, 5, 7, 0, 0, 27, 29, 3, 2, 1, 5, 28, 16, 1, 0, 0, 0, 28, 19, 1, 0, 0, 0, 28, 22, 1, 0, 0, 0, 28, 25, 1, 0, 0, 0, 29, 32, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 31, 3, 1, 0, 0, 0, 32, 30, 1, 0, 0, 0, 3, 14, 28, 30]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
NUMBER=1
|
|
2
|
+
STRING=2
|
|
3
|
+
WHITESPACE=3
|
|
4
|
+
ADD=4
|
|
5
|
+
SUBTRACT=5
|
|
6
|
+
MULTIPLY=6
|
|
7
|
+
DIVIDE=7
|
|
8
|
+
DIGIT=8
|
|
9
|
+
DOT=9
|
|
10
|
+
L_PARANT=10
|
|
11
|
+
R_PARANT=11
|
|
12
|
+
PLUS=12
|
|
13
|
+
MINUS=13
|
|
14
|
+
STAR=14
|
|
15
|
+
SLASH=15
|
|
16
|
+
DQUOTE=16
|
|
17
|
+
SPACE=17
|
|
18
|
+
TAB=18
|
|
19
|
+
CR=19
|
|
20
|
+
LF=20
|
|
21
|
+
ANY=21
|
|
22
|
+
'.'=9
|
|
23
|
+
'('=10
|
|
24
|
+
')'=11
|
|
25
|
+
'+'=12
|
|
26
|
+
'-'=13
|
|
27
|
+
'*'=14
|
|
28
|
+
'/'=15
|
|
29
|
+
'"'=16
|
|
30
|
+
' '=17
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
token literal names:
|
|
2
|
+
null
|
|
3
|
+
null
|
|
4
|
+
null
|
|
5
|
+
null
|
|
6
|
+
null
|
|
7
|
+
null
|
|
8
|
+
null
|
|
9
|
+
null
|
|
10
|
+
null
|
|
11
|
+
'.'
|
|
12
|
+
'('
|
|
13
|
+
')'
|
|
14
|
+
'+'
|
|
15
|
+
'-'
|
|
16
|
+
'*'
|
|
17
|
+
'/'
|
|
18
|
+
'"'
|
|
19
|
+
' '
|
|
20
|
+
null
|
|
21
|
+
null
|
|
22
|
+
null
|
|
23
|
+
null
|
|
24
|
+
|
|
25
|
+
token symbolic names:
|
|
26
|
+
null
|
|
27
|
+
NUMBER
|
|
28
|
+
STRING
|
|
29
|
+
WHITESPACE
|
|
30
|
+
ADD
|
|
31
|
+
SUBTRACT
|
|
32
|
+
MULTIPLY
|
|
33
|
+
DIVIDE
|
|
34
|
+
DIGIT
|
|
35
|
+
DOT
|
|
36
|
+
L_PARANT
|
|
37
|
+
R_PARANT
|
|
38
|
+
PLUS
|
|
39
|
+
MINUS
|
|
40
|
+
STAR
|
|
41
|
+
SLASH
|
|
42
|
+
DQUOTE
|
|
43
|
+
SPACE
|
|
44
|
+
TAB
|
|
45
|
+
CR
|
|
46
|
+
LF
|
|
47
|
+
ANY
|
|
48
|
+
|
|
49
|
+
rule names:
|
|
50
|
+
NUMBER
|
|
51
|
+
STRING
|
|
52
|
+
WHITESPACE
|
|
53
|
+
ADD
|
|
54
|
+
SUBTRACT
|
|
55
|
+
MULTIPLY
|
|
56
|
+
DIVIDE
|
|
57
|
+
DIGIT
|
|
58
|
+
DOT
|
|
59
|
+
L_PARANT
|
|
60
|
+
R_PARANT
|
|
61
|
+
PLUS
|
|
62
|
+
MINUS
|
|
63
|
+
STAR
|
|
64
|
+
SLASH
|
|
65
|
+
DQUOTE
|
|
66
|
+
SPACE
|
|
67
|
+
TAB
|
|
68
|
+
CR
|
|
69
|
+
LF
|
|
70
|
+
ANY
|
|
71
|
+
|
|
72
|
+
channel names:
|
|
73
|
+
DEFAULT_TOKEN_CHANNEL
|
|
74
|
+
HIDDEN
|
|
75
|
+
|
|
76
|
+
mode names:
|
|
77
|
+
DEFAULT_MODE
|
|
78
|
+
|
|
79
|
+
atn:
|
|
80
|
+
[4, 0, 21, 110, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 4, 0, 45, 8, 0, 11, 0, 12, 0, 46, 1, 0, 1, 0, 4, 0, 51, 8, 0, 11, 0, 12, 0, 52, 3, 0, 55, 8, 0, 1, 1, 1, 1, 4, 1, 59, 8, 1, 11, 1, 12, 1, 60, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 69, 8, 2, 11, 2, 12, 2, 70, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 60, 0, 21, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 1, 0, 4, 1, 0, 48, 57, 1, 0, 9, 9, 1, 0, 13, 13, 1, 0, 10, 10, 117, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 1, 44, 1, 0, 0, 0, 3, 56, 1, 0, 0, 0, 5, 68, 1, 0, 0, 0, 7, 74, 1, 0, 0, 0, 9, 76, 1, 0, 0, 0, 11, 78, 1, 0, 0, 0, 13, 80, 1, 0, 0, 0, 15, 82, 1, 0, 0, 0, 17, 84, 1, 0, 0, 0, 19, 86, 1, 0, 0, 0, 21, 88, 1, 0, 0, 0, 23, 90, 1, 0, 0, 0, 25, 92, 1, 0, 0, 0, 27, 94, 1, 0, 0, 0, 29, 96, 1, 0, 0, 0, 31, 98, 1, 0, 0, 0, 33, 100, 1, 0, 0, 0, 35, 102, 1, 0, 0, 0, 37, 104, 1, 0, 0, 0, 39, 106, 1, 0, 0, 0, 41, 108, 1, 0, 0, 0, 43, 45, 3, 15, 7, 0, 44, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 46, 47, 1, 0, 0, 0, 47, 54, 1, 0, 0, 0, 48, 50, 3, 17, 8, 0, 49, 51, 3, 15, 7, 0, 50, 49, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 55, 1, 0, 0, 0, 54, 48, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 2, 1, 0, 0, 0, 56, 58, 3, 31, 15, 0, 57, 59, 3, 41, 20, 0, 58, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 63, 3, 31, 15, 0, 63, 4, 1, 0, 0, 0, 64, 69, 3, 33, 16, 0, 65, 69, 3, 35, 17, 0, 66, 69, 3, 37, 18, 0, 67, 69, 3, 39, 19, 0, 68, 64, 1, 0, 0, 0, 68, 65, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 73, 6, 2, 0, 0, 73, 6, 1, 0, 0, 0, 74, 75, 3, 23, 11, 0, 75, 8, 1, 0, 0, 0, 76, 77, 3, 25, 12, 0, 77, 10, 1, 0, 0, 0, 78, 79, 3, 27, 13, 0, 79, 12, 1, 0, 0, 0, 80, 81, 3, 29, 14, 0, 81, 14, 1, 0, 0, 0, 82, 83, 7, 0, 0, 0, 83, 16, 1, 0, 0, 0, 84, 85, 5, 46, 0, 0, 85, 18, 1, 0, 0, 0, 86, 87, 5, 40, 0, 0, 87, 20, 1, 0, 0, 0, 88, 89, 5, 41, 0, 0, 89, 22, 1, 0, 0, 0, 90, 91, 5, 43, 0, 0, 91, 24, 1, 0, 0, 0, 92, 93, 5, 45, 0, 0, 93, 26, 1, 0, 0, 0, 94, 95, 5, 42, 0, 0, 95, 28, 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 30, 1, 0, 0, 0, 98, 99, 5, 34, 0, 0, 99, 32, 1, 0, 0, 0, 100, 101, 5, 32, 0, 0, 101, 34, 1, 0, 0, 0, 102, 103, 7, 1, 0, 0, 103, 36, 1, 0, 0, 0, 104, 105, 7, 2, 0, 0, 105, 38, 1, 0, 0, 0, 106, 107, 7, 3, 0, 0, 107, 40, 1, 0, 0, 0, 108, 109, 9, 0, 0, 0, 109, 42, 1, 0, 0, 0, 7, 0, 46, 52, 54, 60, 68, 70, 1, 6, 0, 0]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Generated from src/grammars/CustomMetric.g4 by ANTLR 4.12.0
|
|
2
|
+
// jshint ignore: start
|
|
3
|
+
import antlr4 from 'antlr4';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const serializedATN = [4,0,21,110,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,
|
|
7
|
+
4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,
|
|
8
|
+
12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,
|
|
9
|
+
2,20,7,20,1,0,4,0,45,8,0,11,0,12,0,46,1,0,1,0,4,0,51,8,0,11,0,12,0,52,3,
|
|
10
|
+
0,55,8,0,1,1,1,1,4,1,59,8,1,11,1,12,1,60,1,1,1,1,1,2,1,2,1,2,1,2,4,2,69,
|
|
11
|
+
8,2,11,2,12,2,70,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,
|
|
12
|
+
1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,
|
|
13
|
+
1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,60,0,21,1,1,3,2,5,3,7,4,9,
|
|
14
|
+
5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,
|
|
15
|
+
18,37,19,39,20,41,21,1,0,4,1,0,48,57,1,0,9,9,1,0,13,13,1,0,10,10,117,0,1,
|
|
16
|
+
1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,
|
|
17
|
+
1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,
|
|
18
|
+
0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,
|
|
19
|
+
0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,1,44,1,0,0,0,3,56,1,0,0,0,5,
|
|
20
|
+
68,1,0,0,0,7,74,1,0,0,0,9,76,1,0,0,0,11,78,1,0,0,0,13,80,1,0,0,0,15,82,1,
|
|
21
|
+
0,0,0,17,84,1,0,0,0,19,86,1,0,0,0,21,88,1,0,0,0,23,90,1,0,0,0,25,92,1,0,
|
|
22
|
+
0,0,27,94,1,0,0,0,29,96,1,0,0,0,31,98,1,0,0,0,33,100,1,0,0,0,35,102,1,0,
|
|
23
|
+
0,0,37,104,1,0,0,0,39,106,1,0,0,0,41,108,1,0,0,0,43,45,3,15,7,0,44,43,1,
|
|
24
|
+
0,0,0,45,46,1,0,0,0,46,44,1,0,0,0,46,47,1,0,0,0,47,54,1,0,0,0,48,50,3,17,
|
|
25
|
+
8,0,49,51,3,15,7,0,50,49,1,0,0,0,51,52,1,0,0,0,52,50,1,0,0,0,52,53,1,0,0,
|
|
26
|
+
0,53,55,1,0,0,0,54,48,1,0,0,0,54,55,1,0,0,0,55,2,1,0,0,0,56,58,3,31,15,0,
|
|
27
|
+
57,59,3,41,20,0,58,57,1,0,0,0,59,60,1,0,0,0,60,61,1,0,0,0,60,58,1,0,0,0,
|
|
28
|
+
61,62,1,0,0,0,62,63,3,31,15,0,63,4,1,0,0,0,64,69,3,33,16,0,65,69,3,35,17,
|
|
29
|
+
0,66,69,3,37,18,0,67,69,3,39,19,0,68,64,1,0,0,0,68,65,1,0,0,0,68,66,1,0,
|
|
30
|
+
0,0,68,67,1,0,0,0,69,70,1,0,0,0,70,68,1,0,0,0,70,71,1,0,0,0,71,72,1,0,0,
|
|
31
|
+
0,72,73,6,2,0,0,73,6,1,0,0,0,74,75,3,23,11,0,75,8,1,0,0,0,76,77,3,25,12,
|
|
32
|
+
0,77,10,1,0,0,0,78,79,3,27,13,0,79,12,1,0,0,0,80,81,3,29,14,0,81,14,1,0,
|
|
33
|
+
0,0,82,83,7,0,0,0,83,16,1,0,0,0,84,85,5,46,0,0,85,18,1,0,0,0,86,87,5,40,
|
|
34
|
+
0,0,87,20,1,0,0,0,88,89,5,41,0,0,89,22,1,0,0,0,90,91,5,43,0,0,91,24,1,0,
|
|
35
|
+
0,0,92,93,5,45,0,0,93,26,1,0,0,0,94,95,5,42,0,0,95,28,1,0,0,0,96,97,5,47,
|
|
36
|
+
0,0,97,30,1,0,0,0,98,99,5,34,0,0,99,32,1,0,0,0,100,101,5,32,0,0,101,34,1,
|
|
37
|
+
0,0,0,102,103,7,1,0,0,103,36,1,0,0,0,104,105,7,2,0,0,105,38,1,0,0,0,106,
|
|
38
|
+
107,7,3,0,0,107,40,1,0,0,0,108,109,9,0,0,0,109,42,1,0,0,0,7,0,46,52,54,60,
|
|
39
|
+
68,70,1,6,0,0];
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
const atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
|
|
43
|
+
|
|
44
|
+
const decisionsToDFA = atn.decisionToState.map( (ds, index) => new antlr4.dfa.DFA(ds, index) );
|
|
45
|
+
|
|
46
|
+
export default class CustomMetricLexer extends antlr4.Lexer {
|
|
47
|
+
|
|
48
|
+
static grammarFileName = "CustomMetric.g4";
|
|
49
|
+
static channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
|
|
50
|
+
static modeNames = [ "DEFAULT_MODE" ];
|
|
51
|
+
static literalNames = [ null, null, null, null, null, null, null, null,
|
|
52
|
+
null, "'.'", "'('", "')'", "'+'", "'-'", "'*'",
|
|
53
|
+
"'/'", "'\"'", "' '" ];
|
|
54
|
+
static symbolicNames = [ null, "NUMBER", "STRING", "WHITESPACE", "ADD",
|
|
55
|
+
"SUBTRACT", "MULTIPLY", "DIVIDE", "DIGIT", "DOT",
|
|
56
|
+
"L_PARANT", "R_PARANT", "PLUS", "MINUS", "STAR",
|
|
57
|
+
"SLASH", "DQUOTE", "SPACE", "TAB", "CR", "LF",
|
|
58
|
+
"ANY" ];
|
|
59
|
+
static ruleNames = [ "NUMBER", "STRING", "WHITESPACE", "ADD", "SUBTRACT",
|
|
60
|
+
"MULTIPLY", "DIVIDE", "DIGIT", "DOT", "L_PARANT",
|
|
61
|
+
"R_PARANT", "PLUS", "MINUS", "STAR", "SLASH", "DQUOTE",
|
|
62
|
+
"SPACE", "TAB", "CR", "LF", "ANY" ];
|
|
63
|
+
|
|
64
|
+
constructor(input) {
|
|
65
|
+
super(input)
|
|
66
|
+
this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.atn.PredictionContextCache());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
CustomMetricLexer.EOF = antlr4.Token.EOF;
|
|
71
|
+
CustomMetricLexer.NUMBER = 1;
|
|
72
|
+
CustomMetricLexer.STRING = 2;
|
|
73
|
+
CustomMetricLexer.WHITESPACE = 3;
|
|
74
|
+
CustomMetricLexer.ADD = 4;
|
|
75
|
+
CustomMetricLexer.SUBTRACT = 5;
|
|
76
|
+
CustomMetricLexer.MULTIPLY = 6;
|
|
77
|
+
CustomMetricLexer.DIVIDE = 7;
|
|
78
|
+
CustomMetricLexer.DIGIT = 8;
|
|
79
|
+
CustomMetricLexer.DOT = 9;
|
|
80
|
+
CustomMetricLexer.L_PARANT = 10;
|
|
81
|
+
CustomMetricLexer.R_PARANT = 11;
|
|
82
|
+
CustomMetricLexer.PLUS = 12;
|
|
83
|
+
CustomMetricLexer.MINUS = 13;
|
|
84
|
+
CustomMetricLexer.STAR = 14;
|
|
85
|
+
CustomMetricLexer.SLASH = 15;
|
|
86
|
+
CustomMetricLexer.DQUOTE = 16;
|
|
87
|
+
CustomMetricLexer.SPACE = 17;
|
|
88
|
+
CustomMetricLexer.TAB = 18;
|
|
89
|
+
CustomMetricLexer.CR = 19;
|
|
90
|
+
CustomMetricLexer.LF = 20;
|
|
91
|
+
CustomMetricLexer.ANY = 21;
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
NUMBER=1
|
|
2
|
+
STRING=2
|
|
3
|
+
WHITESPACE=3
|
|
4
|
+
ADD=4
|
|
5
|
+
SUBTRACT=5
|
|
6
|
+
MULTIPLY=6
|
|
7
|
+
DIVIDE=7
|
|
8
|
+
DIGIT=8
|
|
9
|
+
DOT=9
|
|
10
|
+
L_PARANT=10
|
|
11
|
+
R_PARANT=11
|
|
12
|
+
PLUS=12
|
|
13
|
+
MINUS=13
|
|
14
|
+
STAR=14
|
|
15
|
+
SLASH=15
|
|
16
|
+
DQUOTE=16
|
|
17
|
+
SPACE=17
|
|
18
|
+
TAB=18
|
|
19
|
+
CR=19
|
|
20
|
+
LF=20
|
|
21
|
+
ANY=21
|
|
22
|
+
'.'=9
|
|
23
|
+
'('=10
|
|
24
|
+
')'=11
|
|
25
|
+
'+'=12
|
|
26
|
+
'-'=13
|
|
27
|
+
'*'=14
|
|
28
|
+
'/'=15
|
|
29
|
+
'"'=16
|
|
30
|
+
' '=17
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Generated from src/grammars/CustomMetric.g4 by ANTLR 4.12.0
|
|
2
|
+
// jshint ignore: start
|
|
3
|
+
import antlr4 from 'antlr4';
|
|
4
|
+
|
|
5
|
+
// This class defines a complete listener for a parse tree produced by CustomMetricParser.
|
|
6
|
+
export default class CustomMetricListener extends antlr4.tree.ParseTreeListener {
|
|
7
|
+
|
|
8
|
+
// Enter a parse tree produced by CustomMetricParser#all.
|
|
9
|
+
enterAll(ctx) {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Exit a parse tree produced by CustomMetricParser#all.
|
|
13
|
+
exitAll(ctx) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Enter a parse tree produced by CustomMetricParser#Addition.
|
|
18
|
+
enterAddition(ctx) {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Exit a parse tree produced by CustomMetricParser#Addition.
|
|
22
|
+
exitAddition(ctx) {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// Enter a parse tree produced by CustomMetricParser#Multiplication.
|
|
27
|
+
enterMultiplication(ctx) {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Exit a parse tree produced by CustomMetricParser#Multiplication.
|
|
31
|
+
exitMultiplication(ctx) {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// Enter a parse tree produced by CustomMetricParser#Subtraction.
|
|
36
|
+
enterSubtraction(ctx) {
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Exit a parse tree produced by CustomMetricParser#Subtraction.
|
|
40
|
+
exitSubtraction(ctx) {
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// Enter a parse tree produced by CustomMetricParser#Number.
|
|
45
|
+
enterNumber(ctx) {
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Exit a parse tree produced by CustomMetricParser#Number.
|
|
49
|
+
exitNumber(ctx) {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// Enter a parse tree produced by CustomMetricParser#WrappedExpression.
|
|
54
|
+
enterWrappedExpression(ctx) {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Exit a parse tree produced by CustomMetricParser#WrappedExpression.
|
|
58
|
+
exitWrappedExpression(ctx) {
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
// Enter a parse tree produced by CustomMetricParser#Division.
|
|
63
|
+
enterDivision(ctx) {
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Exit a parse tree produced by CustomMetricParser#Division.
|
|
67
|
+
exitDivision(ctx) {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// Enter a parse tree produced by CustomMetricParser#String.
|
|
72
|
+
enterString(ctx) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Exit a parse tree produced by CustomMetricParser#String.
|
|
76
|
+
exitString(ctx) {
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
}
|