我使用屬性傳播爲玩具語言構建語法樹。我在我的if語句的定義中遇到了一個問題,很難從錯誤消息中分辨出來,但我認爲rhs屬性沒有摺疊到預期的屬性中。它應該崩潰到我認爲的tuple <double,Statement,optional<Statement>>
。Boost Spirit自動排除問題
錯誤:C:\Program Files (x86)\CodeBlocks\MinGW\boost_1_43_0\boost\variant\variant.hpp|1293|error: no matching function for call to 'boost::detail::variant::make_initializer_node::apply<boost::mpl::pair<boost::detail::variant::make_initializer_node::apply<boost::mpl::pair<boost::detail::variant::initializer_root, mpl_::int_<0> >, boost::mpl::l_iter<boost::mpl::list3<boost::recursive_wrapper<Lang::CompoundStatement>, boost::recursive_wrapper<Lang::IfStatement>, Lang::VarStatement> > >::initializer_node, mpl_::int_<1> >, boost::mpl::l_iter<boost::mpl::list2<boost::recursive_wrapper<Lang::IfStatemen [error cuts out here]
謝謝。
P.S. 我無法讓代碼正確顯示,這裏有一個純文本版本:http://freetexthost.com/a3smzx0zk5
P.P.S. 我提供一些資訊。 它可以工作,如果我刪除"else" >>
並將> statement
更改爲>> statement
,但"else" >> statement
應崩潰到只是聲明。明確地將「else」創建爲qi :: lit並沒有幫助。
好想法,但它仍然無法正常工作。如果我刪除了其他東西,這是我唯一的線索。 – Dave 2010-08-23 19:53:58
好吧,那麼我想看一個我可以編譯的小型自包含測試。否則幾乎不可能知道什麼是錯的。 – hkaiser 2010-08-24 00:09:41