Skip to content

Commit a043e58

Browse files
committed
chore: generate
1 parent 00231ab commit a043e58

File tree

3 files changed

+1364
-921
lines changed

3 files changed

+1364
-921
lines changed

src/grammar.json

Lines changed: 99 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
{
3535
"type": "SYMBOL",
3636
"name": "source_location"
37+
},
38+
{
39+
"type": "STRING",
40+
"value": "..."
3741
}
3842
]
3943
},
@@ -193,6 +197,10 @@
193197
"type": "SYMBOL",
194198
"name": "_whitespace_no_newline"
195199
},
200+
{
201+
"type": "SYMBOL",
202+
"name": "raw_data"
203+
},
196204
{
197205
"type": "SEQ",
198206
"members": [
@@ -275,7 +283,7 @@
275283
},
276284
"instruction": {
277285
"type": "PATTERN",
278-
"value": "[^\\n#<]+"
286+
"value": "([^\\n#;<]|#-?\\d+)+"
279287
},
280288
"bad_instruction": {
281289
"type": "STRING",
@@ -285,8 +293,17 @@
285293
"type": "SEQ",
286294
"members": [
287295
{
288-
"type": "STRING",
289-
"value": "#"
296+
"type": "CHOICE",
297+
"members": [
298+
{
299+
"type": "STRING",
300+
"value": "#"
301+
},
302+
{
303+
"type": "STRING",
304+
"value": ";"
305+
}
306+
]
290307
},
291308
{
292309
"type": "CHOICE",
@@ -304,25 +321,89 @@
304321
]
305322
},
306323
"_comment_with_label": {
307-
"type": "SEQ",
324+
"type": "CHOICE",
308325
"members": [
309326
{
310-
"type": "SYMBOL",
311-
"name": "address"
312-
},
313-
{
314-
"type": "SYMBOL",
315-
"name": "code_location"
327+
"type": "SEQ",
328+
"members": [
329+
{
330+
"type": "STRING",
331+
"value": "("
332+
},
333+
{
334+
"type": "CHOICE",
335+
"members": [
336+
{
337+
"type": "SEQ",
338+
"members": [
339+
{
340+
"type": "ALIAS",
341+
"content": {
342+
"type": "PATTERN",
343+
"value": "[^\\d,][^,]+"
344+
},
345+
"named": true,
346+
"value": "instruction"
347+
},
348+
{
349+
"type": "STRING",
350+
"value": ","
351+
}
352+
]
353+
},
354+
{
355+
"type": "BLANK"
356+
}
357+
]
358+
},
359+
{
360+
"type": "SYMBOL",
361+
"name": "address"
362+
},
363+
{
364+
"type": "SYMBOL",
365+
"name": "code_location"
366+
},
367+
{
368+
"type": "CHOICE",
369+
"members": [
370+
{
371+
"type": "SYMBOL",
372+
"name": "file_offset"
373+
},
374+
{
375+
"type": "BLANK"
376+
}
377+
]
378+
},
379+
{
380+
"type": "STRING",
381+
"value": ")"
382+
}
383+
]
316384
},
317385
{
318-
"type": "CHOICE",
386+
"type": "SEQ",
319387
"members": [
320388
{
321389
"type": "SYMBOL",
322-
"name": "file_offset"
390+
"name": "address"
323391
},
324392
{
325-
"type": "BLANK"
393+
"type": "SYMBOL",
394+
"name": "code_location"
395+
},
396+
{
397+
"type": "CHOICE",
398+
"members": [
399+
{
400+
"type": "SYMBOL",
401+
"name": "file_offset"
402+
},
403+
{
404+
"type": "BLANK"
405+
}
406+
]
326407
}
327408
]
328409
}
@@ -399,7 +480,7 @@
399480
},
400481
"byte": {
401482
"type": "PATTERN",
402-
"value": "[0-9a-fA-F]{2}"
483+
"value": "[0-9a-fA-F]{2}|[0-9a-fA-F]{4}|[0-9a-fA-F]{8}"
403484
},
404485
"machine_code_bytes": {
405486
"type": "SEQ",
@@ -515,6 +596,10 @@
515596
"type": "SYMBOL",
516597
"name": "code_identifier"
517598
},
599+
{
600+
"type": "SYMBOL",
601+
"name": "raw_data"
602+
},
518603
{
519604
"type": "SYMBOL",
520605
"name": "_whitespace_no_newline"

src/node-types.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
{
4242
"type": "hexadecimal",
4343
"named": true
44+
},
45+
{
46+
"type": "instruction",
47+
"named": true
4448
}
4549
]
4650
}
@@ -209,6 +213,10 @@
209213
{
210214
"type": "machine_code_bytes",
211215
"named": true
216+
},
217+
{
218+
"type": "raw_data",
219+
"named": true
212220
}
213221
]
214222
}
@@ -291,10 +299,22 @@
291299
"type": "+",
292300
"named": false
293301
},
302+
{
303+
"type": ",",
304+
"named": false
305+
},
306+
{
307+
"type": "...",
308+
"named": false
309+
},
294310
{
295311
"type": ":",
296312
"named": false
297313
},
314+
{
315+
"type": ";",
316+
"named": false
317+
},
298318
{
299319
"type": "<",
300320
"named": false
@@ -363,6 +383,10 @@
363383
"type": "label",
364384
"named": true
365385
},
386+
{
387+
"type": "raw_data",
388+
"named": true
389+
},
366390
{
367391
"type": "section_address",
368392
"named": true

0 commit comments

Comments
 (0)