Boost logo

Boost Users :

Subject: Re: [Boost-users] [spirit] ignoring stuff
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-11-28 12:36:12


AMDG

jono wrote:
> i'm trying to ignore unecognized lines of input (so following lines
> can be processed without the parse failing).
>
> eg: very simple scenario as follows:
> <snip>
>
> i played around with eol_p as i want to skip whole lines of
> unrecognized content. i thought it would be easy, but i can't seem to
> get it right.
>
> can anybody do my job for me?

For something this simple, it might be easier to process line by line.

rule_t option = ...;

std::ifstream input(filename.c_str());
std::string current_line;
while(std::getline(input, current_line)) {
    parse(current_line, option, space_p);
}

In Christ,
Steven Watanabe


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