tree-sitter/docs/index.md

69 lines
3.5 KiB
Markdown
Raw Normal View History

2018-06-10 09:54:59 -07:00
---
title: Introduction
---
# 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:
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
* **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 C) 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:
* [Rust](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_rust)
* [JavaScript (Wasm)](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web)
* [JavaScript (Node.js)](https://github.com/tree-sitter/node-tree-sitter)
* [Python](https://github.com/tree-sitter/py-tree-sitter)
2018-06-10 09:54:59 -07:00
* [Ruby](https://github.com/tree-sitter/ruby-tree-sitter)
* [Haskell](https://github.com/tree-sitter/haskell-tree-sitter)
2018-06-10 09:54:59 -07:00
### Available Parsers
2018-06-12 17:37:46 -07:00
Parsers for these languages are fairly complete:
2018-06-10 09:54:59 -07:00
* [Bash](https://github.com/tree-sitter/tree-sitter-bash)
* [C](https://github.com/tree-sitter/tree-sitter-c)
* [C++](https://github.com/tree-sitter/tree-sitter-cpp)
2018-10-30 09:36:45 -07:00
* [CSS](https://github.com/tree-sitter/tree-sitter-css)
2018-07-05 16:45:27 -07:00
* [ERB / EJS](https://github.com/tree-sitter/tree-sitter-embedded-template)
2018-06-10 09:54:59 -07:00
* [Go](https://github.com/tree-sitter/tree-sitter-go)
2018-06-12 17:37:46 -07:00
* [HTML](https://github.com/tree-sitter/tree-sitter-html)
2018-06-10 09:54:59 -07:00
* [JavaScript](https://github.com/tree-sitter/tree-sitter-javascript)
2018-07-05 16:45:27 -07:00
* [OCaml](https://github.com/tree-sitter/tree-sitter-ocaml)
2018-06-10 09:54:59 -07:00
* [PHP](https://github.com/tree-sitter/tree-sitter-php)
* [Python](https://github.com/tree-sitter/tree-sitter-python)
* [Ruby](https://github.com/tree-sitter/tree-sitter-ruby)
* [Rust](https://github.com/tree-sitter/tree-sitter-rust)
* [TypeScript](https://github.com/tree-sitter/tree-sitter-typescript)
2018-06-12 17:37:46 -07:00
Parsers for these languages are in development:
2018-06-10 09:54:59 -07:00
* [Agda](https://github.com/tree-sitter/tree-sitter-agda)
* [C-sharp](https://github.com/tree-sitter/tree-sitter-c-sharp)
2018-06-10 09:54:59 -07:00
* [Haskell](https://github.com/tree-sitter/tree-sitter-haskell)
* [Java](https://github.com/tree-sitter/tree-sitter-java)
* [Julia](https://github.com/tree-sitter/tree-sitter-julia)
* [Scala](https://github.com/tree-sitter/tree-sitter-scala)
2018-06-10 09:54:59 -07:00
### Talks on Tree-sitter
* [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:
- [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](http://www.umsec.umn.edu/publications/Context-Aware-Scanning-Parsing-Extensible)
- [Efficient and Flexible Incremental Parsing](http://ftp.cs.berkeley.edu/sggs/toplas-parsing.ps)
- [Incremental Analysis of Real Programming Languages](https://pdfs.semanticscholar.org/ca69/018c29cc415820ed207d7e1d391e2da1656f.pdf)
- [Error Detection and Recovery in LR Parsers](http://what-when-how.com/compiler-writing/bottom-up-parsing-compiler-writing-part-13)
- [Error Recovery for LR Parsers](http://www.dtic.mil/dtic/tr/fulltext/u2/a043470.pdf)