Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-11-30 07:17:42


Nick,

>The problem demonstrates itself when processing the regular expression for
preprocessor directives. If the >code encounters a significantly long
preprocessor directive it appears to go into an infinite loop inside regex.

To be honest I had some difficulty comming up with effective expressions
for parsing C++, it's not really what regexes were designed for. I had
seem to remember having some qualms about the expression for preprocessor
directives when I wrote that, and your example shows that it can in fact
get pathological with some inputs. I've had a rethink about this, and
rewritten the expressions used in snip4.cpp - everything now works as
expected - in fact I've put the entire boost headers through the revised
expressions without mishap. The key here is to always try and write
"unambiguous" expressions, it is apparent that I didn't take my own advice
though!

Anyway the CVS source/docs are updated now, and the revised snip4.cpp is
attached.

- John.




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk