Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit 2] on_error to string
From: Vincent Agnus (vincent.agnus_at_[hidden])
Date: 2011-04-06 12:38:49


thanks for our answer !

Your solution work, but it is not exactly I want. Indeed this expression
return the typename of a tag (for example literal-char) instead its
value ( "A" , "B" , .... ).

for example if my start rule is
start = qi::char_("a-z") > qi::char_("!");

and I parse the string "a#" then I expect that _4 contain "!" ,
phx::bind(&boost::spirit::info::tag, qi::_4) return "literal-char"

2 questions :
a) I have a look in boost::spirit::info class is the
boost::spirit::info::value member is containing the data I want ( ie "!")
b) perhaps it exists an alternative like
   phx::construct<>( phx::val("") << _4 )

thanks again

Vincent Agnus

Le 06/04/2011 17:07, TONGARI a écrit :
> 2011/4/6 TONGARI <tongari95_at_[hidden] <mailto:tongari95_at_[hidden]>>
>
> 2011/4/6 Vincent Agnus <vincent.agnus_at_[hidden]
> <mailto:vincent.agnus_at_[hidden]>>
>
> How can a get qi::_4 as string ?
>
>
> phx::bind(&boost::spirit::info::tag, qi::_4)
>
>
> Well, this may or may not be what you want, though...
>
> qi::_4 here stands for a boost::spirit::info object which seems not
> documented yet.
> Anyway, it's not a string, but it's outputable (traverse through its
> value, a tree structure), so its tag member (a utf8_string) is not
> identical to what will be output, you can see your
> BOOST_ROOT/boost/spirit/home/support/info.hpp
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net