I have used a combination of macro rules to define a DSL and used it to create some (literal of) compile-time determined data in a convenient way. These macro rules acted like a compile-time text parser eventually. So I thought, could we create a parsing library that allows writing parsing rules in a macro-rules-like syntax? Perhaps this would be easy to use and reduce the learning curve for Rust developers.
Defining how to output data can be done in a similar way to filling the parsed variables into a literal of a Rust type. I say "-like" and "in a similar way" because I'm not sure if we need to include a Rust syntax parser at runtime.
I tried some parser-generator crates, and eventually settled with peginator. It supports writing a EBNF-like grammar in a separate file, or inlining the rules via a macro
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.