-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write a chunk parser using nom parser combinators #51
Comments
Hey Benjamin, I've actually been interested in & working on this problem as well. There's no high-performance chunk parser which is a barrier to being able to do any sort of near-realtime processing of project data from chunks. Instead of parsing it into language-specific structs though, I've been working on converting it from not-quite-XML into valid XML, and exposing that through a C API + header. The idea being your language (C++, Rust, D, whatever) passes the chunk or #include <stdint.h>
typedef struct rpp_parse_result {
int error_code;
const char *results;
uint64_t len;
} rpp_parse_result;
rpp_parse_result RPPtoXML(const char *rpp_text, uint64_t length); Then you can use a language-specific XML parser to serialize it into your language's structs/classes, which is more universal. What do you think about this? 👀 |
Hi Gavin. Normalizing this to real XML sounds useful and would instantly make access to the chunk stuff easier from many languages! So I'm definitely intrigued. That said, I'm not sure if I would use it for reaper-rs because I would prefer building the parser directly in Rust (which I hope is not a big deal with a proper parser combinator library such as nom). |
I've made a first pass at it. |
Cool! Will try that as soon as I need to get down to chunk level again. |
@baadc0de This is awesome, thank you! |
To finally get a robust and fast way to dive into chunks from Rust (e.g. for detecting FX parameter modulation and other stuff for which we don't have an API yet).
The text was updated successfully, but these errors were encountered: