tree-sitter-merlin6502

Crates.iotree-sitter-merlin6502
lib.rstree-sitter-merlin6502
version2.2.0
sourcesrc
created_at2022-10-30 14:36:42.565367
updated_at2024-04-21 13:40:36.054969
descriptionmerlin6502 grammar for the tree-sitter parsing library
homepagehttps://github.com/dfgordon/tree-sitter-merlin6502
repositoryhttps://github.com/dfgordon/tree-sitter-merlin6502
max_upload_size
id701486
size1,848,220
(dfgordon)

documentation

README

Parser for Merlin 6502 Assembly

This is the rust binding for tree-sitter-merlin6502. To use the parser, include the following in your package's Cargo.toml:

[dependencies]
tree-sitter = "0.22.4"
tree-sitter-merlin6502 = "2.2.0"

Here is a trivial main.rs example:

use tree_sitter;
use tree_sitter_merlin6502;

fn main() {
    let code = " LDA #$00\n";
    let mut parser = tree_sitter::Parser::new();
    parser.set_language(&tree_sitter_merlin6502::language())
      .expect("Error loading Merlin 6502 grammar");
    let tree = parser.parse(code,None).unwrap();

    println!("{}",tree.root_node().to_sexp());
}

This should print the syntax tree

(source_file (operation (op_lda) (arg_lda (imm (imm_prefix) (num (hex))))))

For more on parsing with rust, see the general guidance here.

Commit count: 18

cargo fmt