Re: [Spirit Development][Phoenix]Assignment of fusion tuples fails in semantic actions.
Robert Nelson <[email protected]> Thu, 30 Dec 2010 12:08:43 -0700
| Newsgroups | gmane.comp.parsers.spirit.devel |
|---|---|
| Message-ID | <[email protected]> |
It now seems clear why _val = _0 fails. I thought it would be nice if this statement would not simply invoke the assignment operator, but rather copy fusion tuples when they are detected. This might have undesirable side effects however, when someone actually did want the = operator. Are there any functions such as assign_fusion_tuple(a,b) that would iterator through and copy all the elements of b to a? It would be easy to write such a function, but maybe a bit harder to integrate it with phoenix. >Other than that, you can refine your semantic actions using direct >access to the fusion elements via phoenix's at_c & friends. I used to use at_c a lot, but I was hoping to avoid using at_c for every element of the tuple, it would get pretty ugly. My actual use case is I want to parse into a point*. I will was hoping to use syntax like [_val = new_<point>(),*_val = _0], but since there is no "magic" equals operator, I will probably just write a custom constructor. and use syntax like (int_ >> int_)[_val = new_<point>(_1,_2)]. I will end up with constructors with a lot of arguments in some cases, but it seems like the simplest approach. I will then only need the fusion adapt struct for Karma. Thanks --Robert Nelson ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl