Boost logo

Boost Users :

From: ope (ope-devel_at_[hidden])
Date: 2008-02-19 13:47:57


sorry, I forgot the white space parser to add here:

template <typename GrammarT>
static void
parse(GrammarT const& grammar, std::string expr)
{
     std::string::iterator first = expr.begin();

     sp::parse_info<std::string::iterator> result
         = sp::parse(first, expr.end(), grammar, sp::space_p);

     if ( !result.hit ) {
         std::cerr << "\"" << expr << "\""
                   << std::endl;
         std::cerr << std::setw(result.stop - expr.begin() + 1)
                   << "^-- error ("
                   << "\"" << *result.stop << "\")"
                   << std::endl;
     }
     else if ( !result.full ) {
         first = result.stop;
     }
}

Thanks,
Olaf


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