[antlr-interest] Decision can match input such as ... using multiple alternatives / Semantic predicates were present but were hidden by actions.

Douglas Godfrey douglasgodfrey at gmail.com
Mon Nov 1 12:10:18 PDT 2010


The warning "Semantic predicates were present but were hidden by
actions." is issued without any line# if any rule has a semantic
predicate before the first token and the predicate is preceeded by any
action. In a large grammar this can be very difficult to locate.

This message is also incorrect since the actual problem is that ANTLR
cannot hoist the predicate into a parent rule if there is an
intervening action. This condition is distinct from the other cause of
"Semantic predicates were present but were hidden by actions." where
there are insufficient predicates to disambiguate the grammar. This
case of the "Semantic predicates" message should be changed to
something like "Semantic Predicate on line[nnn] cannot be hoisted due
to a preceeding action."


More information about the antlr-interest mailing list