From: joel de guzman (joel_at_[hidden])
Date: 2001-05-25 22:09:13
From: "Larry Evans" :
> "John (EBo) David" wrote:
> > From: "joel de guzman":
> > >
> > > From: "Douglas Gregor":
> > haven't though much about it, but how about "digit" or
> > "(a|b|c)[more]" instead...
> > couldn't that work?
> I think the problem here is what's the type of digit? If it's
> like arrays, then digit is rank2, digit is rank1, and digit
> is rank0. On the other hand, if you claim that all are rank 0, then
> how do you distinguish whether the i in Parser::operator(int i) is for
> or max repititions of *this?
I certainly can do this in the framework. In my other post:
> How about:
> a; // exactly 2
> a; // 0..2
> a[more]; // 0...
> a[more]; // 1...
> This can be done.
> Joel de Guzman
> PS> Do I hear yuck?
Greg Colvin said: Yuck. I rather see a.repeat(0,more) or repeat<0,more>(a).
But really, a little bit of indirection and object substitution, I can do
If you look into the Longest directive (Spirit_Directives.h), the operator
switches an Alternative<> object into a LongestAlternative<> object.
For  iterators I see a pseudo code:
ExactIterator Parser::operator(uint n);
first level..... e.g. a; do a 8 times
FiniteIterator ExactIterator::operator(uint n);
second level finite e.g. a; ... do a 8 to 16 times
and second level infinite e.g. a[more] ... do a 8 or more times
see my other post re: more and the More_ class
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