check if a line is valid or not in Java

Posted by Adnan on Stack Overflow See other posts from Stack Overflow or by Adnan
Published on 2010-06-10T20:35:01Z Indexed on 2010/06/10 20:43 UTC
Read the original article Hit count: 200

Filed under:
|

I would like to perform checking on the following:

VALID LINES;
/**/ some code
*/ some code   /** dsfsdkf sd**/

NOT VALID LINES;
/**/ //some code
*/ /***/ //somecode

So basically if there is a line of code outside a comment it is valid, otherwise not.

What would be the best way to tackle this kind of validation?

Note:
For */ I assume that the /* has been opened some lines before.

© Stack Overflow or respective owner

Related posts about java

Related posts about validation