Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-02-05 11:10:30


Hi Eric,

I'm trying to build a parser, this time with boost.xpressive instead of
using boost.spirit.

In spirit I have this function that displays when parsing failed:

     template< class ParseInfo >
     void printParsingError( boost::sub_range<std::string> range,
                             const ParseInfo& info )
     {
         std::cerr << "\n\n"
                   << "Parsing of file failed. The parser matched:\n\n"
                   <<
"-------------------------------------------\n[start]";
         std::cerr << std::string( range.begin(), info.stop );
         std::cerr << "[stop]\n";
         std::cerr << "\nThe input was:\n\n"
                   <<
"-------------------------------------------\n[start]";
         std::cerr << std::string( range.begin(), range.end() );
         std::cerr << "[stop]\n";
         std::cerr << std::endl;
     }

Can I get the same info with xpressive somehow?

Thanks

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk