How codeant-ai/tree-sitter-plsql works
Project type and purpose
• This is an open-source grammar and parser binding project for PL/SQL, built on top of the Tree-Sitter parsing framework.
• It provides:
• A language grammar definition (grammar.js + JSON)
• A generated C parser (src/parser.c, src/tree_sitter/parser.h)
• Bindings for Node.js (bindings/node) and Rust (bindings/rust)
• Examples and a corpus for testing and demonstration
File structure
Top-level artifacts:
• binding.gyp, package.json – Node.js build configuration
• Cargo.toml – Rust crate configuration
• grammar.js, src/grammar.json, src/node-types.json – grammar definitions
• src/parser.c + src/tree_sitter/parser.h – generated C parser code
• bindings/node/ – Node.js integration: binding.cc, index.js
• bindings/rust/ – Rust integration: build.rs, lib.rs
• corpus/ + examples/ – test inputs and usage samples
Architectural patterns:
• Code generation pipeline: grammar → JSON → C parser
• Multi-language bindings (polyglot library design)
• Separation of “core parser” and “language-specific bindings”
Key insights from the README
• Project goal: syntax highlighting and parsing of Oracle PL/SQL in editors (e.g., Neovim)
• Status: under active development; supports major DDL/DML statements
• Dependencies: Tree-Sitter core, Node.js, Rust toolchain