[proto] Unable to display_expr a spirit expression

Hello.
I have a following program:
#include

I have a following program:
#include
#include #include int main () { // boost::proto::display_expr(boost::phoenix::arg_names::arg1);
boost::proto::display_expr(boost::spirit::int_[boost::phoenix::arg_names:: arg1]); }
That works as expected:
subscript( terminal(N5boost6spirit3tag4int_E) , terminal(N5boost7phoenix5actorINS0_8argumentILi0EEEEE) )
When I include
(as the last include), however, the output of the program changes to: subscript( terminal(N5boost6spirit3tag4int_E) , terminal()
I am not sure if this is expected, unsupported, or a bug. Anyone?
That's expected as Proto does not know anything about Phoenix (V2). This will be different with the new Phoenix V3 (in development), which is built on top of Proto as well.
Just to put this in context, I am trying to figure out how does spirit intercept phoenix expressions (e.g., in semantic actions) to wrap them in proto terminals. The infrastructure of spirit is rather complex, so if anyone can point me in the right direction, I would really appreciate it.
Spirit has special code to deal with Phoenix V2 function objects. For instance, Phoenix semantic actions are handled here: spirit/home/support/action_dispatch.hpp, line 41. Regards Hartmut --------------- http://boost-spirit.com

On Sun, Nov 21, 2010 at 13:02, Hartmut Kaiser
I have a following program:
#include
#include #include int main () { // boost::proto::display_expr(boost::phoenix::arg_names::arg1);
boost::proto::display_expr(boost::spirit::int_[boost::phoenix::arg_names:: arg1]); }
That works as expected:
subscript( terminal(N5boost6spirit3tag4int_E) , terminal(N5boost7phoenix5actorINS0_8argumentILi0EEEEE) )
When I include
(as the last include), however, the output of the program changes to: subscript( terminal(N5boost6spirit3tag4int_E) , terminal()
I am not sure if this is expected, unsupported, or a bug. Anyone?
That's expected as Proto does not know anything about Phoenix (V2). This will be different with the new Phoenix V3 (in development), which is built on top of Proto as well.
Sure, I understand that phoenix2 is not written with proto. What I find hard to understand and to explain is that just including the phoenix operators (the only change between the programs) changes the output of display_expr. Also note that in the second program the output appears cut off. Is this what is supposed to happen?
Just to put this in context, I am trying to figure out how does spirit intercept phoenix expressions (e.g., in semantic actions) to wrap them in proto terminals. The infrastructure of spirit is rather complex, so if anyone can point me in the right direction, I would really appreciate it.
Spirit has special code to deal with Phoenix V2 function objects. For instance, Phoenix semantic actions are handled here: spirit/home/support/action_dispatch.hpp, line 41.
Thanks, I will look into this.
Regards Hartmut --------------- http://boost-spirit.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Hartmut Kaiser
-
Marcin Zalewski