emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter introduction documentation


From: Gregory Heytings
Subject: Re: Tree-sitter introduction documentation
Date: Thu, 29 Dec 2022 17:12:46 +0000



Indeed, IIUC, Tree-sitter uses Javascript as a preprocessor, so the source grammar is a Javascript program which returns a grammar represented as a JS object (could probably be easily mapped to JSON). which is then turned into a `.c` file by a Rust program.


The whole process is:

{grammar.js} -> [Node.js] -> {grammar.json} -> [tree-sitter] -> {parser.c} -> [cc 
or c++] -> {library file}
{scanner.c or scanner.cc} 
---------------------------------------------------------^

where {} are files and [] are programs.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]