• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read a comment from a java file.  RSS feed

 
Raaja Gotluru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any way that we can read a comment wrote in a java file basing on certain text. If I have a comment like below

/*******************************************************************************
* FILE NAME: HelloWorld.java
* PURPOSE: Displays a text
*
*
*
* Revision History:
* AUTHOR: CHANGE:
* Auto generated Initial Version
*
*
******************************************************************************/

and I want to get the FILE NAME AND PURPOSE from the above comment.
 
Tim Moores
Saloon Keeper
Posts: 4024
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd probably use regular expressions for that. Or maybe write a lexer (using JFlex), if I suspected that other requirements of that kind might be coming down the line.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!