Boost logo

Boost Users :

Subject: Re: [Boost-users] boost-spirit: need help with simple parser
From: Igor R (boost.lists_at_[hidden])
Date: 2012-07-03 06:46:19


> I would like to use boost::spirit for parsing ipv4 addresses. Here is
> what I have tried to do:

FWIW, your issue can be reproduced with much shorted code:

<skip include>
<skip Ipv4 definition>

namespace qi = boost::spirit::qi;
qi::uint_parser<uint8_t, 10, 1, 3> octet;
int main()
{
  Ipv4 ip;
  std::string s = "1.2.3.4";
  bool r = qi::parse(s.begin(), s.end(), octet >> '.' >> octet >> '.'
>> octet >> '.' >> octet, ip);
}

Perhaps, it's worth asking on Spirit ML.


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