logo       

Re: Fusion-ifying proto parse trees: msg#00013

parsers.spirit.devel

Subject: Re: Fusion-ifying proto parse trees

Eric Niebler wrote:
Joel de Guzman wrote:
Eric Niebler wrote:
Joel de Guzman wrote:

The issue of flattening is based on extensive deliberations on
and off list that will take lots of effort for me to explain in
one post. The discussions go back years.

It's crucial that I understand the context. Can you point me to the discussions?

Oh jeez, that will require a bit of searching. I intend to do that
anyway when I rewrite the design strategies pages, but I'll have to
defer that work for later.

Anyway, one definite rationale is ease of transformation and
attribute processing. Given a>>b>>c>>d, the attribute is
tuple<RA,RB,RC,RD> where RA...RD are the attributes of a...d
that you can obtain through traits::attribute_of<P>::type.
It's definitely more convenient to process seq(a,b,c,d) than,
say, seq(seq(seq(a,b),c),d) and all its permutations (e.g.
seq(seq(a,b),seq(c,d)). It is a must for semantic handling too.
Imagine semantic actions receiving different permutations of
tuple A..D in various grouped forms.


But you'll never have to worry about all the permutations, because you will have a view that makes it look flat.

tuple<RA,RB,RC,RD> attrs =
generate(transform_view((a>>b)>>(c>>d), attribute_of());

The grouping won't matter -- you'll get the same tuple each time. Likewise with semantic actions -- you'll never see any permutations.

But you already know this. I'm still very confused -- what is the problem?

Oh man, we're running around in circles.

1) I mentioned the need for flat sequences on associative operators
2) I realized that proto-ET can be a view or generate a view that
gives this flat impression. You wrote some code.
3) We realized that there's a performance penalty compile-time/runtime
however you implement it (subject to testing of course)
4) I noted that this elaborate dance wouldn't be needed
where if proto had generated the flat sequences where appropriate
in the first place.
5) Now you go back to 1 and ask me why I need flat sequences.

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise