Boost logo

Boost Users :

Subject: [Boost-users] Spirit and on_error
From: Michele Caini (michele.caini_at_[hidden])
Date: 2010-04-16 08:24:34


Hi all,
someone can explain to me how to use, if it's possible, on_error error
handler? I'd like to throw an exception reporting error data, because
I'm using spirit in a Qt-based application, and my idea is to catch
exception on upper level to pop-up a messagebox or something like that.

I start from documentation example, here:

on_error<fail>
(
  xml
  , std::cout
    << val("Error! Expecting ")
    << _4 // what failed?
    << val(" here: \"")
    << construct<std::string>(_3, _2) // iterators to error-pos, end
    << val("\"")
    << std::endl
);

Trying several possible solution, no one compiles fine. I don't know,
really, what I have to do, so please help me!! :-)

Thanks in advance,
Michele


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