Boost logo

Boost Users :

Subject: Re: [Boost-users] [spirit] how to get_position() from a multi_pass<position_iterator <const char*> >
From: Daniel James (daniel_james_at_[hidden])
Date: 2009-08-23 08:59:17


Try the attached solution. I took the regular expression parser and
adapted it to use the base iterator for position_iterators. It's a bit
of a hack so it probably shouldn't be added to spirit. And I haven't
tested it much.

Other solutions would be to write a bidirectional position iterator or
just manually work out the positions after parsing. Or maybe track the
position in the lexer, but I think that'd be hard with spirit.

Daniel




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