@swaggerexpert/arazzo-runtime-expression 1.0.0
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/LICENSE +202 -0
- package/NOTICE +10 -0
- package/README.md +290 -0
- package/SECURITY.md +15 -0
- package/cjs/apg-lite.cjs +1221 -0
- package/cjs/extract.cjs +21 -0
- package/cjs/index.cjs +13 -0
- package/cjs/parse/callbacks/body-reference.cjs +14 -0
- package/cjs/parse/callbacks/expression.cjs +15 -0
- package/cjs/parse/callbacks/header-reference.cjs +14 -0
- package/cjs/parse/callbacks/json-pointer.cjs +14 -0
- package/cjs/parse/callbacks/name.cjs +14 -0
- package/cjs/parse/callbacks/parameter-name.cjs +14 -0
- package/cjs/parse/callbacks/path-reference.cjs +14 -0
- package/cjs/parse/callbacks/query-reference.cjs +14 -0
- package/cjs/parse/callbacks/reference-token.cjs +14 -0
- package/cjs/parse/callbacks/source.cjs +14 -0
- package/cjs/parse/callbacks/token.cjs +15 -0
- package/cjs/parse/index.cjs +40 -0
- package/cjs/runtime-expression.cjs +779 -0
- package/cjs/test.cjs +15 -0
- package/es/extract.mjs +17 -0
- package/es/index.mjs +4 -0
- package/es/parse/callbacks/body-reference.mjs +10 -0
- package/es/parse/callbacks/expression.mjs +11 -0
- package/es/parse/callbacks/header-reference.mjs +10 -0
- package/es/parse/callbacks/json-pointer.mjs +10 -0
- package/es/parse/callbacks/name.mjs +10 -0
- package/es/parse/callbacks/parameter-name.mjs +10 -0
- package/es/parse/callbacks/path-reference.mjs +10 -0
- package/es/parse/callbacks/query-reference.mjs +10 -0
- package/es/parse/callbacks/reference-token.mjs +10 -0
- package/es/parse/callbacks/source.mjs +10 -0
- package/es/parse/callbacks/token.mjs +10 -0
- package/es/parse/index.mjs +35 -0
- package/es/runtime-expression.mjs +775 -0
- package/es/test.mjs +10 -0
- package/package.json +82 -0
- package/types/index.d.ts +54 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = grammar;
|
|
5
|
+
// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
|
|
6
|
+
// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
|
|
7
|
+
//
|
|
8
|
+
// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
|
|
9
|
+
function grammar() {
|
|
10
|
+
// ```
|
|
11
|
+
// SUMMARY
|
|
12
|
+
// rules = 20
|
|
13
|
+
// udts = 0
|
|
14
|
+
// opcodes = 125
|
|
15
|
+
// --- ABNF original opcodes
|
|
16
|
+
// ALT = 11
|
|
17
|
+
// CAT = 18
|
|
18
|
+
// REP = 6
|
|
19
|
+
// RNM = 29
|
|
20
|
+
// TLS = 42
|
|
21
|
+
// TBS = 10
|
|
22
|
+
// TRG = 9
|
|
23
|
+
// --- SABNF superset opcodes
|
|
24
|
+
// UDT = 0
|
|
25
|
+
// AND = 0
|
|
26
|
+
// NOT = 0
|
|
27
|
+
// characters = [0 - 1114111]
|
|
28
|
+
// ```
|
|
29
|
+
/* OBJECT IDENTIFIER (for internal parser use) */
|
|
30
|
+
this.grammarObject = 'grammarObject';
|
|
31
|
+
|
|
32
|
+
/* RULES */
|
|
33
|
+
this.rules = [];
|
|
34
|
+
this.rules[0] = {
|
|
35
|
+
name: 'expression',
|
|
36
|
+
lower: 'expression',
|
|
37
|
+
index: 0,
|
|
38
|
+
isBkr: false
|
|
39
|
+
};
|
|
40
|
+
this.rules[1] = {
|
|
41
|
+
name: 'parameter-name',
|
|
42
|
+
lower: 'parameter-name',
|
|
43
|
+
index: 1,
|
|
44
|
+
isBkr: false
|
|
45
|
+
};
|
|
46
|
+
this.rules[2] = {
|
|
47
|
+
name: 'source',
|
|
48
|
+
lower: 'source',
|
|
49
|
+
index: 2,
|
|
50
|
+
isBkr: false
|
|
51
|
+
};
|
|
52
|
+
this.rules[3] = {
|
|
53
|
+
name: 'header-reference',
|
|
54
|
+
lower: 'header-reference',
|
|
55
|
+
index: 3,
|
|
56
|
+
isBkr: false
|
|
57
|
+
};
|
|
58
|
+
this.rules[4] = {
|
|
59
|
+
name: 'query-reference',
|
|
60
|
+
lower: 'query-reference',
|
|
61
|
+
index: 4,
|
|
62
|
+
isBkr: false
|
|
63
|
+
};
|
|
64
|
+
this.rules[5] = {
|
|
65
|
+
name: 'path-reference',
|
|
66
|
+
lower: 'path-reference',
|
|
67
|
+
index: 5,
|
|
68
|
+
isBkr: false
|
|
69
|
+
};
|
|
70
|
+
this.rules[6] = {
|
|
71
|
+
name: 'body-reference',
|
|
72
|
+
lower: 'body-reference',
|
|
73
|
+
index: 6,
|
|
74
|
+
isBkr: false
|
|
75
|
+
};
|
|
76
|
+
this.rules[7] = {
|
|
77
|
+
name: 'json-pointer',
|
|
78
|
+
lower: 'json-pointer',
|
|
79
|
+
index: 7,
|
|
80
|
+
isBkr: false
|
|
81
|
+
};
|
|
82
|
+
this.rules[8] = {
|
|
83
|
+
name: 'reference-token',
|
|
84
|
+
lower: 'reference-token',
|
|
85
|
+
index: 8,
|
|
86
|
+
isBkr: false
|
|
87
|
+
};
|
|
88
|
+
this.rules[9] = {
|
|
89
|
+
name: 'unescaped',
|
|
90
|
+
lower: 'unescaped',
|
|
91
|
+
index: 9,
|
|
92
|
+
isBkr: false
|
|
93
|
+
};
|
|
94
|
+
this.rules[10] = {
|
|
95
|
+
name: 'escaped',
|
|
96
|
+
lower: 'escaped',
|
|
97
|
+
index: 10,
|
|
98
|
+
isBkr: false
|
|
99
|
+
};
|
|
100
|
+
this.rules[11] = {
|
|
101
|
+
name: 'name',
|
|
102
|
+
lower: 'name',
|
|
103
|
+
index: 11,
|
|
104
|
+
isBkr: false
|
|
105
|
+
};
|
|
106
|
+
this.rules[12] = {
|
|
107
|
+
name: 'token',
|
|
108
|
+
lower: 'token',
|
|
109
|
+
index: 12,
|
|
110
|
+
isBkr: false
|
|
111
|
+
};
|
|
112
|
+
this.rules[13] = {
|
|
113
|
+
name: 'tchar',
|
|
114
|
+
lower: 'tchar',
|
|
115
|
+
index: 13,
|
|
116
|
+
isBkr: false
|
|
117
|
+
};
|
|
118
|
+
this.rules[14] = {
|
|
119
|
+
name: 'CHAR',
|
|
120
|
+
lower: 'char',
|
|
121
|
+
index: 14,
|
|
122
|
+
isBkr: false
|
|
123
|
+
};
|
|
124
|
+
this.rules[15] = {
|
|
125
|
+
name: 'escape',
|
|
126
|
+
lower: 'escape',
|
|
127
|
+
index: 15,
|
|
128
|
+
isBkr: false
|
|
129
|
+
};
|
|
130
|
+
this.rules[16] = {
|
|
131
|
+
name: 'unescape',
|
|
132
|
+
lower: 'unescape',
|
|
133
|
+
index: 16,
|
|
134
|
+
isBkr: false
|
|
135
|
+
};
|
|
136
|
+
this.rules[17] = {
|
|
137
|
+
name: 'HEXDIG',
|
|
138
|
+
lower: 'hexdig',
|
|
139
|
+
index: 17,
|
|
140
|
+
isBkr: false
|
|
141
|
+
};
|
|
142
|
+
this.rules[18] = {
|
|
143
|
+
name: 'DIGIT',
|
|
144
|
+
lower: 'digit',
|
|
145
|
+
index: 18,
|
|
146
|
+
isBkr: false
|
|
147
|
+
};
|
|
148
|
+
this.rules[19] = {
|
|
149
|
+
name: 'ALPHA',
|
|
150
|
+
lower: 'alpha',
|
|
151
|
+
index: 19,
|
|
152
|
+
isBkr: false
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/* UDTS */
|
|
156
|
+
this.udts = [];
|
|
157
|
+
|
|
158
|
+
/* OPCODES */
|
|
159
|
+
/* expression */
|
|
160
|
+
this.rules[0].opcodes = [];
|
|
161
|
+
this.rules[0].opcodes[0] = {
|
|
162
|
+
type: 1,
|
|
163
|
+
children: [1, 2, 3, 4, 7, 10, 13, 16, 19, 22, 25, 28]
|
|
164
|
+
}; // ALT
|
|
165
|
+
this.rules[0].opcodes[1] = {
|
|
166
|
+
type: 7,
|
|
167
|
+
string: [36, 117, 114, 108]
|
|
168
|
+
}; // TLS
|
|
169
|
+
this.rules[0].opcodes[2] = {
|
|
170
|
+
type: 7,
|
|
171
|
+
string: [36, 109, 101, 116, 104, 111, 100]
|
|
172
|
+
}; // TLS
|
|
173
|
+
this.rules[0].opcodes[3] = {
|
|
174
|
+
type: 7,
|
|
175
|
+
string: [36, 115, 116, 97, 116, 117, 115, 99, 111, 100, 101]
|
|
176
|
+
}; // TLS
|
|
177
|
+
this.rules[0].opcodes[4] = {
|
|
178
|
+
type: 2,
|
|
179
|
+
children: [5, 6]
|
|
180
|
+
}; // CAT
|
|
181
|
+
this.rules[0].opcodes[5] = {
|
|
182
|
+
type: 7,
|
|
183
|
+
string: [36, 114, 101, 113, 117, 101, 115, 116, 46]
|
|
184
|
+
}; // TLS
|
|
185
|
+
this.rules[0].opcodes[6] = {
|
|
186
|
+
type: 4,
|
|
187
|
+
index: 2
|
|
188
|
+
}; // RNM(source)
|
|
189
|
+
this.rules[0].opcodes[7] = {
|
|
190
|
+
type: 2,
|
|
191
|
+
children: [8, 9]
|
|
192
|
+
}; // CAT
|
|
193
|
+
this.rules[0].opcodes[8] = {
|
|
194
|
+
type: 7,
|
|
195
|
+
string: [36, 114, 101, 115, 112, 111, 110, 115, 101, 46]
|
|
196
|
+
}; // TLS
|
|
197
|
+
this.rules[0].opcodes[9] = {
|
|
198
|
+
type: 4,
|
|
199
|
+
index: 2
|
|
200
|
+
}; // RNM(source)
|
|
201
|
+
this.rules[0].opcodes[10] = {
|
|
202
|
+
type: 2,
|
|
203
|
+
children: [11, 12]
|
|
204
|
+
}; // CAT
|
|
205
|
+
this.rules[0].opcodes[11] = {
|
|
206
|
+
type: 7,
|
|
207
|
+
string: [36, 105, 110, 112, 117, 116, 115, 46]
|
|
208
|
+
}; // TLS
|
|
209
|
+
this.rules[0].opcodes[12] = {
|
|
210
|
+
type: 4,
|
|
211
|
+
index: 11
|
|
212
|
+
}; // RNM(name)
|
|
213
|
+
this.rules[0].opcodes[13] = {
|
|
214
|
+
type: 2,
|
|
215
|
+
children: [14, 15]
|
|
216
|
+
}; // CAT
|
|
217
|
+
this.rules[0].opcodes[14] = {
|
|
218
|
+
type: 7,
|
|
219
|
+
string: [36, 111, 117, 116, 112, 117, 116, 115, 46]
|
|
220
|
+
}; // TLS
|
|
221
|
+
this.rules[0].opcodes[15] = {
|
|
222
|
+
type: 4,
|
|
223
|
+
index: 11
|
|
224
|
+
}; // RNM(name)
|
|
225
|
+
this.rules[0].opcodes[16] = {
|
|
226
|
+
type: 2,
|
|
227
|
+
children: [17, 18]
|
|
228
|
+
}; // CAT
|
|
229
|
+
this.rules[0].opcodes[17] = {
|
|
230
|
+
type: 7,
|
|
231
|
+
string: [36, 115, 116, 101, 112, 115, 46]
|
|
232
|
+
}; // TLS
|
|
233
|
+
this.rules[0].opcodes[18] = {
|
|
234
|
+
type: 4,
|
|
235
|
+
index: 11
|
|
236
|
+
}; // RNM(name)
|
|
237
|
+
this.rules[0].opcodes[19] = {
|
|
238
|
+
type: 2,
|
|
239
|
+
children: [20, 21]
|
|
240
|
+
}; // CAT
|
|
241
|
+
this.rules[0].opcodes[20] = {
|
|
242
|
+
type: 7,
|
|
243
|
+
string: [36, 119, 111, 114, 107, 102, 108, 111, 119, 115, 46]
|
|
244
|
+
}; // TLS
|
|
245
|
+
this.rules[0].opcodes[21] = {
|
|
246
|
+
type: 4,
|
|
247
|
+
index: 11
|
|
248
|
+
}; // RNM(name)
|
|
249
|
+
this.rules[0].opcodes[22] = {
|
|
250
|
+
type: 2,
|
|
251
|
+
children: [23, 24]
|
|
252
|
+
}; // CAT
|
|
253
|
+
this.rules[0].opcodes[23] = {
|
|
254
|
+
type: 7,
|
|
255
|
+
string: [36, 115, 111, 117, 114, 99, 101, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46]
|
|
256
|
+
}; // TLS
|
|
257
|
+
this.rules[0].opcodes[24] = {
|
|
258
|
+
type: 4,
|
|
259
|
+
index: 11
|
|
260
|
+
}; // RNM(name)
|
|
261
|
+
this.rules[0].opcodes[25] = {
|
|
262
|
+
type: 2,
|
|
263
|
+
children: [26, 27]
|
|
264
|
+
}; // CAT
|
|
265
|
+
this.rules[0].opcodes[26] = {
|
|
266
|
+
type: 7,
|
|
267
|
+
string: [36, 99, 111, 109, 112, 111, 110, 101, 110, 116, 115, 46]
|
|
268
|
+
}; // TLS
|
|
269
|
+
this.rules[0].opcodes[27] = {
|
|
270
|
+
type: 4,
|
|
271
|
+
index: 11
|
|
272
|
+
}; // RNM(name)
|
|
273
|
+
this.rules[0].opcodes[28] = {
|
|
274
|
+
type: 2,
|
|
275
|
+
children: [29, 30]
|
|
276
|
+
}; // CAT
|
|
277
|
+
this.rules[0].opcodes[29] = {
|
|
278
|
+
type: 7,
|
|
279
|
+
string: [36, 99, 111, 109, 112, 111, 110, 101, 110, 116, 115, 46, 112, 97, 114, 97, 109, 101, 116, 101, 114, 115, 46]
|
|
280
|
+
}; // TLS
|
|
281
|
+
this.rules[0].opcodes[30] = {
|
|
282
|
+
type: 4,
|
|
283
|
+
index: 1
|
|
284
|
+
}; // RNM(parameter-name)
|
|
285
|
+
|
|
286
|
+
/* parameter-name */
|
|
287
|
+
this.rules[1].opcodes = [];
|
|
288
|
+
this.rules[1].opcodes[0] = {
|
|
289
|
+
type: 4,
|
|
290
|
+
index: 11
|
|
291
|
+
}; // RNM(name)
|
|
292
|
+
|
|
293
|
+
/* source */
|
|
294
|
+
this.rules[2].opcodes = [];
|
|
295
|
+
this.rules[2].opcodes[0] = {
|
|
296
|
+
type: 1,
|
|
297
|
+
children: [1, 2, 3, 4]
|
|
298
|
+
}; // ALT
|
|
299
|
+
this.rules[2].opcodes[1] = {
|
|
300
|
+
type: 4,
|
|
301
|
+
index: 3
|
|
302
|
+
}; // RNM(header-reference)
|
|
303
|
+
this.rules[2].opcodes[2] = {
|
|
304
|
+
type: 4,
|
|
305
|
+
index: 4
|
|
306
|
+
}; // RNM(query-reference)
|
|
307
|
+
this.rules[2].opcodes[3] = {
|
|
308
|
+
type: 4,
|
|
309
|
+
index: 5
|
|
310
|
+
}; // RNM(path-reference)
|
|
311
|
+
this.rules[2].opcodes[4] = {
|
|
312
|
+
type: 4,
|
|
313
|
+
index: 6
|
|
314
|
+
}; // RNM(body-reference)
|
|
315
|
+
|
|
316
|
+
/* header-reference */
|
|
317
|
+
this.rules[3].opcodes = [];
|
|
318
|
+
this.rules[3].opcodes[0] = {
|
|
319
|
+
type: 2,
|
|
320
|
+
children: [1, 2]
|
|
321
|
+
}; // CAT
|
|
322
|
+
this.rules[3].opcodes[1] = {
|
|
323
|
+
type: 7,
|
|
324
|
+
string: [104, 101, 97, 100, 101, 114, 46]
|
|
325
|
+
}; // TLS
|
|
326
|
+
this.rules[3].opcodes[2] = {
|
|
327
|
+
type: 4,
|
|
328
|
+
index: 12
|
|
329
|
+
}; // RNM(token)
|
|
330
|
+
|
|
331
|
+
/* query-reference */
|
|
332
|
+
this.rules[4].opcodes = [];
|
|
333
|
+
this.rules[4].opcodes[0] = {
|
|
334
|
+
type: 2,
|
|
335
|
+
children: [1, 2]
|
|
336
|
+
}; // CAT
|
|
337
|
+
this.rules[4].opcodes[1] = {
|
|
338
|
+
type: 7,
|
|
339
|
+
string: [113, 117, 101, 114, 121, 46]
|
|
340
|
+
}; // TLS
|
|
341
|
+
this.rules[4].opcodes[2] = {
|
|
342
|
+
type: 4,
|
|
343
|
+
index: 11
|
|
344
|
+
}; // RNM(name)
|
|
345
|
+
|
|
346
|
+
/* path-reference */
|
|
347
|
+
this.rules[5].opcodes = [];
|
|
348
|
+
this.rules[5].opcodes[0] = {
|
|
349
|
+
type: 2,
|
|
350
|
+
children: [1, 2]
|
|
351
|
+
}; // CAT
|
|
352
|
+
this.rules[5].opcodes[1] = {
|
|
353
|
+
type: 7,
|
|
354
|
+
string: [112, 97, 116, 104, 46]
|
|
355
|
+
}; // TLS
|
|
356
|
+
this.rules[5].opcodes[2] = {
|
|
357
|
+
type: 4,
|
|
358
|
+
index: 11
|
|
359
|
+
}; // RNM(name)
|
|
360
|
+
|
|
361
|
+
/* body-reference */
|
|
362
|
+
this.rules[6].opcodes = [];
|
|
363
|
+
this.rules[6].opcodes[0] = {
|
|
364
|
+
type: 2,
|
|
365
|
+
children: [1, 2]
|
|
366
|
+
}; // CAT
|
|
367
|
+
this.rules[6].opcodes[1] = {
|
|
368
|
+
type: 7,
|
|
369
|
+
string: [98, 111, 100, 121]
|
|
370
|
+
}; // TLS
|
|
371
|
+
this.rules[6].opcodes[2] = {
|
|
372
|
+
type: 3,
|
|
373
|
+
min: 0,
|
|
374
|
+
max: 1
|
|
375
|
+
}; // REP
|
|
376
|
+
this.rules[6].opcodes[3] = {
|
|
377
|
+
type: 2,
|
|
378
|
+
children: [4, 5]
|
|
379
|
+
}; // CAT
|
|
380
|
+
this.rules[6].opcodes[4] = {
|
|
381
|
+
type: 7,
|
|
382
|
+
string: [35]
|
|
383
|
+
}; // TLS
|
|
384
|
+
this.rules[6].opcodes[5] = {
|
|
385
|
+
type: 4,
|
|
386
|
+
index: 7
|
|
387
|
+
}; // RNM(json-pointer)
|
|
388
|
+
|
|
389
|
+
/* json-pointer */
|
|
390
|
+
this.rules[7].opcodes = [];
|
|
391
|
+
this.rules[7].opcodes[0] = {
|
|
392
|
+
type: 3,
|
|
393
|
+
min: 0,
|
|
394
|
+
max: Infinity
|
|
395
|
+
}; // REP
|
|
396
|
+
this.rules[7].opcodes[1] = {
|
|
397
|
+
type: 2,
|
|
398
|
+
children: [2, 3]
|
|
399
|
+
}; // CAT
|
|
400
|
+
this.rules[7].opcodes[2] = {
|
|
401
|
+
type: 7,
|
|
402
|
+
string: [47]
|
|
403
|
+
}; // TLS
|
|
404
|
+
this.rules[7].opcodes[3] = {
|
|
405
|
+
type: 4,
|
|
406
|
+
index: 8
|
|
407
|
+
}; // RNM(reference-token)
|
|
408
|
+
|
|
409
|
+
/* reference-token */
|
|
410
|
+
this.rules[8].opcodes = [];
|
|
411
|
+
this.rules[8].opcodes[0] = {
|
|
412
|
+
type: 3,
|
|
413
|
+
min: 0,
|
|
414
|
+
max: Infinity
|
|
415
|
+
}; // REP
|
|
416
|
+
this.rules[8].opcodes[1] = {
|
|
417
|
+
type: 1,
|
|
418
|
+
children: [2, 3]
|
|
419
|
+
}; // ALT
|
|
420
|
+
this.rules[8].opcodes[2] = {
|
|
421
|
+
type: 4,
|
|
422
|
+
index: 9
|
|
423
|
+
}; // RNM(unescaped)
|
|
424
|
+
this.rules[8].opcodes[3] = {
|
|
425
|
+
type: 4,
|
|
426
|
+
index: 10
|
|
427
|
+
}; // RNM(escaped)
|
|
428
|
+
|
|
429
|
+
/* unescaped */
|
|
430
|
+
this.rules[9].opcodes = [];
|
|
431
|
+
this.rules[9].opcodes[0] = {
|
|
432
|
+
type: 1,
|
|
433
|
+
children: [1, 2, 3]
|
|
434
|
+
}; // ALT
|
|
435
|
+
this.rules[9].opcodes[1] = {
|
|
436
|
+
type: 5,
|
|
437
|
+
min: 0,
|
|
438
|
+
max: 46
|
|
439
|
+
}; // TRG
|
|
440
|
+
this.rules[9].opcodes[2] = {
|
|
441
|
+
type: 5,
|
|
442
|
+
min: 48,
|
|
443
|
+
max: 125
|
|
444
|
+
}; // TRG
|
|
445
|
+
this.rules[9].opcodes[3] = {
|
|
446
|
+
type: 5,
|
|
447
|
+
min: 127,
|
|
448
|
+
max: 1114111
|
|
449
|
+
}; // TRG
|
|
450
|
+
|
|
451
|
+
/* escaped */
|
|
452
|
+
this.rules[10].opcodes = [];
|
|
453
|
+
this.rules[10].opcodes[0] = {
|
|
454
|
+
type: 2,
|
|
455
|
+
children: [1, 2]
|
|
456
|
+
}; // CAT
|
|
457
|
+
this.rules[10].opcodes[1] = {
|
|
458
|
+
type: 7,
|
|
459
|
+
string: [126]
|
|
460
|
+
}; // TLS
|
|
461
|
+
this.rules[10].opcodes[2] = {
|
|
462
|
+
type: 1,
|
|
463
|
+
children: [3, 4]
|
|
464
|
+
}; // ALT
|
|
465
|
+
this.rules[10].opcodes[3] = {
|
|
466
|
+
type: 7,
|
|
467
|
+
string: [48]
|
|
468
|
+
}; // TLS
|
|
469
|
+
this.rules[10].opcodes[4] = {
|
|
470
|
+
type: 7,
|
|
471
|
+
string: [49]
|
|
472
|
+
}; // TLS
|
|
473
|
+
|
|
474
|
+
/* name */
|
|
475
|
+
this.rules[11].opcodes = [];
|
|
476
|
+
this.rules[11].opcodes[0] = {
|
|
477
|
+
type: 3,
|
|
478
|
+
min: 0,
|
|
479
|
+
max: Infinity
|
|
480
|
+
}; // REP
|
|
481
|
+
this.rules[11].opcodes[1] = {
|
|
482
|
+
type: 4,
|
|
483
|
+
index: 14
|
|
484
|
+
}; // RNM(CHAR)
|
|
485
|
+
|
|
486
|
+
/* token */
|
|
487
|
+
this.rules[12].opcodes = [];
|
|
488
|
+
this.rules[12].opcodes[0] = {
|
|
489
|
+
type: 3,
|
|
490
|
+
min: 1,
|
|
491
|
+
max: Infinity
|
|
492
|
+
}; // REP
|
|
493
|
+
this.rules[12].opcodes[1] = {
|
|
494
|
+
type: 4,
|
|
495
|
+
index: 13
|
|
496
|
+
}; // RNM(tchar)
|
|
497
|
+
|
|
498
|
+
/* tchar */
|
|
499
|
+
this.rules[13].opcodes = [];
|
|
500
|
+
this.rules[13].opcodes[0] = {
|
|
501
|
+
type: 1,
|
|
502
|
+
children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
503
|
+
}; // ALT
|
|
504
|
+
this.rules[13].opcodes[1] = {
|
|
505
|
+
type: 7,
|
|
506
|
+
string: [33]
|
|
507
|
+
}; // TLS
|
|
508
|
+
this.rules[13].opcodes[2] = {
|
|
509
|
+
type: 7,
|
|
510
|
+
string: [35]
|
|
511
|
+
}; // TLS
|
|
512
|
+
this.rules[13].opcodes[3] = {
|
|
513
|
+
type: 7,
|
|
514
|
+
string: [36]
|
|
515
|
+
}; // TLS
|
|
516
|
+
this.rules[13].opcodes[4] = {
|
|
517
|
+
type: 7,
|
|
518
|
+
string: [37]
|
|
519
|
+
}; // TLS
|
|
520
|
+
this.rules[13].opcodes[5] = {
|
|
521
|
+
type: 7,
|
|
522
|
+
string: [38]
|
|
523
|
+
}; // TLS
|
|
524
|
+
this.rules[13].opcodes[6] = {
|
|
525
|
+
type: 7,
|
|
526
|
+
string: [39]
|
|
527
|
+
}; // TLS
|
|
528
|
+
this.rules[13].opcodes[7] = {
|
|
529
|
+
type: 7,
|
|
530
|
+
string: [42]
|
|
531
|
+
}; // TLS
|
|
532
|
+
this.rules[13].opcodes[8] = {
|
|
533
|
+
type: 7,
|
|
534
|
+
string: [43]
|
|
535
|
+
}; // TLS
|
|
536
|
+
this.rules[13].opcodes[9] = {
|
|
537
|
+
type: 7,
|
|
538
|
+
string: [45]
|
|
539
|
+
}; // TLS
|
|
540
|
+
this.rules[13].opcodes[10] = {
|
|
541
|
+
type: 7,
|
|
542
|
+
string: [46]
|
|
543
|
+
}; // TLS
|
|
544
|
+
this.rules[13].opcodes[11] = {
|
|
545
|
+
type: 7,
|
|
546
|
+
string: [94]
|
|
547
|
+
}; // TLS
|
|
548
|
+
this.rules[13].opcodes[12] = {
|
|
549
|
+
type: 7,
|
|
550
|
+
string: [95]
|
|
551
|
+
}; // TLS
|
|
552
|
+
this.rules[13].opcodes[13] = {
|
|
553
|
+
type: 7,
|
|
554
|
+
string: [96]
|
|
555
|
+
}; // TLS
|
|
556
|
+
this.rules[13].opcodes[14] = {
|
|
557
|
+
type: 7,
|
|
558
|
+
string: [124]
|
|
559
|
+
}; // TLS
|
|
560
|
+
this.rules[13].opcodes[15] = {
|
|
561
|
+
type: 7,
|
|
562
|
+
string: [126]
|
|
563
|
+
}; // TLS
|
|
564
|
+
this.rules[13].opcodes[16] = {
|
|
565
|
+
type: 4,
|
|
566
|
+
index: 18
|
|
567
|
+
}; // RNM(DIGIT)
|
|
568
|
+
this.rules[13].opcodes[17] = {
|
|
569
|
+
type: 4,
|
|
570
|
+
index: 19
|
|
571
|
+
}; // RNM(ALPHA)
|
|
572
|
+
|
|
573
|
+
/* CHAR */
|
|
574
|
+
this.rules[14].opcodes = [];
|
|
575
|
+
this.rules[14].opcodes[0] = {
|
|
576
|
+
type: 1,
|
|
577
|
+
children: [1, 2]
|
|
578
|
+
}; // ALT
|
|
579
|
+
this.rules[14].opcodes[1] = {
|
|
580
|
+
type: 4,
|
|
581
|
+
index: 16
|
|
582
|
+
}; // RNM(unescape)
|
|
583
|
+
this.rules[14].opcodes[2] = {
|
|
584
|
+
type: 2,
|
|
585
|
+
children: [3, 4]
|
|
586
|
+
}; // CAT
|
|
587
|
+
this.rules[14].opcodes[3] = {
|
|
588
|
+
type: 4,
|
|
589
|
+
index: 15
|
|
590
|
+
}; // RNM(escape)
|
|
591
|
+
this.rules[14].opcodes[4] = {
|
|
592
|
+
type: 1,
|
|
593
|
+
children: [5, 6, 7, 8, 9, 10, 11, 12, 13]
|
|
594
|
+
}; // ALT
|
|
595
|
+
this.rules[14].opcodes[5] = {
|
|
596
|
+
type: 6,
|
|
597
|
+
string: [34]
|
|
598
|
+
}; // TBS
|
|
599
|
+
this.rules[14].opcodes[6] = {
|
|
600
|
+
type: 6,
|
|
601
|
+
string: [92]
|
|
602
|
+
}; // TBS
|
|
603
|
+
this.rules[14].opcodes[7] = {
|
|
604
|
+
type: 6,
|
|
605
|
+
string: [47]
|
|
606
|
+
}; // TBS
|
|
607
|
+
this.rules[14].opcodes[8] = {
|
|
608
|
+
type: 6,
|
|
609
|
+
string: [98]
|
|
610
|
+
}; // TBS
|
|
611
|
+
this.rules[14].opcodes[9] = {
|
|
612
|
+
type: 6,
|
|
613
|
+
string: [102]
|
|
614
|
+
}; // TBS
|
|
615
|
+
this.rules[14].opcodes[10] = {
|
|
616
|
+
type: 6,
|
|
617
|
+
string: [110]
|
|
618
|
+
}; // TBS
|
|
619
|
+
this.rules[14].opcodes[11] = {
|
|
620
|
+
type: 6,
|
|
621
|
+
string: [114]
|
|
622
|
+
}; // TBS
|
|
623
|
+
this.rules[14].opcodes[12] = {
|
|
624
|
+
type: 6,
|
|
625
|
+
string: [116]
|
|
626
|
+
}; // TBS
|
|
627
|
+
this.rules[14].opcodes[13] = {
|
|
628
|
+
type: 2,
|
|
629
|
+
children: [14, 15]
|
|
630
|
+
}; // CAT
|
|
631
|
+
this.rules[14].opcodes[14] = {
|
|
632
|
+
type: 6,
|
|
633
|
+
string: [117]
|
|
634
|
+
}; // TBS
|
|
635
|
+
this.rules[14].opcodes[15] = {
|
|
636
|
+
type: 3,
|
|
637
|
+
min: 4,
|
|
638
|
+
max: 4
|
|
639
|
+
}; // REP
|
|
640
|
+
this.rules[14].opcodes[16] = {
|
|
641
|
+
type: 4,
|
|
642
|
+
index: 17
|
|
643
|
+
}; // RNM(HEXDIG)
|
|
644
|
+
|
|
645
|
+
/* escape */
|
|
646
|
+
this.rules[15].opcodes = [];
|
|
647
|
+
this.rules[15].opcodes[0] = {
|
|
648
|
+
type: 6,
|
|
649
|
+
string: [92]
|
|
650
|
+
}; // TBS
|
|
651
|
+
|
|
652
|
+
/* unescape */
|
|
653
|
+
this.rules[16].opcodes = [];
|
|
654
|
+
this.rules[16].opcodes[0] = {
|
|
655
|
+
type: 1,
|
|
656
|
+
children: [1, 2, 3]
|
|
657
|
+
}; // ALT
|
|
658
|
+
this.rules[16].opcodes[1] = {
|
|
659
|
+
type: 5,
|
|
660
|
+
min: 32,
|
|
661
|
+
max: 33
|
|
662
|
+
}; // TRG
|
|
663
|
+
this.rules[16].opcodes[2] = {
|
|
664
|
+
type: 5,
|
|
665
|
+
min: 35,
|
|
666
|
+
max: 91
|
|
667
|
+
}; // TRG
|
|
668
|
+
this.rules[16].opcodes[3] = {
|
|
669
|
+
type: 5,
|
|
670
|
+
min: 93,
|
|
671
|
+
max: 1114111
|
|
672
|
+
}; // TRG
|
|
673
|
+
|
|
674
|
+
/* HEXDIG */
|
|
675
|
+
this.rules[17].opcodes = [];
|
|
676
|
+
this.rules[17].opcodes[0] = {
|
|
677
|
+
type: 1,
|
|
678
|
+
children: [1, 2, 3, 4, 5, 6, 7]
|
|
679
|
+
}; // ALT
|
|
680
|
+
this.rules[17].opcodes[1] = {
|
|
681
|
+
type: 4,
|
|
682
|
+
index: 18
|
|
683
|
+
}; // RNM(DIGIT)
|
|
684
|
+
this.rules[17].opcodes[2] = {
|
|
685
|
+
type: 7,
|
|
686
|
+
string: [97]
|
|
687
|
+
}; // TLS
|
|
688
|
+
this.rules[17].opcodes[3] = {
|
|
689
|
+
type: 7,
|
|
690
|
+
string: [98]
|
|
691
|
+
}; // TLS
|
|
692
|
+
this.rules[17].opcodes[4] = {
|
|
693
|
+
type: 7,
|
|
694
|
+
string: [99]
|
|
695
|
+
}; // TLS
|
|
696
|
+
this.rules[17].opcodes[5] = {
|
|
697
|
+
type: 7,
|
|
698
|
+
string: [100]
|
|
699
|
+
}; // TLS
|
|
700
|
+
this.rules[17].opcodes[6] = {
|
|
701
|
+
type: 7,
|
|
702
|
+
string: [101]
|
|
703
|
+
}; // TLS
|
|
704
|
+
this.rules[17].opcodes[7] = {
|
|
705
|
+
type: 7,
|
|
706
|
+
string: [102]
|
|
707
|
+
}; // TLS
|
|
708
|
+
|
|
709
|
+
/* DIGIT */
|
|
710
|
+
this.rules[18].opcodes = [];
|
|
711
|
+
this.rules[18].opcodes[0] = {
|
|
712
|
+
type: 5,
|
|
713
|
+
min: 48,
|
|
714
|
+
max: 57
|
|
715
|
+
}; // TRG
|
|
716
|
+
|
|
717
|
+
/* ALPHA */
|
|
718
|
+
this.rules[19].opcodes = [];
|
|
719
|
+
this.rules[19].opcodes[0] = {
|
|
720
|
+
type: 1,
|
|
721
|
+
children: [1, 2]
|
|
722
|
+
}; // ALT
|
|
723
|
+
this.rules[19].opcodes[1] = {
|
|
724
|
+
type: 5,
|
|
725
|
+
min: 65,
|
|
726
|
+
max: 90
|
|
727
|
+
}; // TRG
|
|
728
|
+
this.rules[19].opcodes[2] = {
|
|
729
|
+
type: 5,
|
|
730
|
+
min: 97,
|
|
731
|
+
max: 122
|
|
732
|
+
}; // TRG
|
|
733
|
+
|
|
734
|
+
// The `toString()` function will display the original grammar file(s) that produced these opcodes.
|
|
735
|
+
this.toString = function toString() {
|
|
736
|
+
let str = "";
|
|
737
|
+
str += "; Arazzo runtime expression ABNF syntax\n";
|
|
738
|
+
str += "expression = ( \"$url\" / \"$method\" / \"$statusCode\" / \"$request.\" source / \"$response.\" source / \"$inputs.\" name / \"$outputs.\" name / \"$steps.\" name / \"$workflows.\" name / \"$sourceDescriptions.\" name / \"$components.\" name / \"$components.parameters.\" parameter-name)\n";
|
|
739
|
+
str += "parameter-name = name ; Reuses 'name' rule for parameter names\n";
|
|
740
|
+
str += "source = ( header-reference / query-reference / path-reference / body-reference )\n";
|
|
741
|
+
str += "header-reference = \"header.\" token\n";
|
|
742
|
+
str += "query-reference = \"query.\" name\n";
|
|
743
|
+
str += "path-reference = \"path.\" name\n";
|
|
744
|
+
str += "body-reference = \"body\" [\"#\" json-pointer ]\n";
|
|
745
|
+
str += "\n";
|
|
746
|
+
str += "; https://datatracker.ietf.org/doc/html/rfc6901#section-3\n";
|
|
747
|
+
str += "json-pointer = *( \"/\" reference-token )\n";
|
|
748
|
+
str += "reference-token = *( unescaped / escaped )\n";
|
|
749
|
+
str += "unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n";
|
|
750
|
+
str += " ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n";
|
|
751
|
+
str += "escaped = \"~\" ( \"0\" / \"1\" )\n";
|
|
752
|
+
str += " ; representing '~' and '/', respectively\n";
|
|
753
|
+
str += "name = *( CHAR )\n";
|
|
754
|
+
str += "token = 1*tchar\n";
|
|
755
|
+
str += "tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\" / \"+\" / \"-\" / \".\"\n";
|
|
756
|
+
str += " / \"^\" /\"_\" / \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n";
|
|
757
|
+
str += "\n";
|
|
758
|
+
str += "; https://www.rfc-editor.org/rfc/rfc7159#section-7\n";
|
|
759
|
+
str += "CHAR = unescape /\n";
|
|
760
|
+
str += " escape (\n";
|
|
761
|
+
str += " %x22 / ; \" quotation mark U+0022\n";
|
|
762
|
+
str += " %x5C / ; \\ reverse solidus U+005C\n";
|
|
763
|
+
str += " %x2F / ; / solidus U+002F\n";
|
|
764
|
+
str += " %x62 / ; b backspace U+0008\n";
|
|
765
|
+
str += " %x66 / ; f form feed U+000C\n";
|
|
766
|
+
str += " %x6E / ; n line feed U+000A\n";
|
|
767
|
+
str += " %x72 / ; r carriage return U+000D\n";
|
|
768
|
+
str += " %x74 / ; t tab U+0009\n";
|
|
769
|
+
str += " %x75 4HEXDIG ) ; uXXXX U+XXXX\n";
|
|
770
|
+
str += "escape = %x5C ; \\\n";
|
|
771
|
+
str += "unescape = %x20-21 / %x23-5B / %x5D-10FFFF\n";
|
|
772
|
+
str += "\n";
|
|
773
|
+
str += "; https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1\n";
|
|
774
|
+
str += "HEXDIG = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\n";
|
|
775
|
+
str += "DIGIT = %x30-39 ; 0-9\n";
|
|
776
|
+
str += "ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n";
|
|
777
|
+
return str;
|
|
778
|
+
};
|
|
779
|
+
}
|