Fork me on GitHub
#instaparse
<
2019-10-30
>
aengelberg05:10:54

@d4hines the idea has been tossed around a couple times, but the only implementation I'm aware of is my experiment https://github.com/aengelberg/instagenerate which isn't super useable in practice.

aengelberg05:10:26

My usage of core.logic was primarily motivated by a challenge to reverse-engineer output parse trees or fill in partial outputs. But if the main goal is to simply generate random inputs to a grammar (which most people really want), I think the implementation could be a lot cleaner, and leverage test.check.

aengelberg05:10:20

The hardest part I think would be coming up with a good solution to lookahead and negative lookahead, while guaranteeing terminable generation...

Daniel Hines13:10:34

I'm a noob when it comes to this stuff. Do you need lookahead for an EBNF grammar?

aengelberg15:11:40

I don’t think so, it’s just a nice feature that sometimes people take advantage of

Daniel Hines12:10:03

That's really cool!

jeroenvandijk13:10:13

Maybe this project is relevant https://github.com/cs-au-dk/dk.brics.automaton ? We used it to generate data, also from regexps

gfredericks14:10:37

When I wrote a generator for regexes I intentionally didn't try to support lookaheadbehinds

gfredericks14:10:12

But it seems like something you could support with the same caveats as such-that

gfredericks14:10:33

(And have it fail the same way, rather than infinite loop)