Static code analyzer for Java source code to extract methods / comments

I am looking for a parser that can extract methods from the java class (static source code → .java file) and method signature, comments / documentation, variables of each method. Preferably in the Java programming language.

Can anyone consult?

Thank.

+5
source share
3 answers

You can use ASTParser with eclipse. Its super easy to use.

Find a quick standalone example here .

+8
source

Here is what I do to extract method signatures from the java file / s:

Sublime Text 2, , , find Ctrl + F , Regex ( , , , )

((synchronized +)?(public|private|protected) +(static [a-Z\[\]]+|[a-Z\[\]]+) [a-Z]+\([a-Z ,\[\]]*\)\n?[a-Z ,\t\n]*\{)

Sublime Text 2 . " ", Ctrl + C, Ctrl + N Ctrl + V.
.

, .

+4

, , , , , , , . ANTLR Java, . , . , ANTLR Java.

, , Java, lexer Java, , , . ( "" ", " { " , " } ", ).

(, , , ) , (ANTLR .) Eclipse JDT, , ; , . DMS Software Reengineering Toolkit Java Front End , . DMS Java.

, , . , Java Source Browser, , . DMS/Java Front End JavaDoc ; , . Java, , , . , , ; HTML .

+1

All Articles