What standalone Java parsers are available?

I need a standalone Java parser (a program that reads .java source files and generates AST [ie, objects representing the contents of the source]).

  • There https://code.google.com/p/javaparser/ , but it only supports Java 1.5
  • I know how to run the Java Eclipse parser offline, but this parser uses too much Eclipse JAR, is too complex and uses the EPL license, which is incompatible with the GPL.
  • other IDEs (IntelliJ, NetBeans, JDeveloper) and the javac compiler should also have some Java parsers, but I can not find documentation for their use in "stand-alone" applications

Any help? Maybe some of you also tried to perform standalone Java analysis?

+5
source share
2 answers

Our DMS Software Reengineering Toolkit has a complete, complete Java 1.7 parser . But a parser is not enough if you intend to do something serious; Check out Life After Parsing. DMS has the support you need, besides being interesting to handle Java, such as attribute grammars, symbol tables, transformation rules, etc., as well as good documentation for all this. DMS is designed to support the construction of custom langauge analysis tools. However, it is not compatible with the GPL.

0
source

JavaCC has a Java 1.5 grammar.

0
source

All Articles