Subject: Re: [boost] [proto] grammar compile error
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2009-07-04 13:19:01
On Sat, Jul 4, 2009 at 1:57 PM, Eric Niebler<eric_at_[hidden]> wrote:
> Felipe Magno de Almeida wrote:
>> Is this possible?
> Not directly. You will have to allow "create << table" in your grammar
> (possibly by not specifying any grammar when defining your domain, or else
> by specifying a loose one), and then define a /separate/ grammar that
> validates fully formed expressions for correctness.
Yes, I found that out. I'm planning in creating a full_grammar, which
would only match a full expression. This can be passed as a
compile-time assert to the expression evaluation.
And I want to create the looser grammar, composed of all
sub-expressions inside the full grammar somehow. Is there a way to do
this in proto, or should I start creating it with mpl?
Is there a way to iterate a grammar?
> Presumably somewhere in
> your code there is a place where these expressions get evaluated. That's the
> place to ensure that "create << table" is always followed by a string
> literal. For that, you would use BOOST_MPL_ASSERT and proto::matches.
> Eric Niebler
> BoostPro Computing
-- Felipe Magno de Almeida
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk