3 ms·
Tree sitter has a C runtime, and often a C scanner.
by zamalek 2y ago
Tree sitter has a C runtime, and often a C scanner.
- lemming 2y agoRight, that would be another native bridge solution.
- AdieuToLogic 2y agoSee my peer comment for another option. :-)
- AdieuToLogic 2y agoIf the tree-sitter runtime requirements are prohibitive and a pure JVM solution (IOW, no JNI) mandatory, then I'd recommend using antlr[0] with its representative grammar[1] as a starting point. See here[2] for more details. 0 - https://www.antlr.org/ https://www.antlr.org/ 1 - https://github.com/antlr/grammars-v4/blob/master/javascript/typescript/README.md https://github.com/antlr/grammars-v4/blob/master/javascript/... 2 - https://github.com/antlr/grammars-v4/wiki https://github.com/antlr/grammars-v4/wiki
- sjtucaocao 2y agoI'm the maintainer of swc4j. I had been using Antlr for many years, but was deeply disappointed by Antlr. So I created swc4j. Why Antlr is not the one? Hope the following blog I wrote may explain. https://blog.caoccao.com/hello-swc4j-goodbye-antlr-f9a63e45a3d4 https://blog.caoccao.com/hello-swc4j-goodbye-antlr-f9a63e45a...
- lemming 2y agoI agree that the Antlr Typescript grammar is underwhelming, and I also agree with the difficulty of not having a well defined owner of the project to interact with. My main use case is parsing TS type definitions, and the grammar from the grammars-v4 repo doesn't parse anything starting with 'declare', which is pretty fundamental.