Hi all,
I need to write a program that reads, say, a java source code file and spits out where classes, methods, etc are.
For example, if input file has the following:
Code:class Game { Game(int i) { System.out.println("Game constructor"); } } class BoardGame extends Game { BoardGame(int i) { super(i); System.out.println("BoardGame constructor"); } } public class Chess extends BoardGame { Chess() { super(11); System.out.println("Chess constructor"); } public static void main(String[] args) { Chess x = new Chess(); } }
Then program should read and output:
class found: game
method found: game(int i)
class: boardgame
method found: boardgame(int i)
etc.
How can i achieve this?
Your help would be much appreciated.
A.


Reply With Quote


Bookmarks