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

XML tree #218

Closed
Krosent opened this issue Feb 18, 2021 · 8 comments
Closed

XML tree #218

Krosent opened this issue Feb 18, 2021 · 8 comments
Assignees
Labels

Comments

@Krosent
Copy link

Krosent commented Feb 18, 2021

Hello guys,

I want to add support for another backend. From what I understood I need to parse the tree and convert it to XML. Could you give information on what XML structure should I provide to Gumtree? I am working on adding the support of a tree-sitter parser to gumtree.

@monperrus
Copy link
Contributor

monperrus commented Feb 18, 2021 via email

@jrfaller
Copy link
Member

Hi!

A tree-sitter backend would be really nice!

W.r.t. your question look at #164

Also we discuss a tree-sitter backend in #148

Cheers!

@jrfaller jrfaller self-assigned this Feb 19, 2021
@Krosent
Copy link
Author

Krosent commented Feb 20, 2021

Guys, I see System.getProperty("gt.cgum.path", "cgum"); lines to get parsed AST from external sources. Where can I find the assignment values? I want to add python based script that outputs tree in XML. The script is already implemented, but I do not know how to include it to the code base. Python generator has issues with build btw.

@Krosent
Copy link
Author

Krosent commented Feb 21, 2021

Guys, I see System.getProperty("gt.cgum.path", "cgum"); lines to get parsed AST from external sources. Where can I find the assignment values? I want to add python based script that outputs tree in XML. The script is already implemented, but I do not know how to include it to the code base. Python generator has issues with build btw.

This problem is kinda solved.

@Krosent
Copy link
Author

Krosent commented Feb 21, 2021

Here is the link to the repo with a tree-sitter parser for java written in python (https://github.com/Krosent/GumtreeJavaLangXmlGenerator).

@jrfaller
Copy link
Member

Hi @Krosent !

Thanks for the pointer, the code seems straightforward, making tree-sitter a great candidate for producing ASTs.

A quick question, when reading your code I had the impression that there nothing java specific about it, am I right? Maybe we could adapt the code to produce XML for all tree-sitter backends ?

Cheers.

@Krosent
Copy link
Author

Krosent commented Jun 22, 2021

Hi @Krosent !

Thanks for the pointer, the code seems straightforward, making tree-sitter a great candidate for producing ASTs.

A quick question, when reading your code I had the impression that there nothing java specific about it, am I right? Maybe we could adapt the code to produce XML for all tree-sitter backends ?

Cheers.

Yes, you can adapt it for other languages as well. Tree sitter is not absolutely language agnostic, but you can comparatively fastly add support for any language you want.

@jrfaller
Copy link
Member

Hi @Krosent just to warn you, I have introduced the GumTree tree-sitter-parser (https://github.com/GumTreeDiff/tree-sitter-parser), which is inspired by your take on tree-sitter integration! Thanks a lot!

Cheers.

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

No branches or pull requests

3 participants