-
Notifications
You must be signed in to change notification settings - Fork 174
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
gumtree implementation in swift programming language #164
Comments
Hi! It would be a nice feature! There are two solution, depending on if a parser for swift exists in Java. In this case you can use the parsers API to generate an AST compatible with Gumtree (see how it is done for instance in the module gen.js that uses Rhino. If this is not the case, you'll have to build an external tool that produces a XML file compatible with Gumtree, this how it's done in the gen.c module for instance. Which parser do you want to use? |
A parser for swift does not exist in Java but we have a parser for swift written in swift from https://github.com/yanagiba/swift-ast . I want to use this AST for swift. For this what should I do ? Should I make a tool from this swift AST that produces gumtree compatible XML file ? It would be helpful for me if you tell me about this. |
Yes you have to make an executable tool that uses your parser to produce a XML compatible with GumTree! You can take a look to the format here (in testSerializeTree()): https://github.com/GumTreeDiff/gumtree/blob/develop/core/src/test/java/com/github/gumtreediff/test/TestTreeIoUtils.java You can look how to implement the adapter here : https://github.com/GumTreeDiff/gumtree/tree/develop/gen.c/src/main/java/com/github/gumtreediff/gen/c Good luck with that! |
Thank you sir. I am trying this. |
Sir, can you please tell me what is Type, Label , Length and Position of a Node with an example? |
For instance consider the Python code We have the following tree : Therefore, type: lexical category of the node Cheers! |
Another question. Where I have to install cgum for seeing the diff for C programme? I am trying to see the C programme diff in gumtree but failed |
Hi! cgum is here : https://github.com/GumTreeDiff/cgum But if it's easier you can also look into the gen.python and https://github.com/GumTreeDiff/pythonparser tools that does exactly the same also. I just fixed these two yesterday so they use all the good practices for implementing an external generator. Cheers! |
Hi! Any progress on this issue? Cheers! |
Hi @aminul7506! If you are still interested by having Swift into GumTree I think I can use the tree sitter parser easily now? |
How can I implement gumtree for swift programming language using the existing codebase ? Should I implement a swift AST in java for this ?
The text was updated successfully, but these errors were encountered: