https://github.com/dfgordon/tree-sitter-merlin6502
Parser for Merlin 6502 assembly language
https://github.com/dfgordon/tree-sitter-merlin6502
Last synced: 6 months ago
JSON representation
Parser for Merlin 6502 assembly language
- Host: GitHub
- URL: https://github.com/dfgordon/tree-sitter-merlin6502
- Owner: dfgordon
- License: mit
- Created: 2022-03-27T20:55:40.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-08-03T20:04:23.000Z (11 months ago)
- Last Synced: 2025-10-20T12:59:03.056Z (8 months ago)
- Language: JavaScript
- Size: 1.25 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: .github/README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Parser for Merlin 6502 Assembly

This is a parser for Merlin assembly language intended for use with language servers. It is built using the [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) system. The native parser is a C library. Bindings are possible for several languages, but only the [rust crate](https://crates.io/crates/tree-sitter-merlin6502) is actively maintained. There is a [node package](https://github.com/dfgordon/tree-sitter-merlin6502/pkgs/npm/tree-sitter-merlin6502) that can be updated upon request.
For details on parser usage and design see the [wiki](https://github.com/dfgordon/tree-sitter-merlin6502/wiki).
## Pre-Build Process
If you are changing the grammar, be aware the file `grammar.js` is actually generated by the metaprogram `opcode_processor.py`. This takes `grammar-src.js`, `opcodes.json`, and `pseudo_opcodes.json` as inputs.
## Build Process
Once you have `grammar.js` you run `tree-sitter generate` to produce `src/parser.c` and, in turn, the bindings for whatever languages are specified in `tree-sitter.json`. If you want to compile a WASM parser you can follow up with `tree-sitter build -w`.
## Build Script
The `build.py` script takes care of all of the above steps, and will also run the tests.
## References
* Merlin 8/16 Manual, copyright 1987, Roger Wagner Publishing, Inc.
* Merlin 16+ Manual, copyright 1988-1989, Roger Wagner Publishing, Inc.
* [Merlin 32 Documentation](https://brutaldeluxe.fr/products/crossdevtools/merlin/)