boost::Spirit Grammar for unsorted schema

五迷三道 提交于 2019-12-05 17:52:22

According to the Spirit forums, the following is the answer.

You might want to have a look at the permutation parser:

a ^ b ^ c 

Which matches a or b or c (or a combination thereof) in any sequence.

If the objective is to parse into a struct, than the best way to test weather all essential members have been initialized, the struct members should be wrapped with boost::optional<> The attribute presence may then be easily tested post-parsing during run-time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!