Skip to content

Is there any possible optimization for getting non-exhaustive outputs for ambiguous grammars #59

@expipiplus1

Description

@expipiplus1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions