{"id":28266916,"url":"https://github.com/bonede/tree-sitter-ng","last_synced_at":"2026-02-01T03:02:28.845Z","repository":{"id":215193204,"uuid":"738341453","full_name":"bonede/tree-sitter-ng","owner":"bonede","description":"Next generation Tree Sitter Java binding.","archived":false,"fork":false,"pushed_at":"2026-01-31T08:52:05.000Z","size":147035,"stargazers_count":130,"open_issues_count":30,"forks_count":27,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T21:40:11.065Z","etag":null,"topics":["java","jni","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bonede.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-03T02:20:44.000Z","updated_at":"2026-01-31T08:52:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"6569a0a0-48ee-490b-8bfa-eeb02edee726","html_url":"https://github.com/bonede/tree-sitter-ng","commit_stats":null,"previous_names":["bonede/tree-sitter-ng"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/bonede/tree-sitter-ng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonede%2Ftree-sitter-ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonede%2Ftree-sitter-ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonede%2Ftree-sitter-ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonede%2Ftree-sitter-ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bonede","download_url":"https://codeload.github.com/bonede/tree-sitter-ng/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonede%2Ftree-sitter-ng/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jni","tree-sitter"],"created_at":"2025-05-20T15:05:22.530Z","updated_at":"2026-02-01T03:02:28.840Z","avatar_url":"https://github.com/bonede.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree Sitter NG\nNext generation Tree Sitter Java binding.\n\n[![Maven Central](https://img.shields.io/github/actions/workflow/status/bonede/tree-sitter-ng/main.yml)](https://github.com/bonede/tree-sitter-ng/actions)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter)](https://central.sonatype.com/artifact/io.github.bonede/tree-sitter)\n\n# Getting started\nAdd dependencies to your `build.gradle` or `pom.xml`.\n\n```groovy\n// Gradle\ndependencies {\n    // add tree sitter\n    implementation 'io.github.bonede:tree-sitter:0.25.3'\n    // add json parser\n    implementation 'io.github.bonede:tree-sitter-json:0.24.8'\n}\n```\n\n```xml\n\u003c!-- Maven --\u003e\n\u003cdpendencies\u003e\n    \u003c!-- add tree sitter --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.github.bonede\u003c/groupId\u003e\n        \u003cartifactId\u003etree-sitter\u003c/artifactId\u003e\n        \u003cversion\u003e0.25.3\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003c!-- add json parser --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.github.bonede\u003c/groupId\u003e\n        \u003cartifactId\u003etree-sitter-json\u003c/artifactId\u003e\n        \u003cversion\u003e0.24.8\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dpendencies\u003e\n```\nStart hacking!\n```java\n// imports are omitted\nclass Main {\n    public static void main(String[] args) {\n        TSParser parser = new TSParser();\n        TSLanguage json = new TreeSitterJson();\n        parser.setLanguage(json);\n        TSTree tree = parser.parseString(null, \"[1, null]\");\n        TSNode rootNode = tree.getRootNode();\n        TSNode arrayNode = rootNode.getNamedChild(0);\n        TSNode numberNode = arrayNode.getNamedChild(0);\n    }\n}\n```\n\n# Features\n- 100% [Tree Sitter API](https://github.com/tree-sitter/tree-sitter/blob/master/lib/include/tree_sitter/api.h) coverage.\n- Easy to bootstrap cross compiling environments powered by [Zig](https://ziglang.org/).\n- Include only parsers you need in your project.\n\n# Supported CPUs and OSes\n- x86_64-windows\n- x86_64-macos\n- aarch64-macos\n- x86_64-linux\n- aarch64-linux\n\n# Supported parsers\n| Name                            | Version                                                                                                 |\n|---------------------------------|---------------------------------------------------------------------------------------------------------|\n| `tree-sitter-ada`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-ada)               |\n| `tree-sitter-agda`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-agda)              |\n| `tree-sitter-apex`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-apex)              |\n| `tree-sitter-bash`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-bash)              |\n| `tree-sitter-beancount`         | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-beancount)         |\n| `tree-sitter-c`                 | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-c)                 |\n| `tree-sitter-c-sharp`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-c-sharp)           |\n| `tree-sitter-capnp`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-capnp)             |\n| `tree-sitter-clojure`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-clojure)           |\n| `tree-sitter-cmake`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-cmake)             |\n| `tree-sitter-comment`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-comment)           |\n| `tree-sitter-commonlisp`        | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-commonlisp)        |\n| `tree-sitter-cpp`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-cpp)               |\n| `tree-sitter-css`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-css)               |\n| `tree-sitter-cuda`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-cuda)              |\n| `tree-sitter-d`                 | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-d)                 |\n| `tree-sitter-dart`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-dart)              |\n| `tree-sitter-dockerfile`        | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-dockerfile)        |\n| `tree-sitter-dot`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-dot)               |\n| `tree-sitter-elisp`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-elisp)             |\n| `tree-sitter-elixir`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-elixir)            |\n| `tree-sitter-elm`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-elm)               |\n| `tree-sitter-embedded-template` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-embedded-template) |\n| `tree-sitter-eno`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-eno)               |\n| `tree-sitter-erlang`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-erlang)            |\n| `tree-sitter-fennel`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-fennel)            |\n| `tree-sitter-fish`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-fish)              |\n| `tree-sitter-formula`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-formula)           |\n| `tree-sitter-fortran`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-fortran)           |\n| `tree-sitter-gitattributes`     | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-gitattributes)     |\n| `tree-sitter-gitignore`         | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-gitignore)         |\n| `tree-sitter-gleam`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-gleam)             |\n| `tree-sitter-glsl`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-glsl)              |\n| `tree-sitter-go`                | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-go)                |\n| `tree-sitter-go-mod`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-go-mod)            |\n| `tree-sitter-go-work`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-go-work)           |\n| `tree-sitter-graphql`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-graphql)           |\n| `tree-sitter-hack`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-hack)              |\n| `tree-sitter-haskell`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-haskell)           |\n| `tree-sitter-hcl`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-hcl)               |\n| `tree-sitter-hocon`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-hocon)             |\n| `tree-sitter-html`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-html)              |\n| `tree-sitter-java`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-java)              |\n| `tree-sitter-javascript`        | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-javascript)        |\n| `tree-sitter-jq`                | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-jq)                |\n| `tree-sitter-json`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-json)              |\n| `tree-sitter-json5`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-json5)             |\n| `tree-sitter-julia`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-julia)             |\n| `tree-sitter-kotlin`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-kotlin)            |\n| `tree-sitter-lalrpop`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-lalrpop)           |\n| `tree-sitter-latex`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-latex)             |\n| `tree-sitter-lean`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-lean)              |\n| `tree-sitter-llvm`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-llvm)              |\n| `tree-sitter-llvm-mir`          | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-llvm-mir)          |\n| `tree-sitter-lua`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-lua)               |\n| `tree-sitter-m68k`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-m68k)              |\n| `tree-sitter-make`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-make)              |\n| `tree-sitter-markdown`          | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-markdown)          |\n| `tree-sitter-meson`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-meson)             |\n| `tree-sitter-nix`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-nix)               |\n| `tree-sitter-nginx`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-nginx)             |\n| `tree-sitter-nim`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-nim)               |\n| `tree-sitter-objc`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-objc)              |\n| `tree-sitter-ocaml`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-ocaml)             |\n| `tree-sitter-ohm`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-ohm)               |\n| `tree-sitter-org`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-org)               |\n| `tree-sitter-p4`                | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-p4)                |\n| `tree-sitter-pascal`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-pascal)            |\n| `tree-sitter-perl`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-perl)              |\n| `tree-sitter-pgn`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-pgn)               |\n| `tree-sitter-php`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-php)               |\n| `tree-sitter-pod`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-pod)               |\n| `tree-sitter-proto`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-proto)             |\n| `tree-sitter-python`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-python)            |\n| `tree-sitter-qmljs`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-qmljs)             |\n| `tree-sitter-query`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-query)             |\n| `tree-sitter-r`                 | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-r)                 |\n| `tree-sitter-racket`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-racket)            |\n| `tree-sitter-rasi`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-rasi)              |\n| `tree-sitter-re2c`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-re2c)              |\n| `tree-sitter-regex`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-regex)             |\n| `tree-sitter-rego`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-rego)              |\n| `tree-sitter-rst`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-rst)               |\n| `tree-sitter-ruby`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-ruby)              |\n| `tree-sitter-rust`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-rust)              |\n| `tree-sitter-tact`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-tact)              |\n| `tree-sitter-scala`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-scala)             |\n| `tree-sitter-scheme`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-scheme)            |\n| `tree-sitter-scss`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-scss)              |\n| `tree-sitter-sexp`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sexp)              |\n| `tree-sitter-smali`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-smali)             |\n| `tree-sitter-sourcepawn`        | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sourcepawn)        |\n| `tree-sitter-sparql`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sparql)            |\n| `tree-sitter-sql`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sql)               |\n| `tree-sitter-sql-bigquery`      | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sql-bigquery)      |\n| `tree-sitter-sqlite`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-sqlite)            |\n| `tree-sitter-ssh-client-config` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-ssh-client-config) |\n| `tree-sitter-svelte`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-svelte)            |\n| `tree-sitter-swift`             | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-swift)             |\n| `tree-sitter-tablegen`          | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-tablegen)          |\n| `tree-sitter-thrift`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-thrift)            |\n| `tree-sitter-toml`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-toml)              |\n| `tree-sitter-turtle`            | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-turtle)            |\n| `tree-sitter-twig`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-twig)              |\n| `tree-sitter-typescript`        | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-typescript)        |\n| `tree-sitter-verilog`           | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-verilog)           |\n| `tree-sitter-vhdl`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-vhdl)              |\n| `tree-sitter-vue`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-vue)               |\n| `tree-sitter-wast`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-wast)              |\n| `tree-sitter-wat`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-wat)               |\n| `tree-sitter-wgsl`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-wgsl)              |\n| `tree-sitter-yaml`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-yaml)              |\n| `tree-sitter-yang`              | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-yang)              |\n| `tree-sitter-zig`               | ![Maven Central](https://img.shields.io/maven-central/v/io.github.bonede/tree-sitter-zig)               |\n\n# API Tour\n```java\n\nclass Main {\n    public static void main(String[] args) {\n        String jsonSource = \"[1, null]\";\n        TSParser parser = new TSParser();\n        TSLanguage json = new TreeSitterJson();\n        // set language parser\n        parser.setLanguage(json);\n        // parser with string input\n        parser.parseString(null, jsonSource);\n        parser.reset();\n        // or parser with encoding\n        parser.parseStringEncoding(null, JSON_SRC, TSInputEncoding.TSInputEncodingUTF8);\n        parser.reset();\n        // or parser with custom reader\n        byte[] buffer = new byte[1024];\n        TSReader reader = (buf, offset, position) -\u003e {\n            if(offset \u003e= jsonSource.length()){\n                return 0;\n            }\n            ByteBuffer charBuffer = ByteBuffer.wrap(buf);\n            charBuffer.put(jsonSource.getBytes());\n            return jsonSource.length();\n        };\n        TSTree tree = parser.parse(buffer, null, reader, TSInputEncoding.TSInputEncodingUTF8);\n        // traverse the AST tree with DOM like APIs\n        TSNode rootNode = tree.getRootNode();\n        TSNode arrayNode = rootNode.getNamedChild(0);\n        // or travers the AST with cursor\n        TSTreeCursor rootCursor = new TSTreeCursor(rootNode);\n        rootCursor.gotoFirstChild();\n        // or query the AST with S-expression\n        TreeSitterQuery query = new TSQuery(json, \"((document) @root)\");\n        TSQueryCursor cursor = new TSQueryCursor();\n        cursor.exec(query, rootNode);\n        SQueryMatch match = new TSQueryMatch();\n        while(cursor.nextMatch(match)){\n            // do something with the match\n        }\n        // debug the parser with a logger\n        TSLogger logger = (type, message) -\u003e {\n            System.out.println(message);\n        };\n        parser.setLogger(logger);\n        // or output the AST tree as DOT graph\n        File dotFile = File.createTempFile(\"json\", \".dot\");\n        parser.printDotGraphs(dotFile);\n    }\n}\n\n```\n\n# How to add new parser\n\nUse generator script to generate a new parser subproject. \nYou can edit the `build.gradle` to customize the native library build process.\n\n```console\n./gradlew gen --parser-name=\u003cparser name\u003e --parser-version=\u003cparser version\u003e --parser-zip=\u003cparer zip download url\u003e\n# build native library\n./gradlew tree-sitter-\u003cparser name\u003e:buildNative\n# run tests\n./gradlew tree-sitter-\u003cparser name\u003e:test\n```\n\n# TODO\n- [ ] Utilize test cases in parser's repository\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonede%2Ftree-sitter-ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonede%2Ftree-sitter-ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonede%2Ftree-sitter-ng/lists"}