Welcome to JavaRanch and thank you for correcting the naming problem.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32838
4
posted
0
Do you mean using reflection on the .class files or something like JFlex/CUP on the .java files?
I would try JFlex/CUP to create a parser.
nateshkumar natesamudaliar
Greenhorn
Joined: Feb 24, 2009
Posts: 3
posted
0
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.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35446
9
posted
0
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.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.