Our great sponsors
-
mainspring
A CPU simulator framework built around, and to support the other tools under, the constraints of the first principles of computing project.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
nom is another crate you may want to look at for parsing. I personally have no experience with serde_expr. There's also just going on https://crates.io/ and searching for terms like "parsing", "parser", etc. Look for packages that have a decent number of downloads and have been updated fairly recently.
First off, awesome, interpreters and emulators are really fun projects. I've written a very similar project which might be useful for reference https://github.com/ncatelli/mainspring. As for parsing to your enum representation KerfuffleV2 gave a great example for nom. That being said, if you'd like to peek behind the curtain a bit for combinators and the principles behind nom, Bodil Stokke has a WONDERFUL tutorial on the topic https://bodil.lol/parser-combinators/ which will be directly applicable to what you are trying to do. Additionally, while targetted at using java, https://craftinginterpreters.com/ by Bob Nystrom is available for free online and covers the topic of writing really simple recursive decent parsers.
Instead of nom, you may want to look into a more specialized parser-combinator framework that is targeting language parsing: https://github.com/zesterer/chumsky/