Tree-sitter (parser generator)

In computing, Tree-sitter is a parser generator and incremental parsing library.

Tree-sitter
Original author(s)Max Brunsfeld
Initial release2018 (2018)
Stable release
0.20.8 / 4 April 2023
Repository
Written inRust, C
PlatformCross-platform
TypeParser generator
LicenseMIT License
Websitetree-sitter.github.io/tree-sitter/

Details

It is used to parse source code into parse trees usable in compilers, interpreters, text editors, and static analyzers.[1] It is specialized for use in text editors, as it supports incremental parsing for updating parse trees while code is edited in real time,[2] and provides a built-in S-expression query system for analyzing code.[3]

Text editors which have official integrations with Tree-sitter include Atom,[4] GNU Emacs,[5] Neovim,[6] Lapce,[7] Zed,[8] and Helix.[9] Language bindings allow it to be used from programming languages including Go, Haskell, Java, Javascript (with Node.js and WASM), Kotlin, Lua, OCaml, Perl, Python, Ruby, Rust, and Swift. Tree-sitter parsers have been written for these languages and many others.[10] GitHub uses Tree-sitter to support in-browser symbolic code navigation in git repositories.[11]

Tree-sitter uses a GLR parser, a type of LR parser.[12][13][11]

Tree-sitter was originally developed by GitHub for use in the Atom text editor, where it was first released in 2018.[4]

See also

References

  1. "Introductory to Treesitter". Blog Teknologi Umum. Retrieved 2023-07-30.
  2. "TreeSitter - the holy grail of parsing source code". symflower.com. Retrieved 2023-07-30.
  3. Petersen, Mickey. "Tree Sitter and the Complications of Parsing Languages". Mastering Emacs. Retrieved 2023-07-30.
  4. Brunsfeld, Max (2018-10-31). "Atom understands your code better than ever before". The GitHub Blog. Retrieved 2023-07-30.
  5. "GNU Emacs NEWS -- history of user-visible changes".
  6. "Treesitter - Neovim docs". neovim.io. Retrieved 2023-07-30.
  7. "lapce/CHANGELOG.md at f4747fbd306a4b8fda6927e37593bf23f4a1584b · lapce/lapce". GitHub. Retrieved 2023-07-30.
  8. "Zed - Code at the speed of thought". Zed. Retrieved 2023-07-30.
  9. "Helix". helix-editor.com. Retrieved 2023-07-30.
  10. "Tree-sitter|Introduction". tree-sitter.github.io. Retrieved 2023-07-30.
  11. Clem, Timothy; Thomson, Patrick (2021-08-31). "Static Analysis at GitHub: An experience report". Queue. 19 (4): 42–67. doi:10.1145/3487019.3487022. ISSN 1542-7730. S2CID 238412787.
  12. Nadeem, Ayman (2020-08-04). "CodeGen: Semantic's improved language support system". The GitHub Blog. Retrieved 2023-07-30.
  13. "Tree-sitter - a new parsing system for programming tools" by Max Brunsfeld, retrieved 2023-07-30. See 22:30 for Wagner influence and 29:27 for GLR implementation.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.