-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to use tree-sitter-objdump with Node.js? #5
Comments
Have you tried looking at https://github.com/tree-sitter/node-tree-sitter? It has an example hello world setup for a Javascript parser. I'm guessing the steps there are the same for tree-sitter-objdump as long as you replace |
@ColinKennedy first error, I will try just cloning the repo and requiring, it doesn't look like it's published to npm.
Then I get:
With test script: const Parser = require('tree-sitter');
const Objdump = require('./tree-sitter-objdump');
const parser = new Parser();
parser.setLanguage(Objdump); |
Hey! I copied all the code from objdump into a local repo, then followed these instructions! I didn't think it would be so easy :) Thanks for the push!
Now to get it in JSON... Do you know how to export JSON from the CLI, or do I have to resort to some C API stuff? That output is from the CLI, not from JS, didn't get that working. |
I wouldn't know, sorry. tree-sitter-objdump is just a parser for objdump, I don't have expert knowledge on what exists in the tree-sitter ecosystem. To talk to someone about tree-sitter APIs / features, I recommend messaging on their Discord or GitHub discussions. I've messaged those folks on Discord before and they're quick + knowledgeable. Discord: https://discord.com/invite/w7nTvsVJhm |
Is it possible to use this objdump parser with node.js? If so, would you mind showing real quick a hello world? Basically to generate an AST.
Thanks so much!
The text was updated successfully, but these errors were encountered: