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? Best regards
On 2/2/13 9:01 PM, Boost_mailinglist@gmx.de 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
-------- Original-Nachricht --------
Datum: Sun, 03 Feb 2013 07:35:43 +0800 Von: Joel de Guzman
An: boost-users@lists.boost.org Betreff: Re: [Boost-users] [qi] parser stocks inside an endless loop
On 2/2/13 9:01 PM, Boost_mailinglist@gmx.de 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
Thank you for the response. Sometimes you need one, who shows you the point you have missed. Thanks.
participants (2)
-
Boost_mailinglist@gmx.de
-
Joel de Guzman