Boost logo

Boost :

From: joel de guzman (joel_at_[hidden])
Date: 2001-05-25 19:18:20


----- Original Message -----
From: "joel de guzman" <joel_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, May 26, 2001 8:12 AM
Subject: Re: [boost] Re: [ANN] Spirit C++ parser framework.

> From: "Greg Colvin" > >
> > > JDG: How about something like:
> > >
> > > class More_ {} more;
> > >
> > > IteratedParser Parser::operator () (uint first);
> > > IteratedParser Parser::operator () (uint first, uint last);
> > > IteratedParser Parser::operator () (uint first, More_ last);
> >
> > That works too, but how is it really better than
> >
> > const int more = -1;
> > IteratedParser Parser::operator () (int first);
> > IteratedParser Parser::operator () (int first, int last);
> >
>
> Yes. Taking int parameters require an additional assert
> for invalid (negative) numbers apart from -1 for the
> second arg. uint parameters do not require checking
> for negative numbers.
>
> Cheers,
> Joel de Guzman

Furthermore, the first 2 functions do *finite* iteration
automatically without further checks for special cases.

> > > IteratedParser Parser::operator () (uint first);
> > > IteratedParser Parser::operator () (uint first, uint last);

The third always does *infinite* iteration.

> > > IteratedParser Parser::operator () (uint first, More_ last);

Cheers,
Joel de Guzman


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