Boost logo

Boost Users :

From: Steve Folly (boost_at_[hidden])
Date: 2004-02-09 14:16:24


Hi,

Before I launch into it, does anybody have an example of a parser that can
count newlines. I would have thought this would be quite common, so I'm
surprised to see it's not standard within Spirit? (Or maybe I didn't look
hard enough?)

I'm writing a parser which will parse multi-line files. I'd like to report
an error along with a line number. I realise the error can't be detailed -
e.g. what the parser expected, rather, just 'an error' - which why I'd like
the line number to at least give the user a fighting chance. I assume the
parser simply stops at the point where parsing failed, and thus I'd know the
line number?

I'm guessing I'd have to supply this as a custom skip parser to the parse
method?

Thanks for any clues.

-- 
Regards,
Steve.

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