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
> 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:

    = 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:

    = 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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at