S
Stefan Istrate
Hi everybody,
I want to extract information from a Java source file about the
packages, imports, classes, methods and, for every method, about its
local variables. The source file may contain syntax error, so I need
also a skip mechanism. Could you recommend me a good solution provided
by Sun to do this? I don't want to use tools written by any third
party, just Sun libraries. Maybe there is a possibility to invoke the
parser used by javac? A parse tree also would be great.
I've taken a look on sun.tools.java.Parser but it's not so good
documented. Also it seems that it needs to be improved because I'm
getting some NullPointerExceptions when it parses the class body.
Thanks,
Stefan Istrate
I want to extract information from a Java source file about the
packages, imports, classes, methods and, for every method, about its
local variables. The source file may contain syntax error, so I need
also a skip mechanism. Could you recommend me a good solution provided
by Sun to do this? I don't want to use tools written by any third
party, just Sun libraries. Maybe there is a possibility to invoke the
parser used by javac? A parse tree also would be great.
I've taken a look on sun.tools.java.Parser but it's not so good
documented. Also it seems that it needs to be improved because I'm
getting some NullPointerExceptions when it parses the class body.
Thanks,
Stefan Istrate