boost-spirit-qi

    50熱度

    1回答

    在這個article about boost spirit semantic actions應提到的是 實際上有2個參數 傳遞:解析器上下文和 引用到布爾「重災區」 參數。解析器上下文是 ,只有當語義動作 附加到某個規則的右側 的某處時纔有意義。我們很快就會看到更多關於此的信息 。 布爾值可以設置爲false 裏面的語義動作無效 匹配回溯,使得 解析器失敗。 一切都很好,但我一直在試圖找到傳遞一個

    6熱度

    1回答

    我有一個記錄分析器,它會拋出幾個異常中的一個來指示哪個規則失敗。 前面的問題: #include <iostream> #include <sstream> #include <stdexcept> #include <string> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoeni

    9熱度

    1回答

    不應該有一個簡單的eol這樣做嗎? #include <algorithm> #include <boost/spirit/include/qi.hpp> #include <iostream> #include <string> using boost::spirit::ascii::space; using boost::spirit::lit; using boost::spir

    6熱度

    2回答

    我一直在努力嘗試和(增量)從文檔,但沒有太大的不同,我沒有得到我預期的行爲修改示例代碼。特別是,當if(我的意圖是)它應該傳遞時(有一個「else」但解析器的那部分在調試期間被移除)時,「if」語句失敗。賦值語句正常工作。我有一個「while」語句,它與「if」語句具有相同的問題,所以我相信如果我能找到幫助來弄清楚爲什麼一個人不工作,應該很容易讓其他人去做。它必須有點微妙,因爲這幾乎是逐字的例子之

    1熱度

    1回答

    幾乎所有的我已經走了,在看了這麼遠的例子:http://boost-spirit.com/repository/applications/show_contents.php使用舊的語法。我已閱讀並重新閱讀http://www.boost.org/doc/libs/1_42_0/libs/spirit/doc/html/index.html的實際文檔以及其中的示例。我知道Joel在博客http://

    2熱度

    2回答

    最近,我嘗試使用boost :: spirit :: qi二進制表達式解析器來解析一些二進制數據,這取決於平臺的字節順序。有一個簡單的例子,像下面: 使用聲明和變量: using boost::spirit::qi::little_word; using boost::spirit::qi::little_dword; using boost::spirit::qi::little_qwo

    0熱度

    2回答

    我正在學習如何使用boost精靈齊二進制的末尾解析器。我根據here和basics examples編寫了一個小測試解析器程序,但它不能正常工作。它給了我味精:「錯誤:不匹配」。 這是我的代碼。 #include "boost/spirit/include/qi.hpp" #include "boost/spirit/include/phoenix_core.hpp"