Boost logo

Boost Users :

From: ope (ope-devel_at_[hidden])
Date: 2008-02-19 13:51:35


> 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;
> }
> }

than I get:

$ g++ spirit.cpp -o spirit && ./spirit
[Date] = h
[Data Ver] = -1078612884
"[File Name] foo.csv"
^-- error ("F")
[File Name] =
[Notes] = y


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