PPC-Coder
PPC-Coder

Reputation: 3632

What do these ANTLR warnings mean

I have a grammar that appears to be working but generates a ton of warnings. How serious are these warnings and can someone give some guidance on how to fix them?

Warning 200
Decision can match input such as "LCURLY LPAREN" using multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input

Warning 200:
Decision can match input such as "LCURLY PLUS" using multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
Semantic predicates were present but were hidden by actions.

Warning 203
Input such as "Date" is insufficiently covered with predicates at locations: alt 1: line 346: at Date, al
t 2: line 346: at Date

For the warning(200), what impact would disabling an alternative? The main thing I think would be that the potential AST could have different shape depending on which alternative was disabled.

I'm not sure the implications of warning(203).

Upvotes: 2

Views: 391

Answers (1)

aled
aled

Reputation: 25664

Your grammar is probably ambiguous in that more than alternative path can parse the same input string. So the parser will not know which is the 'right' way. You should correct the grammar or the semantic predicates to prevent ambiguity.

Upvotes: 1

Related Questions