Boost logo

Boost :

Subject: Re: [boost] [xpressive] recursive calls for matching repetitions.
From: Eric Niebler (eric_at_[hidden])
Date: 2008-10-05 11:58:33

Raindog wrote:
> Eric,
> I was recently hit by a stack overflow due to the way xpressive makes
> recursive calls when dealing with patterns like *_, etc and was
> wondering if there is an alternative, more efficient way of matching
> these types of patterns.

Actually for a pattern like *_, xpressive doesn't use recursion. Only
for more complicated (that is, variable-width) repeated sub-expressions
does xpressive use recursion.

> p.s I know about keep() but that can get cumbersome to use everywhere.

I'm afraid that's what I was going to suggest. Don't use it everywhere
... just where you can afford to turn off backtracking.

Eric Niebler
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at