
14 Sep
2011
14 Sep
'11
2:40 a.m.
On 9/14/2011 1:40 AM, boost_mailinglist@gmx.de wrote:
Hello,
can anyone of you give me a hint, how I can get the line number of the input file inside the on_error handler where the parsing error happens?
Full source is atttached as file.cpp.
One way is to use the file_iterator adapter of spirit classic. There are other ways. In the compiler-tutorial (*), I decorate the AST nodes with a unique identifier to a map of iterators/or positions which can be used to compute the file position on demand. (* %BOOST%/libs/spirit/example/qi/compiler_tutorial ) Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com