Closed wongjiahau closed 6 years ago
Tree-sitter is a different kind of tool than bison or jison. It's not designed to run arbitrary code that produces a custom AST. Instead, it has a built-in type of AST that works the same for every supported language. This is part of what makes incremental parsing possible, and it's really useful for applications that work with code written in multiple languages. That said, it's not suitable for all parsing tasks.
What kind of code analysis are you trying to do with it?
Type checking. Anyway, I figured out how to render the built-in AST into JSON.
Ok cool. I'm going to close this out. Let me know if you have other questions.
For example, in jison, we can do the following:
So, how can I do that or achieve similar thing in
node-tree-sitter
? Or do you have a better suggestion?