tree-sitter-scpi 0.1.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.
@@ -0,0 +1,505 @@
1
+ {
2
+ "name": "scpi",
3
+ "rules": {
4
+ "scpi_command": {
5
+ "type": "REPEAT",
6
+ "content": {
7
+ "type": "SYMBOL",
8
+ "name": "_statement"
9
+ }
10
+ },
11
+ "_statement": {
12
+ "type": "SEQ",
13
+ "members": [
14
+ {
15
+ "type": "CHOICE",
16
+ "members": [
17
+ {
18
+ "type": "SYMBOL",
19
+ "name": "program_message"
20
+ },
21
+ {
22
+ "type": "BLANK"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "type": "SYMBOL",
28
+ "name": "_terminator"
29
+ }
30
+ ]
31
+ },
32
+ "_terminator": {
33
+ "type": "PATTERN",
34
+ "value": "[\\r\\n]+"
35
+ },
36
+ "program_message": {
37
+ "type": "SEQ",
38
+ "members": [
39
+ {
40
+ "type": "SYMBOL",
41
+ "name": "_program_message_unit"
42
+ },
43
+ {
44
+ "type": "REPEAT",
45
+ "content": {
46
+ "type": "SEQ",
47
+ "members": [
48
+ {
49
+ "type": "STRING",
50
+ "value": ";"
51
+ },
52
+ {
53
+ "type": "SYMBOL",
54
+ "name": "_program_message_unit"
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ "_program_message_unit": {
62
+ "type": "SEQ",
63
+ "members": [
64
+ {
65
+ "type": "CHOICE",
66
+ "members": [
67
+ {
68
+ "type": "SYMBOL",
69
+ "name": "command_header"
70
+ },
71
+ {
72
+ "type": "SYMBOL",
73
+ "name": "common_command_header"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "type": "CHOICE",
79
+ "members": [
80
+ {
81
+ "type": "SEQ",
82
+ "members": [
83
+ {
84
+ "type": "ALIAS",
85
+ "content": {
86
+ "type": "SYMBOL",
87
+ "name": "_separator"
88
+ },
89
+ "named": false,
90
+ "value": "separator"
91
+ },
92
+ {
93
+ "type": "SYMBOL",
94
+ "name": "parameter_list"
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "type": "BLANK"
100
+ }
101
+ ]
102
+ }
103
+ ]
104
+ },
105
+ "command_header": {
106
+ "type": "SEQ",
107
+ "members": [
108
+ {
109
+ "type": "CHOICE",
110
+ "members": [
111
+ {
112
+ "type": "STRING",
113
+ "value": ":"
114
+ },
115
+ {
116
+ "type": "BLANK"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "type": "SYMBOL",
122
+ "name": "mnemonic"
123
+ },
124
+ {
125
+ "type": "REPEAT",
126
+ "content": {
127
+ "type": "SEQ",
128
+ "members": [
129
+ {
130
+ "type": "STRING",
131
+ "value": ":"
132
+ },
133
+ {
134
+ "type": "SYMBOL",
135
+ "name": "mnemonic"
136
+ }
137
+ ]
138
+ }
139
+ },
140
+ {
141
+ "type": "CHOICE",
142
+ "members": [
143
+ {
144
+ "type": "STRING",
145
+ "value": "?"
146
+ },
147
+ {
148
+ "type": "BLANK"
149
+ }
150
+ ]
151
+ }
152
+ ]
153
+ },
154
+ "common_command_header": {
155
+ "type": "SEQ",
156
+ "members": [
157
+ {
158
+ "type": "STRING",
159
+ "value": "*"
160
+ },
161
+ {
162
+ "type": "SYMBOL",
163
+ "name": "mnemonic"
164
+ },
165
+ {
166
+ "type": "CHOICE",
167
+ "members": [
168
+ {
169
+ "type": "STRING",
170
+ "value": "?"
171
+ },
172
+ {
173
+ "type": "BLANK"
174
+ }
175
+ ]
176
+ }
177
+ ]
178
+ },
179
+ "mnemonic": {
180
+ "type": "PATTERN",
181
+ "value": "[a-zA-Z][a-zA-Z0-9_]*"
182
+ },
183
+ "parameter_list": {
184
+ "type": "SEQ",
185
+ "members": [
186
+ {
187
+ "type": "SYMBOL",
188
+ "name": "_parameter"
189
+ },
190
+ {
191
+ "type": "REPEAT",
192
+ "content": {
193
+ "type": "SEQ",
194
+ "members": [
195
+ {
196
+ "type": "STRING",
197
+ "value": ","
198
+ },
199
+ {
200
+ "type": "SYMBOL",
201
+ "name": "_parameter"
202
+ }
203
+ ]
204
+ }
205
+ }
206
+ ]
207
+ },
208
+ "_parameter": {
209
+ "type": "CHOICE",
210
+ "members": [
211
+ {
212
+ "type": "SYMBOL",
213
+ "name": "_numeric_entry"
214
+ },
215
+ {
216
+ "type": "SYMBOL",
217
+ "name": "string_literal"
218
+ },
219
+ {
220
+ "type": "SYMBOL",
221
+ "name": "boolean_literal"
222
+ },
223
+ {
224
+ "type": "SYMBOL",
225
+ "name": "character_data"
226
+ },
227
+ {
228
+ "type": "SYMBOL",
229
+ "name": "channel_list"
230
+ }
231
+ ]
232
+ },
233
+ "_numeric_entry": {
234
+ "type": "SEQ",
235
+ "members": [
236
+ {
237
+ "type": "SYMBOL",
238
+ "name": "numeric_literal"
239
+ },
240
+ {
241
+ "type": "CHOICE",
242
+ "members": [
243
+ {
244
+ "type": "SYMBOL",
245
+ "name": "suffix"
246
+ },
247
+ {
248
+ "type": "BLANK"
249
+ }
250
+ ]
251
+ }
252
+ ]
253
+ },
254
+ "suffix": {
255
+ "type": "PATTERN",
256
+ "value": "[a-zA-Z]+(\\/[a-zA-Z]+)*"
257
+ },
258
+ "channel_list": {
259
+ "type": "SEQ",
260
+ "members": [
261
+ {
262
+ "type": "STRING",
263
+ "value": "(@"
264
+ },
265
+ {
266
+ "type": "SYMBOL",
267
+ "name": "_channel_spec_list"
268
+ },
269
+ {
270
+ "type": "STRING",
271
+ "value": ")"
272
+ }
273
+ ]
274
+ },
275
+ "_channel_spec_list": {
276
+ "type": "SEQ",
277
+ "members": [
278
+ {
279
+ "type": "SYMBOL",
280
+ "name": "_channel_item"
281
+ },
282
+ {
283
+ "type": "REPEAT",
284
+ "content": {
285
+ "type": "SEQ",
286
+ "members": [
287
+ {
288
+ "type": "STRING",
289
+ "value": ","
290
+ },
291
+ {
292
+ "type": "SYMBOL",
293
+ "name": "_channel_item"
294
+ }
295
+ ]
296
+ }
297
+ }
298
+ ]
299
+ },
300
+ "_channel_item": {
301
+ "type": "CHOICE",
302
+ "members": [
303
+ {
304
+ "type": "SYMBOL",
305
+ "name": "channel_range"
306
+ },
307
+ {
308
+ "type": "SYMBOL",
309
+ "name": "channel_spec"
310
+ }
311
+ ]
312
+ },
313
+ "channel_range": {
314
+ "type": "SEQ",
315
+ "members": [
316
+ {
317
+ "type": "SYMBOL",
318
+ "name": "channel_spec"
319
+ },
320
+ {
321
+ "type": "STRING",
322
+ "value": ":"
323
+ },
324
+ {
325
+ "type": "SYMBOL",
326
+ "name": "channel_spec"
327
+ }
328
+ ]
329
+ },
330
+ "channel_spec": {
331
+ "type": "SEQ",
332
+ "members": [
333
+ {
334
+ "type": "SYMBOL",
335
+ "name": "integer"
336
+ },
337
+ {
338
+ "type": "REPEAT",
339
+ "content": {
340
+ "type": "SEQ",
341
+ "members": [
342
+ {
343
+ "type": "STRING",
344
+ "value": "!"
345
+ },
346
+ {
347
+ "type": "SYMBOL",
348
+ "name": "integer"
349
+ }
350
+ ]
351
+ }
352
+ }
353
+ ]
354
+ },
355
+ "integer": {
356
+ "type": "PATTERN",
357
+ "value": "\\d+"
358
+ },
359
+ "numeric_literal": {
360
+ "type": "TOKEN",
361
+ "content": {
362
+ "type": "CHOICE",
363
+ "members": [
364
+ {
365
+ "type": "PATTERN",
366
+ "value": "[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?"
367
+ },
368
+ {
369
+ "type": "PATTERN",
370
+ "value": "#H[0-9a-fA-F]+"
371
+ },
372
+ {
373
+ "type": "PATTERN",
374
+ "value": "#Q[0-7]+"
375
+ },
376
+ {
377
+ "type": "PATTERN",
378
+ "value": "#B[01]+"
379
+ }
380
+ ]
381
+ }
382
+ },
383
+ "string_literal": {
384
+ "type": "CHOICE",
385
+ "members": [
386
+ {
387
+ "type": "SEQ",
388
+ "members": [
389
+ {
390
+ "type": "STRING",
391
+ "value": "\""
392
+ },
393
+ {
394
+ "type": "REPEAT",
395
+ "content": {
396
+ "type": "CHOICE",
397
+ "members": [
398
+ {
399
+ "type": "PATTERN",
400
+ "value": "[^\"\\n]"
401
+ },
402
+ {
403
+ "type": "STRING",
404
+ "value": "\"\""
405
+ }
406
+ ]
407
+ }
408
+ },
409
+ {
410
+ "type": "STRING",
411
+ "value": "\""
412
+ }
413
+ ]
414
+ },
415
+ {
416
+ "type": "SEQ",
417
+ "members": [
418
+ {
419
+ "type": "STRING",
420
+ "value": "'"
421
+ },
422
+ {
423
+ "type": "REPEAT",
424
+ "content": {
425
+ "type": "CHOICE",
426
+ "members": [
427
+ {
428
+ "type": "PATTERN",
429
+ "value": "[^'\\n]"
430
+ },
431
+ {
432
+ "type": "STRING",
433
+ "value": "''"
434
+ }
435
+ ]
436
+ }
437
+ },
438
+ {
439
+ "type": "STRING",
440
+ "value": "'"
441
+ }
442
+ ]
443
+ }
444
+ ]
445
+ },
446
+ "boolean_literal": {
447
+ "type": "CHOICE",
448
+ "members": [
449
+ {
450
+ "type": "STRING",
451
+ "value": "ON"
452
+ },
453
+ {
454
+ "type": "STRING",
455
+ "value": "OFF"
456
+ }
457
+ ]
458
+ },
459
+ "character_data": {
460
+ "type": "PATTERN",
461
+ "value": "[a-zA-Z][a-zA-Z0-9_]*"
462
+ },
463
+ "comment": {
464
+ "type": "TOKEN",
465
+ "content": {
466
+ "type": "SEQ",
467
+ "members": [
468
+ {
469
+ "type": "STRING",
470
+ "value": "//"
471
+ },
472
+ {
473
+ "type": "PATTERN",
474
+ "value": ".*"
475
+ }
476
+ ]
477
+ }
478
+ },
479
+ "_separator": {
480
+ "type": "PATTERN",
481
+ "value": "[ \\t]+"
482
+ }
483
+ },
484
+ "extras": [
485
+ {
486
+ "type": "PATTERN",
487
+ "value": "[ \\t]"
488
+ },
489
+ {
490
+ "type": "SYMBOL",
491
+ "name": "comment"
492
+ }
493
+ ],
494
+ "conflicts": [
495
+ [
496
+ "boolean_literal",
497
+ "character_data"
498
+ ]
499
+ ],
500
+ "precedences": [],
501
+ "externals": [],
502
+ "inline": [],
503
+ "supertypes": []
504
+ }
505
+