我基於我的應用程序關閉這個例子,並得到完全相同的結果。出於某種原因,輸入字符串的內容全部被解析爲融合結構'comments',並且沒有任何東西被解析爲融合結構'numbers'。所以不知道我在哪裏錯了。 namespace client {
namespace ast {
struct number {
int num1;
int num2;
我想用Boost.Spirit來解析嵌套列表的數字。這是我到目前爲止有: //define a test string
std::string string = "[[\t1 , 2 ], [3, 4, 65.4]]";
auto it = string.begin();
//parse the string
std::vector<std::vector<double>> vector
我正在考慮自永遠以來(自從Uni上的編譯器類以來,我主要已經忘記了)編寫基本上我的第一個解析器。 由於我使用C++,我正在考慮使用Boost Spirit。然後我注意到有「常規」2.5.2,並且有一些名爲Spirit X3的代碼有一些神奇的子集。 我也注意到Boost Spirit X3在兩年前已經發布/討論/預發佈,但Boost Spirit的正式版本是2.5.2。最後,我讀: Where is