-
It is my understanding that currently lexy::parse only accepts a file returned by lexy::read_file. Is it possible to let lexy::parse accept a std::string? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The You want the std::string str = ...;
auto result = lexy::parse<production>(lexy::string_input(str), …); |
Beta Was this translation helpful? Give feedback.
The
lexy::parse
function accepts an arbitraryInput
. The buffer returned bylexy::read_file
is one, but there are multiple others: https://lexy.foonathan.net/reference/#inputYou want the
lexy::string_input
: https://lexy.foonathan.net/reference/input/string_input/std::string str = ...; auto result = lexy::parse<production>(lexy::string_input(str), …);