Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-09-13 20:39:26


"Michael Burbidge" <mburbidg_at_[hidden]> wrote in message
news:3883DD44-E64B-11D7-B683-000393D55D34_at_adobe.com...
> I'm trying to control how tree generation happens for a typical
> comma separated list of integers which represent an argument
> list for a c-style language. Here's my rule for argument list:
>
> argument_list
> = integer_literal >> *(discard_node_d[ch_p(',')] >>
> argument_list)
> ;

If you can afford it, I would try a non-recursive form, like so:

argument_list
    = integer_literal
>> *(discard_node_d[ch_p(',')]
>> integer_literal
    );

I believe this will put the children on the same level. The
problem is that sucessive arguments will be matched by the
>> before they will be matched by the Kleene star. So really,
your form could look like this:

argument_list
    = integer_literal >> !(discard_node_d[ch_p(',')]
>> argument_list
    );

> [...]
> Is there some way that I can get this result using the node
> directives?

I don't see how.

Dave


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