tree-sitter/docs/section-2-architecture.md
Max Brunsfeld d1665da21c Add docs
2018-06-11 19:17:10 -07:00

1 KiB

title permalink
Architecture architecture

Architecture

Tree-sitter consists of two separate libraries, both of which expose C APIs.

The first library, libcompiler, is used to generate a parser for a language by supplying a context-free grammar describing the language. libcompiler is a build tool; it is no longer needed once a parser has been generated. Its public interface is specified in the header file compiler.h.

The second library, libruntime, is used in combination with the parsers generated by libcompiler, to produce syntax trees from source code and keep the syntax trees up-to-date as the source code changes. libruntime is designed to be embedded in applications. Its interface is specified in the header file runtime.h.

The Compiler

WIP

The Runtime

WIP