Skip to content

Commit

Permalink
chore: generate
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Nov 19, 2023
1 parent 00231ab commit a043e58
Show file tree
Hide file tree
Showing 3 changed files with 1,364 additions and 921 deletions.
113 changes: 99 additions & 14 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
{
"type": "SYMBOL",
"name": "source_location"
},
{
"type": "STRING",
"value": "..."
}
]
},
Expand Down Expand Up @@ -193,6 +197,10 @@
"type": "SYMBOL",
"name": "_whitespace_no_newline"
},
{
"type": "SYMBOL",
"name": "raw_data"
},
{
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -275,7 +283,7 @@
},
"instruction": {
"type": "PATTERN",
"value": "[^\\n#<]+"
"value": "([^\\n#;<]|#-?\\d+)+"
},
"bad_instruction": {
"type": "STRING",
Expand All @@ -285,8 +293,17 @@
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "#"
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "#"
},
{
"type": "STRING",
"value": ";"
}
]
},
{
"type": "CHOICE",
Expand All @@ -304,25 +321,89 @@
]
},
"_comment_with_label": {
"type": "SEQ",
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "address"
},
{
"type": "SYMBOL",
"name": "code_location"
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[^\\d,][^,]+"
},
"named": true,
"value": "instruction"
},
{
"type": "STRING",
"value": ","
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "address"
},
{
"type": "SYMBOL",
"name": "code_location"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "file_offset"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "CHOICE",
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "file_offset"
"name": "address"
},
{
"type": "BLANK"
"type": "SYMBOL",
"name": "code_location"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "file_offset"
},
{
"type": "BLANK"
}
]
}
]
}
Expand Down Expand Up @@ -399,7 +480,7 @@
},
"byte": {
"type": "PATTERN",
"value": "[0-9a-fA-F]{2}"
"value": "[0-9a-fA-F]{2}|[0-9a-fA-F]{4}|[0-9a-fA-F]{8}"
},
"machine_code_bytes": {
"type": "SEQ",
Expand Down Expand Up @@ -515,6 +596,10 @@
"type": "SYMBOL",
"name": "code_identifier"
},
{
"type": "SYMBOL",
"name": "raw_data"
},
{
"type": "SYMBOL",
"name": "_whitespace_no_newline"
Expand Down
24 changes: 24 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
{
"type": "hexadecimal",
"named": true
},
{
"type": "instruction",
"named": true
}
]
}
Expand Down Expand Up @@ -209,6 +213,10 @@
{
"type": "machine_code_bytes",
"named": true
},
{
"type": "raw_data",
"named": true
}
]
}
Expand Down Expand Up @@ -291,10 +299,22 @@
"type": "+",
"named": false
},
{
"type": ",",
"named": false
},
{
"type": "...",
"named": false
},
{
"type": ":",
"named": false
},
{
"type": ";",
"named": false
},
{
"type": "<",
"named": false
Expand Down Expand Up @@ -363,6 +383,10 @@
"type": "label",
"named": true
},
{
"type": "raw_data",
"named": true
},
{
"type": "section_address",
"named": true
Expand Down
Loading

0 comments on commit a043e58

Please sign in to comment.