in reply to parsing a java src file

Parsing java code is hard. It is easier to let javac do that. Then use javap to dump the compiled code headers (or all the code) in cannonical form. The standardized output form makes the output much easier to parse.

I used javap with the -c flag to put listener apis from java's foundation classes into a useful form in Java::Swing. You can see what I did by getting the distribution and looking in the Swing/Generate subdirectory for the all_listeners script. It has a Parse::RecDescent grammar which parsed the javap output for me.

Phil