Thanks to the help of the user "sehe", I am now at the point where I can compile my ast.
(See here: https://stackoverflow.com/a/167688/ )
Now one of the data fields extracted from the JEDEC file that needs to be disassembled is as follows:
"12345 0000100101010111010110101011010"
I have already created a parser for using these fields:
std::string input("12345 010101010101010101010"); std::string::iterator st = input.begin(); qi::parse(st, input.end(), qi::ulong_ >> ' ' >> *qi::char_("01"));
Obviously, this is not so difficult. Now my problem is that I want to assign ulong_ and a binary string to some local variables using a semantic action. This is what I did:
using boost::phoenix::ref; std::string input("12345 010101010101010101010"); std::string::iterator st = input.begin(); uint32_t idx; std::string sequence; qi::parse(st, input.end(), qi::ulong_[ref(idx) = qi::_1] >> ' ' >> *qi::char_("01")[ref(sequence) += qi::_2]);
But unfortunately, this does not even compile, and the error message that I get is not useful (at least for me)? I think this is something simple ... but I'm hopelessly stuck now .: - (
Does anyone have an idea what I'm doing wrong?
fhw72 source share