
template <typename GrammarT> static void parse(GrammarT const& grammar, std::string expr) { std::string::iterator first = expr.begin();
sp::parse_infostd::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; } }
than I get: $ g++ spirit.cpp -o spirit && ./spirit [Date] = h [Data Ver] = -1078612884 "[File Name] foo.csv" ^-- error ("F") [File Name] = [Notes] = y