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
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
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
participants (1)
-
Michael Powell