Boost logo

Boost Users :

Subject: Re: [Boost-users] [spirit] first steps
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-18 13:50:28


> qi::string is not a valid parser primitive. What would you expect it to match anyway? You'll have to be a bit more specific about what kind of string you need to parse, for instance:
>
>    '"' >> ~+char_('"') >> '"'

Ok, I see...
Actually, I have to parse a list of strings, where every line consists
of numbers and "strings" delimited by ":" -- where "strings" may be
empty or may contain virtually any character (except for the
delimeter), like this:
1:23:string#1:optional&string_at_2
2:34:string#2:optional.string%3

besides, the last "string" in the line may be absent with the
preceeding delimeter, i.e. both "1:23:string#1:" and "1:23:string#1"
are valid (of course, "1:23::" is valid too)

Is it possible with Spirit? Would it be the right tool?

Thanks.


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