2018-06-10 09:54:59 -07:00
---
title: Introduction
---
# Introduction
2018-07-10 14:09:22 -07:00
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:
2018-02-24 21:29:37 -08:00
2018-06-10 09:54:59 -07:00
* **General** enough to parse any programming language
2018-06-11 19:17:10 -07:00
* **Fast** enough to parse on every keystroke in a text editor
2018-07-10 14:09:22 -07:00
* **Robust** enough to provide useful results even in the presence of syntax errors
2023-01-27 10:15:23 +02:00
* **Dependency-free** so that the runtime library (which is written in pure [C ](https://github.com/tree-sitter/tree-sitter/tree/master/lib )) can be embedded in any application
2018-06-10 09:54:59 -07:00
### Language Bindings
There are currently bindings that allow Tree-sitter to be used from the following languages:
2024-01-25 21:10:46 -05:00
* [C# ](https://github.com/tree-sitter/csharp-tree-sitter )
2023-01-27 10:15:23 +02:00
* [Go ](https://github.com/smacker/go-tree-sitter )
2024-01-25 21:10:46 -05:00
* [Guile ](https://github.com/Z572/guile-ts )
2021-09-16 13:19:05 -07:00
* [Haskell ](https://github.com/tree-sitter/haskell-tree-sitter )
2023-03-21 15:36:09 +10:00
* [Java ](https://github.com/serenadeai/java-tree-sitter )
2024-02-10 16:41:47 +01:00
* [Java ](https://github.com/bonede/tree-sitter-ng )
2024-02-07 21:26:21 +01:00
* [Java (Android) ](https://github.com/AndroidIDEOfficial/android-tree-sitter )
2019-05-07 10:27:45 -07:00
* [JavaScript (Node.js) ](https://github.com/tree-sitter/node-tree-sitter )
2021-09-16 13:19:05 -07:00
* [JavaScript (Wasm) ](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web )
2023-03-21 15:36:09 +10:00
* [Kotlin ](https://github.com/oxisto/kotlintree )
2021-11-19 13:58:46 -08:00
* [Lua ](https://github.com/euclidianAce/ltreesitter )
2021-09-16 13:19:05 -07:00
* [OCaml ](https://github.com/returntocorp/ocaml-tree-sitter-core )
2024-02-07 21:26:21 +01:00
* [Odin ](https://github.com/laytan/odin-tree-sitter )
2023-01-27 10:15:23 +02:00
* [Perl ](https://metacpan.org/pod/Text::Treesitter )
2019-03-22 14:20:31 -07:00
* [Python ](https://github.com/tree-sitter/py-tree-sitter )
2024-02-07 21:26:21 +01:00
* [Ruby ](https://github.com/Faveod/ruby-tree-sitter )
2023-01-27 10:15:23 +02:00
* [Ruby ](https://github.com/calicoday/ruby-tree-sitter-ffi )
2021-09-16 13:19:05 -07:00
* [Rust ](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_rust )
2021-11-17 11:30:32 -05:00
* [Swift ](https://github.com/ChimeHQ/SwiftTreeSitter )
2018-06-10 09:54:59 -07:00
2023-01-17 09:14:57 -05:00
### Parsers
2018-06-10 09:54:59 -07:00
2023-01-27 10:15:23 +02:00
* [Ada ](https://github.com/briot/tree-sitter-ada )
2023-01-17 09:14:57 -05:00
* [Agda ](https://github.com/tree-sitter/tree-sitter-agda )
2023-01-27 10:15:23 +02:00
* [Apex ](https://github.com/aheber/tree-sitter-sfapex )
2024-01-25 21:10:46 -05:00
* [ApexCode ](https://github.com/jsuarez-chipiron/tree-sitter-apex )
* [AWS Event Rule ](https://github.com/3p3r/tree-sitter-eventrule )
2018-06-10 09:54:59 -07:00
* [Bash ](https://github.com/tree-sitter/tree-sitter-bash )
2023-01-27 10:15:23 +02:00
* [Beancount ](https://github.com/zwpaper/tree-sitter-beancount )
* [Cap'n Proto ](https://github.com/amaanq/tree-sitter-capnp )
* [C ](https://github.com/tree-sitter/tree-sitter-c )
2018-06-10 09:54:59 -07:00
* [C++ ](https://github.com/tree-sitter/tree-sitter-cpp )
2023-01-27 10:15:23 +02:00
* [C# ](https://github.com/tree-sitter/tree-sitter-c-sharp )
2024-01-25 21:10:46 -05:00
* [CEL ](https://github.com/bufbuild/tree-sitter-cel )
2023-01-17 09:14:57 -05:00
* [Clojure ](https://github.com/sogaiu/tree-sitter-clojure )
* [CMake ](https://github.com/uyha/tree-sitter-cmake )
2024-01-25 21:10:46 -05:00
* [COBOL ](https://github.com/yutaro-sakamoto/tree-sitter-cobol )
2021-09-26 12:16:13 +02:00
* [Common Lisp ](https://github.com/theHamsta/tree-sitter-commonlisp )
2018-10-30 09:36:45 -07:00
* [CSS ](https://github.com/tree-sitter/tree-sitter-css )
2021-09-26 12:16:13 +02:00
* [CUDA ](https://github.com/theHamsta/tree-sitter-cuda )
2023-01-17 09:14:57 -05:00
* [Dart ](https://github.com/UserNobody14/tree-sitter-dart )
2023-01-27 10:15:23 +02:00
* [D ](https://github.com/gdamore/tree-sitter-d )
2023-01-17 09:14:57 -05:00
* [Dockerfile ](https://github.com/camdencheek/tree-sitter-dockerfile )
2021-08-29 20:20:56 +08:00
* [DOT ](https://github.com/rydesun/tree-sitter-dot )
2023-01-17 09:14:57 -05:00
* [Elixir ](https://github.com/elixir-lang/tree-sitter-elixir )
2021-02-01 02:32:16 +01:00
* [Elm ](https://github.com/elm-tooling/tree-sitter-elm )
2021-09-26 22:51:50 -07:00
* [Emacs Lisp ](https://github.com/Wilfred/tree-sitter-elisp )
2019-08-05 23:19:29 +02:00
* [Eno ](https://github.com/eno-lang/tree-sitter-eno )
2018-07-05 16:45:27 -07:00
* [ERB / EJS ](https://github.com/tree-sitter/tree-sitter-embedded-template )
2022-10-20 09:50:14 +01:00
* [Erlang ](https://github.com/WhatsApp/tree-sitter-erlang/ )
2021-04-30 19:06:10 +00:00
* [Fennel ](https://github.com/travonted/tree-sitter-fennel )
2023-01-17 09:14:57 -05:00
* [Fish ](https://github.com/ram02z/tree-sitter-fish )
2023-01-27 10:15:23 +02:00
* [Formula ](https://github.com/siraben/tree-sitter-formula )
2023-01-17 09:14:57 -05:00
* [Fortran ](https://github.com/stadelmanma/tree-sitter-fortran )
* [gitattributes ](https://github.com/ObserverOfTime/tree-sitter-gitattributes )
* [gitignore ](https://github.com/shunsambongi/tree-sitter-gitignore )
2023-01-27 10:15:23 +02:00
* [Gleam ](https://github.com/gleam-lang/tree-sitter-gleam )
2021-09-26 12:16:13 +02:00
* [GLSL (OpenGL Shading Language) ](https://github.com/theHamsta/tree-sitter-glsl )
2023-01-27 10:15:23 +02:00
* [Go ](https://github.com/tree-sitter/tree-sitter-go )
2023-01-17 09:14:57 -05:00
* [Go mod ](https://github.com/camdencheek/tree-sitter-go-mod )
* [Go work ](https://github.com/omertuc/tree-sitter-go-work )
2024-01-25 21:10:46 -05:00
* [GraphQL ](https://github.com/bkegley/tree-sitter-graphql )
2023-01-17 09:14:57 -05:00
* [Hack ](https://github.com/slackhq/tree-sitter-hack )
* [Haskell ](https://github.com/tree-sitter/tree-sitter-haskell )
2021-09-16 13:34:59 -07:00
* [HCL ](https://github.com/MichaHoffmann/tree-sitter-hcl )
2018-06-12 17:37:46 -07:00
* [HTML ](https://github.com/tree-sitter/tree-sitter-html )
2024-01-25 21:10:46 -05:00
* [ISPC ](https://github.com/fab4100/tree-sitter-ispc )
2023-01-17 09:14:57 -05:00
* [Java ](https://github.com/tree-sitter/tree-sitter-java )
2023-01-27 10:15:23 +02:00
* [JavaScript ](https://github.com/tree-sitter/tree-sitter-javascript )
* [jq ](https://github.com/flurie/tree-sitter-jq )
2022-05-04 00:01:02 +09:00
* [JSON ](https://github.com/tree-sitter/tree-sitter-json )
2024-01-25 21:10:46 -05:00
* [JSON5 ](https://github.com/Joakker/tree-sitter-json5 )
2023-01-17 09:14:57 -05:00
* [Julia ](https://github.com/tree-sitter/tree-sitter-julia )
2024-01-25 21:10:46 -05:00
* [Just ](https://github.com/IndianBoy42/tree-sitter-just )
2023-01-17 09:14:57 -05:00
* [Kotlin ](https://github.com/fwcd/tree-sitter-kotlin )
2023-01-27 10:15:23 +02:00
* [LALRPOP ](https://github.com/traxys/tree-sitter-lalrpop )
2024-01-25 21:10:46 -05:00
* [LaTeX ](https://github.com/latex-lsp/tree-sitter-latex )
2023-01-27 10:15:23 +02:00
* [Lean ](https://github.com/Julian/tree-sitter-lean )
2023-01-17 09:14:57 -05:00
* [LLVM ](https://github.com/benwilliamgraham/tree-sitter-llvm )
2023-01-27 10:15:23 +02:00
* [LLVM MachineIR ](https://github.com/Flakebi/tree-sitter-llvm-mir )
2024-01-25 21:10:46 -05:00
* [LLVM MLIR ](https://github.com/artagnon/tree-sitter-mlir )
2023-01-27 10:15:23 +02:00
* [LLVM TableGen ](https://github.com/Flakebi/tree-sitter-tablegen )
2024-02-07 21:26:21 +01:00
* [Lua ](https://github.com/MunifTanjim/tree-sitter-lua )
* [Magik ](https://github.com/krn-robin/tree-sitter-magik )
2021-04-30 19:06:10 +00:00
* [Make ](https://github.com/alemuller/tree-sitter-make )
2019-09-30 20:10:37 +08:00
* [Markdown ](https://github.com/ikatyang/tree-sitter-markdown )
2023-01-17 09:14:57 -05:00
* [Markdown ](https://github.com/MDeiml/tree-sitter-markdown )
2023-01-27 10:15:23 +02:00
* [Meson ](https://github.com/Decodetalkers/tree-sitter-meson )
* [Meson ](https://github.com/staysail/tree-sitter-meson )
2024-01-25 21:10:46 -05:00
* [Motorola 68000 assembly ](https://github.com/grahambates/tree-sitter-m68k )
2024-03-17 18:47:25 -04:00
* [NGINX ](https://gitlab.com/joncoole/tree-sitter-nginx )
2024-01-25 21:10:46 -05:00
* [Nim ](https://github.com/alaviss/tree-sitter-nim )
2023-01-17 09:14:57 -05:00
* [Nix ](https://github.com/cstrahan/tree-sitter-nix )
2024-01-25 21:10:46 -05:00
* [Noir ](https://github.com/hhamud/tree-sitter-noir )
2023-01-17 09:14:57 -05:00
* [Objective-C ](https://github.com/jiyee/tree-sitter-objc )
2018-07-05 16:45:27 -07:00
* [OCaml ](https://github.com/tree-sitter/tree-sitter-ocaml )
2024-02-07 21:26:21 +01:00
* [Odin ](https://github.com/amaanq/tree-sitter-odin )
2024-02-29 19:13:53 +01:00
* [Ohm ](https://github.com/novusnota/tree-sitter-ohm )
2023-01-17 09:14:57 -05:00
* [Org ](https://github.com/milisims/tree-sitter-org )
2024-01-25 21:10:46 -05:00
* [P4 ](https://github.com/ace-design/tree-sitter-p4 )
2023-01-17 09:14:57 -05:00
* [Pascal ](https://github.com/Isopod/tree-sitter-pascal )
* [Perl ](https://github.com/ganezdragon/tree-sitter-perl )
2023-01-27 10:15:23 +02:00
* [Perl ](https://github.com/tree-sitter-perl/tree-sitter-perl )
* [Perl POD ](https://github.com/tree-sitter-perl/tree-sitter-pod )
2018-06-10 09:54:59 -07:00
* [PHP ](https://github.com/tree-sitter/tree-sitter-php )
2023-01-27 10:15:23 +02:00
* [Portable Game Notation ](https://github.com/rolandwalker/tree-sitter-pgn )
2024-01-25 21:10:46 -05:00
* [PowerShell ](https://github.com/airbus-cert/tree-sitter-powershell )
2023-01-17 09:14:57 -05:00
* [Protocol Buffers ](https://github.com/mitchellh/tree-sitter-proto )
2018-06-10 09:54:59 -07:00
* [Python ](https://github.com/tree-sitter/tree-sitter-python )
2023-01-27 10:15:23 +02:00
* [QML ](https://github.com/yuja/tree-sitter-qmljs )
2024-01-25 21:10:46 -05:00
* [QuakeC ](https://github.com/vkazanov/tree-sitter-quakec )
2023-01-17 09:14:57 -05:00
* [Racket ](https://github.com/6cdh/tree-sitter-racket )
2023-01-27 10:15:23 +02:00
* [Rasi ](https://github.com/Fymyte/tree-sitter-rasi )
* [re2c ](https://github.com/alemuller/tree-sitter-re2c )
2023-01-17 09:14:57 -05:00
* [Regex ](https://github.com/tree-sitter/tree-sitter-regex )
2023-01-27 10:15:23 +02:00
* [Rego ](https://github.com/FallenAngel97/tree-sitter-rego )
2023-01-17 09:14:57 -05:00
* [reStructuredText ](https://github.com/stsewd/tree-sitter-rst )
2023-01-27 10:15:23 +02:00
* [R ](https://github.com/r-lib/tree-sitter-r )
2024-01-25 21:10:46 -05:00
* [Robot ](https://github.com/Hubro/tree-sitter-robot )
2018-06-10 09:54:59 -07:00
* [Ruby ](https://github.com/tree-sitter/tree-sitter-ruby )
* [Rust ](https://github.com/tree-sitter/tree-sitter-rust )
2023-01-17 09:14:57 -05:00
* [Scala ](https://github.com/tree-sitter/tree-sitter-scala )
* [Scheme ](https://github.com/6cdh/tree-sitter-scheme )
2024-01-25 21:10:46 -05:00
* [SCSS ](https://github.com/serenadeai/tree-sitter-scss )
2023-01-27 10:15:23 +02:00
* [S-expressions ](https://github.com/AbstractMachinesLab/tree-sitter-sexp )
* [Smali ](https://github.com/amaanq/tree-sitter-smali )
* [Smali ](https://git.sr.ht/~yotam/tree-sitter-smali )
2024-01-25 21:10:46 -05:00
* [SourcePawn ](https://github.com/nilshelmig/tree-sitter-sourcepawn )
2021-03-17 23:11:11 +01:00
* [SPARQL ](https://github.com/BonaBeavis/tree-sitter-sparql )
2023-01-27 10:15:23 +02:00
* [SQL - BigQuery ](https://github.com/takegue/tree-sitter-sql-bigquery )
2024-01-25 21:10:46 -05:00
* [SQL - General ](https://github.com/DerekStride/tree-sitter-sql )
2023-01-27 10:15:23 +02:00
* [SQL - PostgreSQL ](https://github.com/m-novikov/tree-sitter-sql )
* [SQL - SQLite ](https://github.com/dhcmrlchtdj/tree-sitter-sqlite )
2023-01-17 09:14:57 -05:00
* [SSH ](https://github.com/metio/tree-sitter-ssh-client-config )
2024-02-07 21:26:21 +01:00
* [Supercollider ](https://github.com/madskjeldgaard/tree-sitter-supercollider )
2021-02-24 23:05:42 +05:30
* [Svelte ](https://github.com/Himujjal/tree-sitter-svelte )
2022-09-05 16:21:12 -04:00
* [Swift ](https://github.com/alex-pinkus/tree-sitter-swift )
* [SystemRDL ](https://github.com/SystemRDL/tree-sitter-systemrdl )
2024-02-16 23:31:07 +01:00
* [Tact ](https://github.com/tact-lang/tree-sitter-tact )
2023-01-27 10:15:23 +02:00
* [Thrift ](https://github.com/duskmoon314/tree-sitter-thrift )
2024-01-25 21:10:46 -05:00
* ["TODO:" comments ](https://github.com/stsewd/tree-sitter-comment )
2019-09-01 02:30:11 +08:00
* [TOML ](https://github.com/ikatyang/tree-sitter-toml )
2023-01-27 10:15:23 +02:00
* [Tree-sitter Query ](https://github.com/nvim-treesitter/tree-sitter-query )
2021-03-17 23:11:11 +01:00
* [Turtle ](https://github.com/BonaBeavis/tree-sitter-turtle )
2024-01-25 21:10:46 -05:00
* [Twig ](https://github.com/kaermorchen/tree-sitter-twig )
2022-10-04 10:08:56 +02:00
* [Twig ](https://github.com/gbprod/tree-sitter-twig )
2018-06-10 09:54:59 -07:00
* [TypeScript ](https://github.com/tree-sitter/tree-sitter-typescript )
2024-01-25 21:10:46 -05:00
* [Ungrammar ](https://github.com/Philipp-M/tree-sitter-ungrammar )
* [USD ](https://github.com/ColinKennedy/tree-sitter-usd )
2019-06-13 11:51:53 -07:00
* [Verilog ](https://github.com/tree-sitter/tree-sitter-verilog )
2020-10-29 19:08:55 +00:00
* [VHDL ](https://github.com/alemuller/tree-sitter-vhdl )
2019-10-04 20:38:01 +08:00
* [Vue ](https://github.com/ikatyang/tree-sitter-vue )
2024-01-25 21:10:46 -05:00
* [Wasm ](https://github.com/wasm-lsp/tree-sitter-wasm )
* [WDL ](https://github.com/jdidion/tree-sitter-wdl )
* [WGSL (WebGPU Shading Language) ](https://github.com/mehmetoguzderin/tree-sitter-wgsl )
2023-01-17 09:14:57 -05:00
* [YAML ](https://github.com/ikatyang/tree-sitter-yaml )
2023-01-27 10:15:23 +02:00
* [YANG ](https://github.com/Hubro/tree-sitter-yang )
2024-01-25 21:10:46 -05:00
* [Yuck ](https://github.com/Philipp-M/tree-sitter-yuck )
2023-01-17 09:14:57 -05:00
* [Zig ](https://github.com/maxxnino/tree-sitter-zig )
2018-02-24 23:47:37 -08:00
2018-06-10 09:54:59 -07:00
### Talks on Tree-sitter
2018-02-24 23:47:37 -08:00
2019-05-07 09:23:52 -07:00
* [Strange Loop 2018 ](https://www.thestrangeloop.com/2018/tree-sitter---a-new-parsing-system-for-programming-tools.html )
2018-06-10 09:54:59 -07:00
* [FOSDEM 2018 ](https://www.youtube.com/watch?v=0CGzC_iss-8 )
* [GitHub Universe 2017 ](https://www.youtube.com/watch?v=a1rC79DHpmY )
2018-06-11 19:17:10 -07:00
### Underlying Research
The design of Tree-sitter was greatly influenced by the following research papers:
docs: update badges; fix markdown lint complains
Linter config `.vscode/settings.json`:
```json
{
"[markdown]": {
"files.trimTrailingWhitespace": false,
},
"markdownlint.config": {
"default": true,
// "ul-style": {
// "style": "asterisk"
// },
"MD001": false,
"MD024": false,
"MD025": false,
"MD033": false,
"MD041": false,
"MD053": false,
},
}
```
2023-04-16 21:14:19 +03:00
* [Practical Algorithms for Incremental Software Development Environments ](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1997/CSD-97-946.pdf )
* [Context Aware Scanning for Parsing Extensible Languages ](https://www-users.cse.umn.edu/~evw/pubs/vanwyk07gpce/vanwyk07gpce.pdf )
* [Efficient and Flexible Incremental Parsing ](https://harmonia.cs.berkeley.edu/papers/twagner-parsing.pdf )
* [Incremental Analysis of Real Programming Languages ](https://harmonia.cs.berkeley.edu/papers/twagner-glr.pdf )
* [Error Detection and Recovery in LR Parsers ](https://what-when-how.com/compiler-writing/bottom-up-parsing-compiler-writing-part-13 )
* [Error Recovery for LR Parsers ](https://apps.dtic.mil/sti/pdfs/ADA043470.pdf )