I dont want to use reflection.
I have a Java file which has 4 or more independent classes(say A,B,C,D) in it.
I will have the Java file name and the name of all the 4 or more classes.
Given the class name (A or B or C or D), I need the methods inside that class. This is the main objective.
The main parser engines written in Java are Antlr, SableCC and JavaCC. Grammars for parsing Java source code are available for each of these on their respective web sites.
I have chosen JavaCC.
I extracted EclipseJavaCC plugin. Also I have the JavaCC jar file imported in my eclipse.
I have also downloaded java1.5.jj which has the grammar for Java I guess.
I dont know how to organize these things and use it in my project to give a Java source file and do the parsing and get the method information.
Also I would like to know if it works without using Eclipse(basically without any plugin) just by using one more JAR file.
Please give some JavaCC specific explanation.
You do not need any plugin to work with JavaCC (or any IDE, for that matter). There's a tutorial at http://www.engr.mun.ca/~theo/JavaCC-Tutorial/ and some further documentation on the main JavaCC web site.