|
Boost Users : |
Subject: Re: [Boost-users] [spirit] Parsing the following question
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-08-19 16:31:33
I believe I sort of figured it out.
As long as the fields to which the parsed values where captured were
__uint8_t, Phoenix had issues. When I changed the type to a simple
int, no problem. I can probably insert Qi literals next I think.
Thank you...
On Mon, Aug 19, 2013 at 3:18 PM, Michael Powell <mwpowellhtx_at_[hidden]> wrote:
> Hello,
>
> I would like to parse the following:
>
> "{0,0}" with the following constraints:
>
> rule<iterator> r %= '{' >> ( int_(0) | int_(1) | int_(2) )[phx::ref(m_mux) = _1]
> >> ',' >> ( int_(0x29) | int_(0x39) | int_(0x49)
> )[phx::ref(m_addr) = _1] >> '}';
>
> So that m_mux is capturing either 0, 1, or 2, and m_addr is capturing
> either 29H, 39H, or 49H (in decimal).
>
> Having some difficulty though with the following errors:
>
> Description Resource Path Location Type
> static assertion failed: error_invalid_expression detector
> line 176, external location:
> /home/mpowell/srcb/Dchem/SEEKERe/dchem-seekere/tools/installed/boost/include/boost/spirit/home/qi/nonterminal/rule.hpp
> C/C++ Problem
>
> Maybe I don't need the int_ at all?
>
> Thank you...
>
> Regards,
>
> Michael Powell
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