Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-10-24 06:46:32


On 10/24/2005 04:08 AM, Korcan Hussein wrote:
[snip]
> I relized this when i was reading Spirit's documentation. I did mention from
> the begining all terminal leaf node types must be given, like in an MPL

What's a "terminal leaf node type"?

> sequence (and probably for nonterminal node types if you can add more to the
> set). I did also mention this was in no way been generalized or a library of
> any form it was just an idea i had the other day. It's not true that there
> is "no possibility user-defined leaves" it is just not as simple as erasing
> type.

The variant, var, in:

   http://tinyurl.com/72hx7

works by having:

        var<Tp>::basic_eval
           : boost::static_visitor<float>
         {

             Tp::value_type operator()(const Tp& val) const {
                 return val[curr_indx];
             }

             template < typename Expression >
             Tp::value_type operator()(const Expression& exp) const {
             }
         };

where Expression is some nonterminal in the grammar. Is Tp what
you refer to as a "terminal leaf node type"?

                


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