Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2001-05-31 18:06:38


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'


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