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

How to parse the Java code? #13

Open
KidOfJealous opened this issue Dec 4, 2018 · 3 comments
Open

How to parse the Java code? #13

KidOfJealous opened this issue Dec 4, 2018 · 3 comments

Comments

@KidOfJealous
Copy link

I tried some methods but the results are a little different.
For example, when I get method o.m(), I do not know how to get the Class of o and add O.m to the API Sequence.

@guxd
Copy link
Owner

guxd commented Dec 5, 2018

you can use eclipse JDT to parse the AST. The AST contains class names of each method invocation.
You can find JDT through maven.
There are also python libraries for parsing Java code such as https://github.com/c2nes/javalang

@ttbuffey
Copy link

@guxd
I am working on the data pre-processing of extracting method, description, API sequence, tokens using python library - https://github.com/c2nes/javalang.
Regarding extracting token, I need to transform AST to java code at first, then transform the code to tokens. Do you have any idea of transforming AST nodes to java code, currently I haven't find suitable solutions. I want to ask if you have any idea, because you are experts in such fields.

Thanks a lot

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

3 participants