Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tobiasvl/tree-sitter-rgbasm
:deciduous_tree: RGBASM grammar for tree-sitter
https://github.com/tobiasvl/tree-sitter-rgbasm
gameboy gbz80 parser rgbds tree-sitter
Last synced: 26 days ago
JSON representation
:deciduous_tree: RGBASM grammar for tree-sitter
- Host: GitHub
- URL: https://github.com/tobiasvl/tree-sitter-rgbasm
- Owner: tobiasvl
- Archived: true
- Created: 2018-08-30T21:55:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-10T11:53:13.000Z (over 6 years ago)
- Last Synced: 2024-08-03T14:05:32.315Z (4 months ago)
- Topics: gameboy, gbz80, parser, rgbds, tree-sitter
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-tree-sitter - RGBASM
README
# tree-sitter-rgbasm
[RGBASM](https://rednex.github.io/rgbds/rgbasm.5.html) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
## RGBASM
RGBASM is the assembler dialect used for programming Game Boy games with the [Rednex Game Boy Development System](https://github.com/rednex/rgbds) (RGBDS).
This is sometimes erroneously referred to as "Z80 assembler"; although the Game Boy's CPU is similar to Z80 and 8080, it's distinct from them, and using Z80 grammars isn't ideal, especially when using RGBASM features.
### Language references
* [RGBASM language description](https://rednex.github.io/rgbds/rgbasm.5.html)
* [RGBDS Game Boy CPU opcode reference](https://rednex.github.io/rgbds/gbz80.7.html)
* [Atom RGBASM language package](https://github.com/tobiasvl/language-rgbasm) (which will use this grammar when ready)## Build
PATH=$PATH:./node_modules/.bin
install -g node-gyp
tree-sitter generate
npm install
node-gyp buildOr something. Read [tree-sitter's documentation](http://tree-sitter.github.io/tree-sitter/creating-parsers#installing-the-tools).
## Test
This is a work in progress. Currently, many tests fail while I'm reworking the grammar to complete it.
To run the entire test suite:
tree-sitter test
To run just a single test file, located in the `corpus/` directory, use `-f`. For example, to test comment parsing:
tree-sitter test -f 'Comments'