Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I've done a quick implementation using my scripting language; the parser is in parser.q at that link (auxiliary modules are lex.q for tokenising, and run.q to run the resulting program).
Maybe something like Rosie?
Instaparse sounds pretty close to what you're looking for assuming you're ok being limited to context-free grammars.
Raku's grammar/parser file (don't look, it's not pretty; the RakuAST overhaul is set to allow for it to be significantly tidied up), weighs in at around 6KLoC. It contains some ancillary code and up to a half dozen grammars depending on how one counts them, with a lot of the fiddly, finely detailed code that comes with the territory if you care about things like great error messages (which is certainly the case in the Raku world).