【文件属性】:
文件名称:lexy:C++ 解析器组合器库
文件大小:526KB
文件格式:ZIP
更新时间:2021-07-24 06:36:58
parser parser-combinators text grammar C++
lexy
lexy是 C++17 及以后的解析器组合库。 它允许您通过在方便的 C++ DSL 中指定来编写解析器,这为您提供了手写解析器的所有灵活性和控制,而无需所有手动工作。
文档:
IPv4地址解析器
# include < lexy>
# include < lexy>
namespace dsl = lexy::dsl;
// Parse an IPv4 address into a `std::uint32_t`.
struct ipv4_address
{
// What is being matched.
static constexpr auto rule = []{
// Match a sequence of (decimal) digits and convert it in