void Parse(string const& input)
{
string::const_iterator begin = input.begin(), end = input.end();
auto pin_parser = qi::copy(+(qi::char_("a-z")));
auto val_parser = qi::copy(qi::float_ >> ':' >> *(qi::float_) >> ':' >> qi::float_);
auto connect_parser = qi::copy(
qi::lit("CONNECT") >> qi::space >> pin_parser[boost::phoenix::bind(callback, "PIN1", qi::_1)] >> qi::space
>> pin_parser[boost::phoenix::bind(callback, "PIN2", qi::_1)] >> qi::space
>> val_parser >> qi::space >> val_parser >> qi::space
);
bool is_succ = qi::parse(begin, end, +connect_parser);
std::cout << "Succ " << is_succ << std::endl;
}
I am trying to parse the following string using boost::spirit::qi.
CONNECT clk sda 1.020::1.030 0.200::0.00
CONNECT da doai 0.100::0.050 0.040::0.300
And then send the tokens parsed through callback. But getting following error. The compilation problem only comes when trying to parse long sequence. The compilation problem goes away if grammar sequence is shorter.
Say for example if i parse following, using the grammar below, then there is no compilation error.
CONNECT clk 0.200::0.00
CONNECT da 0.040::0.300
auto connect_parser = qi::copy(qi::lit("CONNECT") >> qi::space >> pin_parser[boost::phoenix::bind(callback, "PIN1", qi::_1)] >> qi::space
>> val_parser >> qi::space
);
spirit::tag::space, boost::spirit::char_encoding::standard> >, 0l> >, 2l>&>, 1l>]'
PASDFParser.cpp:81:62: required from here
/calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/container/vector/convert.hpp:27:13: error: invalid use of incomplete type 'struct boost::fusion::detail::barrier::as_vector<13>'
type;
^
In file included from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/container/vector/detail/as_vector.hpp:15:0,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/container/vector/convert.hpp:11,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/container/vector.hpp:30,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/view/zip_view/detail/at_impl.hpp:12,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/view/zip_view/zip_view.hpp:19,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/view/zip_view.hpp:12,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/sequence/intrinsic/swap.hpp:15,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/sequence/intrinsic.hpp:23,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/include/intrinsic.hpp:11,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/proto/fusion.hpp:22,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/proto/core.hpp:21,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/proto/proto.hpp:12,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/home/support/meta_compiler.hpp:19,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/home/qi/meta_compiler.hpp:14,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/home/qi/action/action.hpp:14,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/home/qi/action.hpp:14,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/home/qi.hpp:14,
from /calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/spirit/include/qi.hpp:16,
from PASDFParser.h:17,
from PASDFParser.cpp:10:
/calypto/tools/install/boost/boost_1_59_0/rhel7/m64/include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp:28:12: note: declaration of 'struct boost::fusion::detail::barrier::as_vector<13>'
struct as_vector;