|C-comments in flex email@example.com (1991-08-21)|
|From:||firstname.lastname@example.org (Stephen Quan)|
|Keywords:||C, flex, question|
|Date:||21 Aug 91 03:09:23 GMT|
I am designing a C/C++ compiler/program-verifier.
I have been looking for a definition of the /* ... */ comment in
C and have concocted the one above. If anybody has an improvements,
or know of a textbook solution, please, please mail me!
Thanks in advance.
email@example.com (Stephen Quan)
Department of Surveying,
University of Tasmania,
[That's a reasonable pattern except for one thing -- it processes the entire
comment as a single token, which tends to do unpleasant things to the token
buffer when it tries to eat a 25 line comment. My preferred solution is to
have "/*" put the scanner into a comment eating lexical state which is then
exited by "*/". Flex's exclusive start states make this easy. -John]
Return to the
Search the comp.compilers archives again.