I'm parsing an ambiguous grammar and I'd like to distinguish the following cases (more quickly than dealing with a list of all results):
- Failure to parse
- Exactly one parse with result
- Multiple parses (potentially with some small number of valid parses returned)
The use case is being able to tell the user: "Hey, you gave me ambiguous input, here are some places to check for ambiguity". Giving them 20000 results isn't helpful, especially as any large number is bound to be the result of some combinatorial explosion, and solving one ambiguity makes good progress.
I had a quick go at modifying fullParses in a few ways to prompt an earlier return but there wasn't a quick "no-understanding" fix.
I'm parsing an ambiguous grammar and I'd like to distinguish the following cases (more quickly than dealing with a list of all results):
The use case is being able to tell the user: "Hey, you gave me ambiguous input, here are some places to check for ambiguity". Giving them 20000 results isn't helpful, especially as any large number is bound to be the result of some combinatorial explosion, and solving one ambiguity makes good progress.
I had a quick go at modifying
fullParsesin a few ways to prompt an earlier return but there wasn't a quick "no-understanding" fix.