user6199298
user6199298

Reputation:

Java parser library for NetBeans

I want to make a java application that takes java source codes as input to create and visit their Abstract Syntax Trees, so I can make some statistics out of them.

I found this java parser: https://github.com/javaparser/javaparser

My questions are:

Upvotes: 2

Views: 535

Answers (2)

Aris2World
Aris2World

Reputation: 1234

Some years ago I've done a prototype to analyze Java source. I used this library Recoder (manual) that do the dirty work for me (parsing and building a good designed AST).

It's a jar so you can use it with any kind of IDE.

Usually I use Eclispe as Java IDE. It has its own AST model and you can consider to use Eclipse JDT Eclipse JDT.

Upvotes: 2

Federico Tomassetti
Federico Tomassetti

Reputation: 2268

I am not sure about NetBeans but you can create a project using maven or gradle and specify a dependency to JavaParser and you are done. It is that easy. Alternatively you may want to download the JavaParser jar from Maven central: it should not have any dependency so that would be enough.

Disclaimer: I am a contributor to JavaParser

Upvotes: 0

Related Questions