[Spirit] Incompatible skipper type?
Hello,
I'm a bit confused here, not sure what this means:
Severity Code Description Project File Line Suppression State
Error C2664 'bool boost::function4
On Thu, Jan 10, 2019 at 4:21 PM Michael Powell
Hello,
I should also mention, I am using the latest Boost 1.69.0.
I'm a bit confused here, not sure what this means:
Severity Code Description Project File Line Suppression State Error C2664 'bool boost::function4
::operator ()(T0,T1,T2,T3) const': cannot convert argument 4 from 'const Skipper' to 'T3' Kingdom.Json.Parser.Tests d:\dev\boost.org\boost_1_69_0\boost\spirit\home\qi\nonterminal\rule.hpp 304 // If you are seeing a compilation error here stating that the // fourth parameter can't be converted to a required target type // then you are probably trying to use a rule or a grammar with // an incompatible skipper type. if (f(first, last, context, skipper)) {}
Incompatible where? How? Requires clarification please. The default Skipper type, which I am using at the moment, is boost::spirit::qi::space_type. I aim to use the proven Comment Skipper that I leveraged in a previous iteration eventually, but I expect that compilation should work with the simple space type at least.
Because as far as I can determine all of the rules in my Grammar have the same Skipper type.
struct json_grammar : qi::grammar
{ using iterator_type = It; using skipper_type = Skipper; using char_rule_type = qi::rule ; json_grammar() : json_grammar::base_type(value_) { // ... } private: struct escapes_t : qi::symbols { escapes_t() { this->add("\\b", '\b') ("\\f", '\f') ("\\n", '\n') ("\\r", '\r') ("\\t", '\t') ("\\v", '\v') ("\\\\", '\\') ("\\/", '/') ("\\'", '\'') ("\\\"", '"') ; } } char_esc; //qi::rule
line_cont; char_rule_type hex_esc, unicode_esc; qi::rule quot_str, tick_str, str_lit; qi::rule
(), skipper_type> array_; qi::rule (), skipper_type> member; qi::rule >(), skipper_type> object_; qi::rule
member_key; qi::rule value_; qi::rule
numeric_sign; qi::rule float_lit; qi::rule floating_point; qi::rule hex_int, oct_int, dec_int, int_lit; qi::rule integer; qi::rule
bool_lit; qi::rule null_lit; }; Best regards,
Michael Powell
On Thu, Jan 10, 2019 at 4:22 PM Michael Powell
On Thu, Jan 10, 2019 at 4:21 PM Michael Powell
wrote: Hello,
I should also mention, I am using the latest Boost 1.69.0.
I'm a bit confused here, not sure what this means:
Severity Code Description Project File Line Suppression State Error C2664 'bool boost::function4
::operator ()(T0,T1,T2,T3) const': cannot convert argument 4 from 'const Skipper' to 'T3' Kingdom.Json.Parser.Tests d:\dev\boost.org\boost_1_69_0\boost\spirit\home\qi\nonterminal\rule.hpp 304
It does not matter whether I call: const auto parse_tried = qi::phrase_parse(begin, end, json_grammar_type{}, json_grammar_type::skipper_type{}, actual); Or this: const auto parse_tried = qi::parse(begin, end, json_grammar_type{}, actual);
// If you are seeing a compilation error here stating that the // fourth parameter can't be converted to a required target type // then you are probably trying to use a rule or a grammar with // an incompatible skipper type. if (f(first, last, context, skipper)) {}
Incompatible where? How? Requires clarification please. The default Skipper type, which I am using at the moment, is boost::spirit::qi::space_type. I aim to use the proven Comment Skipper that I leveraged in a previous iteration eventually, but I expect that compilation should work with the simple space type at least.
Because as far as I can determine all of the rules in my Grammar have the same Skipper type.
struct json_grammar : qi::grammar
{ using iterator_type = It; using skipper_type = Skipper; using char_rule_type = qi::rule ; json_grammar() : json_grammar::base_type(value_) { // ... } private: struct escapes_t : qi::symbols { escapes_t() { this->add("\\b", '\b') ("\\f", '\f') ("\\n", '\n') ("\\r", '\r') ("\\t", '\t') ("\\v", '\v') ("\\\\", '\\') ("\\/", '/') ("\\'", '\'') ("\\\"", '"') ; } } char_esc; //qi::rule
line_cont; char_rule_type hex_esc, unicode_esc; qi::rule quot_str, tick_str, str_lit; qi::rule
(), skipper_type> array_; qi::rule (), skipper_type> member; qi::rule >(), skipper_type> object_; qi::rule
member_key; qi::rule value_; qi::rule
numeric_sign; qi::rule float_lit; qi::rule floating_point; qi::rule hex_int, oct_int, dec_int, int_lit; qi::rule integer; qi::rule
bool_lit; qi::rule null_lit; }; Best regards,
Michael Powell
participants (1)
-
Michael Powell