|
Boost Users : |
Subject: [Boost-users] Spirit: assertion fails under Windows but not Linux
From: Gaël de Chalendar (Gael.de-Chalendar_at_[hidden])
Date: 2011-11-30 05:12:28
Hello,
The code below fails under Windows with the following message (sorry in
French, I don't know how to force Visual C++ to work in English). This is
under Windows. It works under Linux
I use Boost 1.47 with cmake and Visual C++ 2008 uner Windows and Boost 1.46
and gcc 4.6.1 under Linux.
The assertion in boost grammar.hpp is accompanied by this comment:
// If you see the assertion below failing then the start rule
// passed to the constructor of the grammar is not compatible with
// the grammar (i.e. it uses different template parameters).
but I don't understand how to interpret it in my case...
Any idea ?
Regards,
Gaël
Code:
typedef BOOST_TYPEOF(skipper) skipper_type;
template <typename Iterator>
struct charchart_parser : qi::grammar<Iterator, charchart(), skipper_type>
{
charchart_parser() : charchart_parser::base_type(start)
{
using qi::eps;
using qi::lit;
using qi::_val;
using qi::_1;
using ascii::char_;
using ascii::space_type;
using qi::lexeme;
using qi::alnum;
using qi::hex;
using qi::eol;
start %= classes >> chars ;
<OTHER GRAMMAR RULES>
}
qi::rule<Iterator, charchart(), skipper_type> start;
<OTHER RULES DECLARATIONS>
};
Messages:
C:\PROGRA~1\boost\BOOST_~1\boost/spirit/home/qi/nonterminal/grammar.hpp(77) :
error C2664: 'boost::mpl::assertion_failed'ÿ: impossible de convertir le
paramÅ tre 1 de 'boost::mpl::failed ************(__thiscall
boost::spirit::qi::grammar<Iterator,T1,T2>::{ctor}::incompatible_start_rule::*
***********)
(boost::spirit::qi::rule<Iterator,T1,boost::spirit::qi::alternative<Elements>>)'
en 'boost::mpl::assert<false>::type'
with
[
Iterator=iterator_type,
T1=FrCeaLic2m::LinguisticProcessing::FlatTokenizer::charchart
(void),
T2=FrCeaLic2m::LinguisticProcessing::FlatTokenizer::skipper_type,
Elements=boost::fusion::cons<boost::spirit::qi::char_class<boost::spirit::tag::char_code<boost::spirit::tag::space,boost::spirit::char_encoding::standard>>,boost::fusion::cons<boost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::literal_char<boost::spirit::char_encoding::standard,true,false>,boost::fusion::cons<boost::spirit::qi::kleene<boost::spirit::qi::difference<boost::spirit::qi::char_class<boost::spirit::tag::char_code<boost::spirit::tag::char_,boost::spirit::char_encoding::ascii>>,boost::spirit::qi::eol_parser>>,boost::fusion::cons<boost::spirit::qi::eol_parser,boost::fusion::nil>>>>,boost::fusion::nil>>
]
Aucun constructeur n'a pu prendre le type de source, ou la râsolution
de la surcharge du constructeur âtait ambiguâ°
z:
\projets\moteurmultimedia\mm_linguisticprocessing\src\linguisticprocessing\core\flattokenizer\SpiritCharChartParser.hpp(132)ÿ:
voir la râfârence ⦠l'instanciation de la fonction modÅ le
'boost::spirit::qi::grammar<Iterator,T1,T2>::grammar<Iterator,FrCeaLic2m::LinguisticProcessing::FlatTokenizer::charchart(void),boost::spirit::qi::alternative<Elements>,boost::spirit::unused_type,boost::spirit::unused_type>(const
boost::spirit::qi::rule<Iterator,T1,boost::spirit::qi::alternative<Elements>>
&,const std::string &)' en cours de compilation
with
[
Iterator=iterator_type,
T1=FrCeaLic2m::LinguisticProcessing::FlatTokenizer::charchart
(void),
T2=FrCeaLic2m::LinguisticProcessing::FlatTokenizer::skipper_type,
Elements=boost::fusion::cons<boost::spirit::qi::char_class<boost::spirit::tag::char_code<boost::spirit::tag::space,boost::spirit::char_encoding::standard>>,boost::fusion::cons<boost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::literal_char<boost::spirit::char_encoding::standard,true,false>,boost::fusion::cons<boost::spirit::qi::kleene<boost::spirit::qi::difference<boost::spirit::qi::char_class<boost::spirit::tag::char_code<boost::spirit::tag::char_,boost::spirit::char_encoding::ascii>>,boost::spirit::qi::eol_parser>>,boost::fusion::cons<boost::spirit::qi::eol_parser,boost::fusion::nil>>>>,boost::fusion::nil>>
]
z:
\projets\moteurmultimedia\mm_linguisticprocessing\src\linguisticprocessing\core\flattokenizer\SpiritCharChartParser.hpp(131)ÿ:
lors de la compilation de la fonction membre '<Inconnu>' de la classe
<Inconnu>
Z:
\Projets\MoteurMultimedia\mm_linguisticprocessing\src\linguisticProcessing\core\FlatTokenizer\CharChart.cpp(303)ÿ:
voir la râfârence ⦠l'instanciation de la classe modÅ le
'FrCeaLic2m::LinguisticProcessing::FlatTokenizer::charchart_parser<Iterator>'
en cours de compilation
with
[
Iterator=iterator_type
]
-- Gael de Chalendar CEA LIST Centre de Fontenay-aux-Roses Laboratoire Vision et Ingénierie des Contenus (Vision and Content Engineering Laboratory) Bat. 38-2 ; 18, rue du Panorama ; BP 6 92265 Fontenay aux Roses Cedex ; France Tél.:01.46.54.80.18 ; Fax.:01.46.54.75.80 Email : Gael.D.O.T.de-Chalendar.A_at_[hidden]
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