| CARVIEW |
Select Language
HTTP/2 301
server: GitHub.com
content-type: text/html
location: https://tree-sitter.github.io/tree-sitter/
x-github-request-id: 4AAC:2680BD:5CBDDA:67BFEE:694F35D5
accept-ranges: bytes
age: 0
date: Sat, 27 Dec 2025 01:26:46 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210058-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1766798806.130599,VS0,VE196
vary: Accept-Encoding
x-fastly-request-id: 794fef8aee1ce0036a5e49efa8264c3b2a5be03a
content-length: 162
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Thu, 25 Dec 2025 12:18:44 GMT
access-control-allow-origin: *
etag: W/"694d2ba4-478c"
expires: Fri, 26 Dec 2025 23:18:12 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 544F:2F7ECD:5C81D1:67452E:694F155B
accept-ranges: bytes
age: 0
date: Sat, 27 Dec 2025 01:26:46 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210058-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1766798806.339830,VS0,VE202
vary: Accept-Encoding
x-fastly-request-id: 67edeef5392f4b5f5dedfefed10692d9e164d38d
content-length: 4733
Introduction - Tree-sitter
Keyboard shortcuts
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Introduction
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Tree-sitter aims to be:
- General enough to parse any programming language
- Fast enough to parse on every keystroke in a text editor
- Robust enough to provide useful results even in the presence of syntax errors
- Dependency-free so that the runtime library (which is written in pure C11) can be embedded in any application
Language Bindings
There are bindings that allow Tree-sitter to be used from the following languages:
Official
Third-party
- C# (.NET)
- C++
- Crystal
- D
- Delphi
- ELisp
- Go
- Guile
- Janet
- Java (JDK 8+)
- Java (JDK 11+)
- Julia
- Lua
- Lua
- OCaml
- Odin
- Perl
- Pharo
- PHP
- R
- Ruby
Keep in mind that some of the bindings may be incomplete or out of date.
Parsers
The following parsers can be found in the upstream organization:
- Agda
- Bash
- C
- C++
- C#
- CSS
- ERB / EJS
- Go
- Haskell
- HTML
- Java
- JavaScript
- JSDoc
- JSON
- Julia
- OCaml
- PHP
- Python
- Regex
- Ruby
- Rust
- Scala
- TypeScript
- Verilog
A list of known parsers can be found in the wiki.
Talks on Tree-sitter
Underlying Research
The design of Tree-sitter was greatly influenced by the following research papers:
