"Uwe Ziegenhagen" <isestd14@wiwi.hu-berlin.de> wrote in message
news:bf8lih$rdq$1@lnews.rz.hu-berlin.de...
| my fellows and me implement a c++ tool that is able to divide blank/tab
| separated files into <number>, <text>, <c-singlelinecomment> and
| <multilinecomment>. So far it's not working bad, we have just one
| problem if I call the a.exe that gcc compiles with the following
| textfile (./a.exe < test.txt) he does not match the multiline comments
| correctly.
NB: specific tools such as Flex are OT in this NG ... but I'll take on...
| That's bad the hellos should be suppressed, only "comments" should be
| returned.
|
| Any idea?
I believe your multiline comment handling does not have to be that
complicated.
What about using a single rule such as:
"/*"([^\*]|\*[^/])"*/" { return mlcomment; }
hth,
--
Ivan Vecerina, Dr. med. <>
http://www.post1.com/~ivec
Brainbench MVP for C++ <>
http://www.brainbench.com