Boost logo

Boost Users :

Subject: Re: [Boost-users] [qi] parser stocks inside an endless loop
From: Boost_mailinglist_at_[hidden]
Date: 2013-02-02 19:38:01


-------- Original-Nachricht --------
> Datum: Sun, 03 Feb 2013 07:35:43 +0800
> Von: Joel de Guzman <djowel_at_[hidden]>
> An: boost-users_at_[hidden]
> Betreff: Re: [Boost-users] [qi] parser stocks inside an endless loop

> 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

Thank you for the response.
Sometimes you need one, who shows you the point you have missed.

Thanks.


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