On Mon, Jun 03, 2002 at 12:43:45AM -0200, [EMAIL PROTECTED] wrote: > > Heh - sounds like quite a project. Please excuse a silent lurker for adding some >more noise ... :-) > > >Good, glad to be pointed in the direction of some more efficient algorithms! > >Thanks for the regex links...I'll take it from here. > > Do not rely entirely on regex. I think they might fail f.ex. when evaluationg >multiline c-comments ( /* ... */ constructs). These are quite nasty to match >perfectly - consider ( |/* ... /* .. */ .. */| or |/* .. /* .. */| (no closing of >the second comment) (and add your own amount of (\r\n|\n)'s to the scenario :-)
Yes, perhaps the best approach is to detect context through some simple C code, to "parse out" comments and strings, then handling the remaining portions with regular expressions (if not with a dedicated tokenizer, especially if speed is a concern). Marco -- ======================================================================== Marco Pantaleoni [EMAIL PROTECTED] Padova, Italy [EMAIL PROTECTED] elastiC language developer http://www.elasticworld.org -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
