用提升气解析包含文字的字符串
Parse string containing literal with Boost Spirit Qi
我很想解析这样的字符串:
<stuff I don't care> <literal value> <more stuff I don't care>
用CCD_ 1。假设<literal value>
是例如ABC
,那么我希望解析器接受:
Some text ABC more text
但拒绝:
Some text ACB more text
不幸的是,
*char_ >> lit("ABC") >> *char_
由于戚的贪婪而无法工作。有没有一种简单的方法来编写这个解析器?
使用
*(char_ - lit("ABC")) >> lit("ABC") >> *char_;
以防止CCD_ 4消耗CCD_。
相关文章:
- 如何导出包含具有"std::unique_ptr"值的"std::map"属性的
- 从包含m行的文件中提取n行,必要时(惰性地)重复该文件
- 编译包含字符串的代码时遇到问题
- c++库的公共头文件中应该包含什么
- 将包含C样式数组的对象初始化为成员变量(C++)
- 是否需要删除包含对象的"pair"?
- constexpr 函数中的非文字(通过 std::is_constant_evaluated)
- 函数何时会在c++中包含stack_Unwind_Resume调用
- 我可以使用条件运算符初始化C风格的字符串文字吗
- 如何将包含epoch时间的十六进制字符串转换为time_t
- 使用mongocxx驱动程序时包含头文件问题
- 如何在h文件中包含.o对象文件
- 在混合代码库中将C转换为C++时出现许多包含错误
- VS2017,C++包含目录与附加包含目录,子文件夹包含失败-但为什么
- 我如何知道 boost::any 是否包含文字字符串
- 可以一个#define一个文字字符串,其中包含用于资源文件的非ANSI字符的字符串
- 为包含通用字符名的字符串文字省略u8前缀
- 如果右手边包含字符串文字的串联,则C++const std::字符串赋值错误
- 为什么包含字符串文字的初始化器对初始化“char”数组有效
- 用提升气解析包含文字的字符串