3 ms·
I'm actually just about to run into making a somewhat complex parser and haven't done it since school. Any recommendations resources you'd recommend as a refre
by ZeroCool2u 5y ago
I'm actually just about to run into making a somewhat complex parser and haven't done it since school.
Any recommendations resources you'd recommend as a refresher?
- SamReidHughes 5y agoBy basics I really mean extreme basics. The level of instruction I'm thinking is: <begin> A parser is a function that looks something like "optional<Foo> parse_foo(const std::string& data, size_t *pos)", which increases the value of *pos. It chews off objects from the front of the string and returns std::nullopt upon error. It's easy to recursively invoke smaller parsers this way. <end> Just that alone would really help people out and avoid problems I've seen encountered, where a dev needs to parse something, and just kind of spastically traipses around the string.
- ZeroCool2u 5y agoAh, well I’ve got that bit covered at the very least :)