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