|
Boost Users : |
Subject: Re: [Boost-users] [qi] parser stocks inside an endless loop
From: Joel de Guzman (djowel_at_[hidden])
Date: 2013-02-02 18:35:43
On 2/2/13 9:01 PM, Boost_mailinglist_at_[hidden] wrote:
> Hello,
>
> the attached example will stock inside an endless loop if I use
>
> /*loop*/ Variable = *char_("a-zA-Z_0-9")>> ...
>
> but works if I use
>
> /*works*/ Variable = &char_("a-zA-Z")>> *char_("a-zA-Z_0-9")>> ...
>
> or
>
> /*works also*/ Variable = +char_("a-zA-Z_0-9")>> ... .
>
> Why does it happen? And how can I prevent this behaviour?
Keep in mind that *p will match p *zero* or more times. In other
words, it will always match and will even match the empty string.
Regards,
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net