Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for how to transpile one language to another using tree-sitter? #121

Open
lancejpollard opened this issue Jan 21, 2023 · 1 comment

Comments

@lancejpollard
Copy link

I can't seem to find any docs about what I can access through the Node.js API. I would like to convert C++ to TypeScript, as an experiment, and thought I could use the AST produced from tree-sitter for C++, but all it gives me are nodes with a type property, but no function names, variable names, etc..

How can I get access to all that information and traverse the tree? I don't see any examples for this. Thank you!

@liaodalin19903
Copy link

You need to implement this yourself.
You can extract the concrete syntax tree of a C++ code file and generate TypeScript code based on it.
there are differences between the two languages, and you'll need to define your own conversion rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants