|
Boost Users : |
Subject: Re: [Boost-users] [Boost.Spirit] Skippers for sub-grammars
From: Vitaly Budovski (vbudovski+news_at_[hidden])
Date: 2010-10-22 06:16:35
On 22 October 2010 21:10, Ovanes Markarian <om_boost_at_[hidden]> wrote:
>> qi::rule<Iterator/*, sub_grammar_skipper<Iterator> */> start;
>
> Change this line to:
> qi::rule<Iterator, void(), sub_grammar_skipper<Iterator> > start;
> This should work. void() is needed if you grammar has no attributes. If your
> grammar expands into smth. meaningful, than you must pass the type of the
> associated attribute, e.g. if you grammar outputs string, you will write the
> line like:
> qi::rule<Iterator, std::string(), sub_grammar_skipper<Iterator> > start;
> With kind regards,
> Ovanes
>
Hi,
using struct sub_grammar: qi::grammar<Iterator, void(),
sub_grammar_skipper<Iterator> > with or without the void() produces a
compilation error in gcc:
include/boost/spirit/home/qi/nonterminal/rule.hpp:280: error: no match
for call to â(const
boost::function<bool(__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>&, const __gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>&, boost::spirit::context<boost::fusion::cons<boost::fusion::unused_type&,
boost::fusion::nil>, boost::fusion::vector0<void> >&, const
boost::spirit::qi::reference<const
boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>, boost::fusion::unused_type, boost::fusion::unused_type,
boost::fusion::unused_type, boost::fusion::unused_type> >&)>)
(__gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >&, const
__gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >&,
boost::spirit::context<boost::fusion::cons<boost::fusion::unused_type&,
boost::fusion::nil>, boost::fusion::vector0<void> >&, const
boost::fusion::unused_type&)â
/usr/include/boost/function/function_template.hpp:1006: note:
candidates are: R boost::function4<R, T1, T2, T3, T4>::operator()(T0,
T1, T2, T3) const [with R = bool, T0 =
__gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >&, T1 = const
__gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >&, T2 =
boost::spirit::context<boost::fusion::cons<boost::fusion::unused_type&,
boost::fusion::nil>, boost::fusion::vector0<void> >&, T3 = const
boost::spirit::qi::reference<const
boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>, boost::fusion::unused_type, boost::fusion::unused_type,
boost::fusion::unused_type, boost::fusion::unused_type> >&]
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