Boost logo

Proto :

Subject: Re: [proto] grammars, domains and subdomains
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2010-12-10 03:23:01


Eric Niebler wrote:

> On 12/8/2010 5:30 PM, Thomas Heller wrote:
>> I don't really now how to do it otherwise with the current design.
>> There is really only this part of the puzzle missing. If it is done, we
>> have a working and clean Phoenix V3.
>> For the time being, I can live with the workaround I did.
>> However, I will focus my efforts of the next days on working out a patch
>> for this to work properly.
>
> I made a simple fix to proto::matches on trunk that should get you
> moving. The overloads can still be smarter about sub-domains, but for
> now you can easily work around that by explicitly allowing expressions
> in sub-domains in your super-domain's grammar. See the attached solution
> to your original problem.

I am afraid that this does not really solve the problem.

I think there is a misunderstanding in how "sub-domain"ing works.
The solution you propose is that a sub domain extends its super domain in
the way that the expressions in the sub domain also become valid in the
super domain. I guess this is the way it should work.
However, the solution I am looking for is different.
The sub-domain i tried to define should also extend its super domain, BUT
expressions valid in this sub-domain should not be valid in the super
domain, only in the sub-domain itself.

I think proto should support both forms of operation. The first one can be
easily (more or less) achieved by simply changing proto::matches in the way
you demonstrated earlier, I think. I am not sure, how to do the other stuff
properly though.


Proto list run by eric at boostpro.com