原文
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 into a std::uint8_t. auto octet = dsl::integer<std::uint8_t>; // Match four of them separated by periods. return dsl::times<4>(octet, dsl::sep(dsl::period)) + dsl::eof; }(); // How the matched output is being stored. static constexpr auto value = lexy::callback<std::uint32_t>([](std::uint8_t a, std::uint8_t b, std::uint8_t c, std::uint8_t d) { return (a << 24) | (b << 16) | (c << 8) | d; }); };