Tree-sitter syntax parsing library bindings for the Qore Programming Language.
This module provides bindings to the tree-sitter parsing library, enabling fast, incremental syntax parsing for multiple programming languages.
- Python
- Java
- JSON
- YAML
- JavaScript
- Kotlin
- TypeScript
- TSX
- Qore
- Incremental parsing: Efficiently re-parse after edits
- Tree cursors: Memory-efficient tree traversal
- Query API: Pattern matching for syntax highlighting and code analysis
- Thread-safe: All classes are thread-safe
- Grammar parity: The bundled Qore grammar is intended to mirror the Qore parser to support language servers
mkdir build && cd build
cmake ..
make
make install- Qore 1.0+
- CMake 3.15+
- C++17 compiler
%requires treesitter
# Parse Python code
TreeSitterParser parser("python");
TreeSitterTree tree = parser.parse("def hello(): pass");
TreeSitterNode root = tree.getRootNode();
printf("Root type: %s\n", root.getType());
printf("S-expression: %s\n", root.toSexp());
# Parse Qore code
TreeSitterParser qoreParser("qore");
TreeSitterTree qoreTree = qoreParser.parse("class Test { constructor() {} }");
printf("Qore root: %s\n", qoreTree.getRootNode().getType());
- TreeSitterParser: Parse source code into syntax trees
- TreeSitterTree: Represents a parsed syntax tree
- TreeSitterNode: A node in the syntax tree
- TreeSitterCursor: Efficient tree traversal cursor
- TreeSitterQuery: Pattern matching on syntax trees
LGPL 2.1 or MIT - see LICENSE for details.