A little fun with Java this time. I want to write a program that reads a code from standard input (line by line, for example), like:
// some
I think a 100% correct solution using regular expressions is either inhuman or impossible (taking into account escapes, etc.).
I believe the best option would be using ANTLR- I believe they even provide a Java grammar you can use.