-
Notifications
You must be signed in to change notification settings - Fork 0
/
jmespath_lexer.go
238 lines (227 loc) · 12.2 KB
/
jmespath_lexer.go
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
// Code generated from Jmespath.g4 by ANTLR 4.12.0. DO NOT EDIT.
package parser
import (
"fmt"
"sync"
"unicode"
antlr "github.com/wrmsr/bane/core/antlr/runtime"
)
// Suppress unused import error
var _ = fmt.Printf
var _ = sync.Once{}
var _ = unicode.IsLetter
type JmespathLexer struct {
*antlr.BaseLexer
channelNames []string
modeNames []string
// TODO: EOF string
}
var jmespathlexerLexerStaticData struct {
once sync.Once
serializedATN []int32
channelNames []string
modeNames []string
literalNames []string
symbolicNames []string
ruleNames []string
predictionContextCache *antlr.PredictionContextCache
atn *antlr.ATN
decisionToDFA []*antlr.DFA
}
func jmespathlexerLexerInit() {
staticData := &jmespathlexerLexerStaticData
staticData.channelNames = []string{
"DEFAULT_TOKEN_CHANNEL", "HIDDEN",
}
staticData.modeNames = []string{
"DEFAULT_MODE",
}
staticData.literalNames = []string{
"", "'.'", "'&&'", "'||'", "'!'", "'('", "')'", "'|'", "'*'", "'['",
"']'", "'[?'", "','", "'{'", "'}'", "':'", "'$'", "'@'", "'&'", "'`'",
}
staticData.symbolicNames = []string{
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "COMPARATOR", "RAW_STRING", "JSON_CONSTANT", "NAME", "STRING",
"REAL_OR_EXPONENT_NUMBER", "SIGNED_INT", "INT", "WS",
}
staticData.ruleNames = []string{
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
"T__17", "T__18", "COMPARATOR", "RAW_STRING", "RAW_ESC", "JSON_CONSTANT",
"NAME", "STRING", "ESC", "UNICODE", "HEX", "REAL_OR_EXPONENT_NUMBER",
"SIGNED_INT", "INT", "EXP", "WS",
}
staticData.predictionContextCache = antlr.NewPredictionContextCache()
staticData.serializedATN = []int32{
4, 0, 28, 227, 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, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
31, 7, 31, 2, 32, 7, 32, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 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, 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, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3,
19, 119, 8, 19, 1, 20, 1, 20, 1, 20, 5, 20, 124, 8, 20, 10, 20, 12, 20,
127, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1,
22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22,
147, 8, 22, 1, 23, 1, 23, 5, 23, 151, 8, 23, 10, 23, 12, 23, 154, 9, 23,
1, 24, 1, 24, 1, 24, 5, 24, 159, 8, 24, 10, 24, 12, 24, 162, 9, 24, 1,
24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 169, 8, 25, 1, 26, 1, 26, 1, 26,
1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 3, 28, 180, 8, 28, 1, 28, 1,
28, 1, 28, 4, 28, 185, 8, 28, 11, 28, 12, 28, 186, 1, 28, 3, 28, 190, 8,
28, 1, 28, 3, 28, 193, 8, 28, 1, 28, 1, 28, 1, 28, 3, 28, 198, 8, 28, 1,
29, 3, 29, 201, 8, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 5, 30, 208, 8,
30, 10, 30, 12, 30, 211, 9, 30, 3, 30, 213, 8, 30, 1, 31, 1, 31, 3, 31,
217, 8, 31, 1, 31, 1, 31, 1, 32, 4, 32, 222, 8, 32, 11, 32, 12, 32, 223,
1, 32, 1, 32, 0, 0, 33, 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, 43, 0, 45, 22, 47, 23, 49, 24, 51, 0, 53,
0, 55, 0, 57, 25, 59, 26, 61, 27, 63, 0, 65, 28, 1, 0, 11, 2, 0, 39, 39,
92, 92, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97,
122, 2, 0, 34, 34, 92, 92, 9, 0, 34, 34, 47, 47, 92, 92, 96, 96, 98, 98,
102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102,
1, 0, 48, 57, 1, 0, 49, 57, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45,
3, 0, 9, 10, 13, 13, 32, 32, 244, 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, 0, 45, 1,
0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59,
1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 1, 67, 1, 0, 0, 0, 3,
69, 1, 0, 0, 0, 5, 72, 1, 0, 0, 0, 7, 75, 1, 0, 0, 0, 9, 77, 1, 0, 0, 0,
11, 79, 1, 0, 0, 0, 13, 81, 1, 0, 0, 0, 15, 83, 1, 0, 0, 0, 17, 85, 1,
0, 0, 0, 19, 87, 1, 0, 0, 0, 21, 89, 1, 0, 0, 0, 23, 92, 1, 0, 0, 0, 25,
94, 1, 0, 0, 0, 27, 96, 1, 0, 0, 0, 29, 98, 1, 0, 0, 0, 31, 100, 1, 0,
0, 0, 33, 102, 1, 0, 0, 0, 35, 104, 1, 0, 0, 0, 37, 106, 1, 0, 0, 0, 39,
118, 1, 0, 0, 0, 41, 120, 1, 0, 0, 0, 43, 130, 1, 0, 0, 0, 45, 146, 1,
0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 155, 1, 0, 0, 0, 51, 165, 1, 0, 0, 0,
53, 170, 1, 0, 0, 0, 55, 176, 1, 0, 0, 0, 57, 197, 1, 0, 0, 0, 59, 200,
1, 0, 0, 0, 61, 212, 1, 0, 0, 0, 63, 214, 1, 0, 0, 0, 65, 221, 1, 0, 0,
0, 67, 68, 5, 46, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 38, 0, 0, 70, 71,
5, 38, 0, 0, 71, 4, 1, 0, 0, 0, 72, 73, 5, 124, 0, 0, 73, 74, 5, 124, 0,
0, 74, 6, 1, 0, 0, 0, 75, 76, 5, 33, 0, 0, 76, 8, 1, 0, 0, 0, 77, 78, 5,
40, 0, 0, 78, 10, 1, 0, 0, 0, 79, 80, 5, 41, 0, 0, 80, 12, 1, 0, 0, 0,
81, 82, 5, 124, 0, 0, 82, 14, 1, 0, 0, 0, 83, 84, 5, 42, 0, 0, 84, 16,
1, 0, 0, 0, 85, 86, 5, 91, 0, 0, 86, 18, 1, 0, 0, 0, 87, 88, 5, 93, 0,
0, 88, 20, 1, 0, 0, 0, 89, 90, 5, 91, 0, 0, 90, 91, 5, 63, 0, 0, 91, 22,
1, 0, 0, 0, 92, 93, 5, 44, 0, 0, 93, 24, 1, 0, 0, 0, 94, 95, 5, 123, 0,
0, 95, 26, 1, 0, 0, 0, 96, 97, 5, 125, 0, 0, 97, 28, 1, 0, 0, 0, 98, 99,
5, 58, 0, 0, 99, 30, 1, 0, 0, 0, 100, 101, 5, 36, 0, 0, 101, 32, 1, 0,
0, 0, 102, 103, 5, 64, 0, 0, 103, 34, 1, 0, 0, 0, 104, 105, 5, 38, 0, 0,
105, 36, 1, 0, 0, 0, 106, 107, 5, 96, 0, 0, 107, 38, 1, 0, 0, 0, 108, 119,
5, 60, 0, 0, 109, 110, 5, 60, 0, 0, 110, 119, 5, 61, 0, 0, 111, 112, 5,
61, 0, 0, 112, 119, 5, 61, 0, 0, 113, 114, 5, 62, 0, 0, 114, 119, 5, 61,
0, 0, 115, 119, 5, 62, 0, 0, 116, 117, 5, 33, 0, 0, 117, 119, 5, 61, 0,
0, 118, 108, 1, 0, 0, 0, 118, 109, 1, 0, 0, 0, 118, 111, 1, 0, 0, 0, 118,
113, 1, 0, 0, 0, 118, 115, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 40, 1,
0, 0, 0, 120, 125, 5, 39, 0, 0, 121, 124, 3, 43, 21, 0, 122, 124, 8, 0,
0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0,
125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127,
125, 1, 0, 0, 0, 128, 129, 5, 39, 0, 0, 129, 42, 1, 0, 0, 0, 130, 131,
5, 92, 0, 0, 131, 132, 9, 0, 0, 0, 132, 44, 1, 0, 0, 0, 133, 134, 5, 116,
0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 117, 0, 0, 136, 147, 5, 101,
0, 0, 137, 138, 5, 102, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 108,
0, 0, 140, 141, 5, 115, 0, 0, 141, 147, 5, 101, 0, 0, 142, 143, 5, 110,
0, 0, 143, 144, 5, 117, 0, 0, 144, 145, 5, 108, 0, 0, 145, 147, 5, 108,
0, 0, 146, 133, 1, 0, 0, 0, 146, 137, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0,
147, 46, 1, 0, 0, 0, 148, 152, 7, 1, 0, 0, 149, 151, 7, 2, 0, 0, 150, 149,
1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0,
0, 0, 153, 48, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 160, 5, 34, 0, 0,
156, 159, 3, 51, 25, 0, 157, 159, 8, 3, 0, 0, 158, 156, 1, 0, 0, 0, 158,
157, 1, 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161,
1, 0, 0, 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 164, 5, 34,
0, 0, 164, 50, 1, 0, 0, 0, 165, 168, 5, 92, 0, 0, 166, 169, 7, 4, 0, 0,
167, 169, 3, 53, 26, 0, 168, 166, 1, 0, 0, 0, 168, 167, 1, 0, 0, 0, 169,
52, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 3, 55, 27, 0, 172, 173,
3, 55, 27, 0, 173, 174, 3, 55, 27, 0, 174, 175, 3, 55, 27, 0, 175, 54,
1, 0, 0, 0, 176, 177, 7, 5, 0, 0, 177, 56, 1, 0, 0, 0, 178, 180, 5, 45,
0, 0, 179, 178, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0,
181, 182, 3, 61, 30, 0, 182, 184, 5, 46, 0, 0, 183, 185, 7, 6, 0, 0, 184,
183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187,
1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 190, 3, 63, 31, 0, 189, 188, 1,
0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 198, 1, 0, 0, 0, 191, 193, 5, 45, 0,
0, 192, 191, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194,
195, 3, 61, 30, 0, 195, 196, 3, 63, 31, 0, 196, 198, 1, 0, 0, 0, 197, 179,
1, 0, 0, 0, 197, 192, 1, 0, 0, 0, 198, 58, 1, 0, 0, 0, 199, 201, 5, 45,
0, 0, 200, 199, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0,
202, 203, 3, 61, 30, 0, 203, 60, 1, 0, 0, 0, 204, 213, 5, 48, 0, 0, 205,
209, 7, 7, 0, 0, 206, 208, 7, 6, 0, 0, 207, 206, 1, 0, 0, 0, 208, 211,
1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 213, 1, 0,
0, 0, 211, 209, 1, 0, 0, 0, 212, 204, 1, 0, 0, 0, 212, 205, 1, 0, 0, 0,
213, 62, 1, 0, 0, 0, 214, 216, 7, 8, 0, 0, 215, 217, 7, 9, 0, 0, 216, 215,
1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 3, 61,
30, 0, 219, 64, 1, 0, 0, 0, 220, 222, 7, 10, 0, 0, 221, 220, 1, 0, 0, 0,
222, 223, 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224,
225, 1, 0, 0, 0, 225, 226, 6, 32, 0, 0, 226, 66, 1, 0, 0, 0, 19, 0, 118,
123, 125, 146, 152, 158, 160, 168, 179, 186, 189, 192, 197, 200, 209, 212,
216, 223, 1, 6, 0, 0,
}
deserializer := antlr.NewATNDeserializer(nil)
staticData.atn = deserializer.Deserialize(staticData.serializedATN)
atn := staticData.atn
staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
decisionToDFA := staticData.decisionToDFA
for index, state := range atn.DecisionToState {
decisionToDFA[index] = antlr.NewDFA(state, index)
}
}
// JmespathLexerInit initializes any static state used to implement JmespathLexer. By default the
// static state used to implement the lexer is lazily initialized during the first call to
// NewJmespathLexer(). You can call this function if you wish to initialize the static state ahead
// of time.
func JmespathLexerInit() {
staticData := &jmespathlexerLexerStaticData
staticData.once.Do(jmespathlexerLexerInit)
}
// NewJmespathLexer produces a new lexer instance for the optional input antlr.CharStream.
func NewJmespathLexer(input antlr.CharStream) *JmespathLexer {
JmespathLexerInit()
l := new(JmespathLexer)
l.BaseLexer = antlr.NewBaseLexer(input)
staticData := &jmespathlexerLexerStaticData
l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
l.channelNames = staticData.channelNames
l.modeNames = staticData.modeNames
l.RuleNames = staticData.ruleNames
l.LiteralNames = staticData.literalNames
l.SymbolicNames = staticData.symbolicNames
l.GrammarFileName = "Jmespath.g4"
// TODO: l.EOF = antlr.TokenEOF
return l
}
// JmespathLexer tokens.
const (
JmespathLexerT__0 = 1
JmespathLexerT__1 = 2
JmespathLexerT__2 = 3
JmespathLexerT__3 = 4
JmespathLexerT__4 = 5
JmespathLexerT__5 = 6
JmespathLexerT__6 = 7
JmespathLexerT__7 = 8
JmespathLexerT__8 = 9
JmespathLexerT__9 = 10
JmespathLexerT__10 = 11
JmespathLexerT__11 = 12
JmespathLexerT__12 = 13
JmespathLexerT__13 = 14
JmespathLexerT__14 = 15
JmespathLexerT__15 = 16
JmespathLexerT__16 = 17
JmespathLexerT__17 = 18
JmespathLexerT__18 = 19
JmespathLexerCOMPARATOR = 20
JmespathLexerRAW_STRING = 21
JmespathLexerJSON_CONSTANT = 22
JmespathLexerNAME = 23
JmespathLexerSTRING = 24
JmespathLexerREAL_OR_EXPONENT_NUMBER = 25
JmespathLexerSIGNED_INT = 26
JmespathLexerINT = 27
JmespathLexerWS = 28
)