# tree-sitter/tree-sitter

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tree-sitter-tree-sitter).**

23,848 stars · 2,419 forks · Rust · mit

## Links

- GitHub: https://github.com/tree-sitter/tree-sitter
- Homepage: https://tree-sitter.github.io
- awesome-repositories: https://awesome-repositories.com/repository/tree-sitter-tree-sitter.md

## Topics

`c` `incremental` `parser` `parsing` `rust` `tree-sitter` `wasm`

## Description

Tree-sitter is a parsing system and incremental parsing framework designed to generate high-performance syntax trees from source code. It functions as a language parsing engine that compiles formal grammar definitions into portable code, which can then be integrated into text editors and development tools to facilitate structural analysis, code navigation, and syntax highlighting.

The project distinguishes itself through its ability to maintain valid, usable syntax tree structures even when source code contains syntax errors or incomplete fragments. It utilizes a generalized parsing algorithm to handle ambiguous grammars and employs an incremental update mechanism that re-parses only the modified portions of a file, ensuring responsiveness during active editing sessions.

Beyond its core parsing capabilities, the system includes a declarative query engine that allows users to execute pattern-matching searches against generated syntax trees. This enables the extraction of specific nodes or structural information for complex analysis and transformation tasks. The framework provides a language-agnostic runtime core and native bindings, allowing developers to embed these parsing and querying capabilities into a wide variety of host applications.

## Tags

### Development Tools & Productivity

- [Compilers](https://awesome-repositories.com/f/development-tools-productivity/syntax-grammar-managers/compilers.md) — Compiles formal grammar definitions into portable, high-performance parsing code for integration into development tools.
- [Abstract Syntax Tree Generators](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/abstract-syntax-tree-generators.md) — Converts source code into structured syntax trees to facilitate code navigation, highlighting, and analysis.
- [Concrete Syntax Tree Generators](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/abstract-syntax-tree-generators/concrete-syntax-tree-generators.md) — Converts source code into a structured tree representation that stays synchronized with text changes through incremental updates. ([source](https://tree-sitter.github.io))
- [Source Code Editors](https://awesome-repositories.com/f/development-tools-productivity/source-code-editors.md) — Processes source files into concrete syntax trees to provide structural information for text editors and analysis tools. ([source](https://tree-sitter.github.io/cli/index.html))
- [Syntax Grammar Managers](https://awesome-repositories.com/f/development-tools-productivity/syntax-grammar-managers.md) — Enables the definition and management of formal language grammars for structural code analysis.
- [Syntax Highlighting Engines](https://awesome-repositories.com/f/development-tools-productivity/syntax-highlighting-engines.md) — Powers responsive syntax highlighting engines that update in real-time as code is modified.
- [Language Servers](https://awesome-repositories.com/f/development-tools-productivity/language-servers.md) — Facilitates the implementation of language-aware development tools through high-performance structural analysis.

### Programming Languages & Runtimes

- [Parser Generators](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/type-systems/type-checking-disciplines/statically-typed-languages/parser-generators.md) — Creates parsers from formal grammar definitions to enable structural analysis and syntax highlighting for source code. ([source](https://tree-sitter.github.io/cli/build.html))
- [Language-Agnostic Runtimes](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/language-runtimes/language-agnostic-runtimes.md) — Provides a unified execution environment that allows host applications to integrate diverse language parsers through a consistent native interface.
- [Cross-Language Parsing Integrations](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/cross-language-parsing-integrations.md) — Connects language-agnostic parsing engines to applications written in different programming languages to enable consistent structural analysis. ([source](https://tree-sitter.github.io))

### Software Engineering & Architecture

- [Incremental Parsers](https://awesome-repositories.com/f/software-engineering-architecture/incremental-parsers.md) — Provides an incremental parsing framework that maintains high-performance syntax trees during active editing.
- [Syntax Parsing Engines](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines.md) — Functions as a language parsing engine that compiles formal grammars into portable code for integration into development tools.
- [Parsing Recovery](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/error-management/application-error-handlers/error-contextualization/parsing-recovery.md) — Maintains valid syntax tree structures even when source code contains syntax errors or incomplete fragments.
- [Syntax Parsers](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsers.md) — Builds high-performance parsers for programming languages that produce concrete syntax trees suitable for structural analysis. ([source](https://cdn.jsdelivr.net/gh/tree-sitter/tree-sitter@master/README.md))
- [Syntax Query Definitions](https://awesome-repositories.com/f/software-engineering-architecture/syntax-query-definitions.md) — Executes declarative structural searches against generated syntax trees to identify specific code constructs for analysis or transformation.
- [Incremental Reconciliation](https://awesome-repositories.com/f/software-engineering-architecture/trees/incremental-reconciliation.md) — Updates only modified branches of a syntax tree during edits to maintain high performance without re-parsing the entire file.
- [Error Recovery](https://awesome-repositories.com/f/software-engineering-architecture/error-recovery.md) — Maintains valid syntax tree structures even when encountering incomplete or malformed source code during parsing.
- [Error-Resilient Parsers](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/error-resilient-parsers.md) — Maintains structural integrity and produces useful syntax tree results even when source files contain syntax errors or incomplete code. ([source](https://cdn.jsdelivr.net/gh/tree-sitter/tree-sitter@master/README.md))
- [Syntax Tree Construction](https://awesome-repositories.com/f/software-engineering-architecture/trees/syntax-tree-construction.md) — Constructs valid and usable syntax tree structures even when source code contains syntax errors or incomplete fragments.
- [Code Analysis Tools](https://awesome-repositories.com/f/software-engineering-architecture/code-analysis-tools.md) — Maintains functional syntax trees and structural insights even when source code contains syntax errors.
- [Generalized LR Parsers](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/generalized-lr-parsers.md) — Uses a flexible parsing algorithm that handles ambiguous grammars by exploring multiple potential paths simultaneously.
- [Parser Bindings](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/workflow-automation-integrations/external-application-integrations/parser-bindings.md) — Connects custom parsing logic to host applications using native interfaces to embed complex data processing capabilities. ([source](https://tree-sitter.github.io/))

### Testing & Quality Assurance

- [Grammar Validation Tools](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/test-case-definitions/grammar-validation-tools.md) — Validates grammar definitions by running them against source code samples to ensure the parser correctly identifies syntax structures. ([source](https://tree-sitter.github.io/cli/index.html))
