Firstly I'd like to clarify that I'm not looking for suggestions on existing documentation generators. My homework assignment is to build a documentation generator ( like a JavaDoc clone ).
Here's what I've done till now :
My first observation was that since the documentation is usually written after a code has been tested it is safe to assume that the code is free from syntactical errors. Using this observation I created regular expressions to identify class and function declaration statements. From those statements I extracted the groups in the regular expression to get details about the class/function ( for example: Name, inherited classes, return type etc ).
Now here's where I'm stuck. I cannot modify my logic to extract the comments and associate it with the description for the respective class / function for which it was written ( For this purpose I am assuming that the comment describing the behavior is written above the declaration for the class / function ).
I have tried to figure out a way to extend the logic of my program to extract comment descriptions however most opensource tools such as Doclava ( https://code.google.com/p/doclava/ ) are really complex and use some sort of parser and I have no idea what they are or how they work.