antlr/antlr4 — Issue #39: Reevaluate the reportInsufficientPredicates message
Author: sharwell
Created: 2012-03-08 15:08:54+00:00
State: open

In light of antlr/antlr4#29, antlr/antlr4#31, and antlr/antlr4#32, it seems that the `reportInsufficientPredicates` message does not provide helpful information and is actually likely to mislead a developer. In particular, if predicated configs have the same priority as unpredicated configs (as required by antlr/antlr4#29), then the information most likely to help improve a grammar comes from the `reportAmbiguity` message which would be restored to situations involving predicates as part of antlr/antlr4#31.

Consider the following rules:

```
a : b1 | b2 | b3;
b1 : {false}? ID;
b2 : ID;
b3 : ID;
```

Currently, the decision in rule `a` will result in a `reportInsufficientPredicates` message, even though no predicates are present in `a` at all. The desired message is actually `reportAmbiguity` for alternatives {2..3}. Since performance can be severely impacted by the presence of predicated configs which evaluate to an unambiguous alternative, a message that predicate evaluation is being used to resolve a syntactic ambiguity for alternatives {1..3} would be useful. This message would not be sent when predicate evaluation is only being used to gate a syntactically unambiguous alternative.