Re: C comment extraction, or a bag .deb of small commands
"H. S. Teoh" <hsteoh@quickfur.ath.cx> writes:
> But as someone pointed out, this totally doesn't handle /*'s and
> //'s appearing inside quoted strings. I overlooked that aspect of
> it. Nevertheless, it *must* be possible to write a regex for it,
> since mathematically speaking, a finite state machine is powerful
> enough to tokenize C. Of course, that doesn't say anything about how
> complex the regex might have to be to cover all cases. :-)
Rather than producing a new program, why not add the feature you want
to an existing C preprocessor (say, GCC), since that does the
tokenization correctly already?
--
http://www.greenend.org.uk/rjk/
Reply to: