使用Boost Spirit X3编写解析器是如何安全的?

时间:2017-07-10 14:07:05

标签: boost boost-spirit boost-spirit-x3 future-proof

我考虑从永远开始写作本质上是我的第一个解析器(=自Uni的编译器类以来,我已经忘记了)。

因为我使用C ++,所以我想使用Boost Spirit。然后我注意到了#34;常规" 2.5.2并且有一些名为Spirit X3的代码的神奇子集。

我'还注意到Boost Spirit X3已于2年前宣布/讨论/预先发布,但Boost Spirit的正式版本为2.5.2。最后,我读到了:

Where is boost-spirit 3? Is it abandoned?

所以我"知道"它不是一个废弃的项目 - 但不是一个非常积极维护的项目。怎么"安全"是不是我用Spirit X3编写了一个解析器?它可能会失败/被丢弃/被抛弃,还是肯定会成为Boost Spirit释放的主线?

1 个答案:

答案 0 :(得分:2)

It's already released, so there's little chance of it just vanishing.

I liberally use X3 even in production code: After all, we do have tests for a reason.

That said, I know a number of hairy issues surround the linking of rules spread across separate translation units¹.

Here's a list of things that make me consider not using X3 in the following cases:

Slightly less pressing differences are when:

Note however, there are definite areas where X3 shines:


¹ see the mailing list, and e.g. x3 linker error with separate TU and linking errors while separate parser using boost spirit x3

² In fact, it might be "easy" to create one by creating a custom parser, building on with<> and any_parser<>