spirit: getting scanner position from real_p

Hi all, I'm using boost spirit. I have a semantic action attached to a real_p. Is there a wy to get the current scanner position from this semantic action? For all the generic semantic actions, I can use the position_iterator, but since real_p only accepts functions/functors with a float argument, I'm kind of lost. Thanks in advance, Marco

I'm using boost spirit. I have a semantic action attached to a real_p. Is there a wy to get the current scanner position from this semantic action? For all the generic semantic actions, I can use the position_iterator, but since real_p only accepts functions/functors with a float argument, I'm kind of lost.
(real_p >> eps_p)[...] should give you the pair of iterators. FWIW, in Spirit2 we have the raw[] directive for that. Regards Hartmut

Thanks! This works like a charm. Best, Marco On Aug 4, 2008, at 4:27 PM, Hartmut Kaiser wrote:
I'm using boost spirit. I have a semantic action attached to a real_p. Is there a wy to get the current scanner position from this semantic action? For all the generic semantic actions, I can use the position_iterator, but since real_p only accepts functions/functors with a float argument, I'm kind of lost.
(real_p >> eps_p)[...]
should give you the pair of iterators.
FWIW, in Spirit2 we have the raw[] directive for that. Regards Hartmut
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Hartmut Kaiser
-
Marco Biasini