
Am 14.09.2011 04:40, schrieb Joel de Guzman:
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,
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.