|
Boost Users : |
Subject: Re: [Boost-users] [qi] Get line number of an on_error handler from an ifstream iterator
From: boost_mailinglist_at_[hidden]
Date: 2011-09-16 10:17:17
Am 14.09.2011 04:40, schrieb Joel de Guzman:
> On 9/14/2011 1:40 AM, boost_mailinglist_at_[hidden] 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,
Hello,
thank you for the answer.
Do you have a documentation for the examples inside the folder?
They seems not to be written just for fun or to test a new function.
The way to replace the error_handler could be a solution for my problem.
Best regards.
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