Tree-sitter is a great tool for building incremental and error-tolerant parsers for use in compilers, IDEs and code analyzers, which can also run directly in the browser. Unlike ANTLR, which is a popular open-source LL(*) parser generator, tree-sitter is a GLR parser generator that's similar but more powerful than the LALR parser generator YACC that we all were forced to learn back in CS 440 😅.
It's also nice that tree-sitter is open-source, unlike the closed-source REx Parser Generator that I used to generate the JSONiq parser for the Unity DGMS analytics engine (from the ebnf grammar). I guess it can be a bit disquieting for a project to depend on Gunther Rademacher to continuing maintaining his REx web service 😬.
To use it, simply import this Gist in any common module that processes tree-sitter
SyntaxNodes. Please note that this workaround does not eliminate the need for Node.js- and Web- specific loading and initialization of the tree-sitter API and languages.