|
Boost : |
From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-05-31 20:06:33
----- Original Message -----
From: "Larry Evans" <jcampbell3_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, June 01, 2001 7:06 AM
Subject: Re: [boost] Spirit Rule<>s
> joel de guzman wrote:
>
> >
>
> [snip]
>
> >
> > I was trying to avoid virtual function at all costs. If only there
> > was a way in C++ to get the type of the rhs and pass it into
> > the lhs, I wouldn't have needed rules. In fact you can do away
> > with rules if you want to do more typing. Example:
> >
> > Alternative<ChLit<>, Sequence<ChLit<>, ChLit<> > > rule = a | b >> c;
> >
>
> How would you do this with the following BNF rule?
>
> A ::= 'a' A | 'b'
>
>
Right. We still need rules. :-) I stand corrected. A will
still need to be a rule. You can't use a nonterminal in the rhs if
it is not declared.
Only rules that does not reference itself can benefit from the
auto type declaration.
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