Java static source analysis/parsing (possibly with antlr), what is a good tool to do this?
Posted
by Berlin Brown
on Stack Overflow
See other posts from Stack Overflow
or by Berlin Brown
Published on 2010-05-28T16:23:19Z
Indexed on
2010/05/28
16:32 UTC
Read the original article
Hit count: 188
I need to perform static source analysis on Java code. Ideally, I want the system to work out of the box without much modification from me.
For example, I have used Antlr in the past, but I spent a lot of time building grammar files and still didn't get what I wanted.
I want to be able to parse a java file and have return the character position of say:
- Character position start and end of a Java block comment
- Character position start and end of a Java class file
- Character position start and end of a Java method declaration, signature, and implementation.
It looks like Antlr will do that, but I have yet to finish a grammar that actually gives me the positions of the code I need.
Does anyone have that complete Antlr grammar and Java code to give the character positions of the parts in the Java source.
© Stack Overflow or respective owner