[antlr-interest] revised subject: tree matcher problem with validating semantic predicate

Gavin Lambert antlr at mirality.co.nz
Thu Aug 6 02:51:54 PDT 2009


At 09:34 6/08/2009, Tom Smith wrote:
 >I have narrowed down my problem.  The validating semantic
 >predicate properly throws a FailedPredicateException in
 >a regular tree grammar, but does not when filter=true.
[...]
 >Am I wrong to expect this?

I've never really played with filter=true in tree grammars, but 
when used in lexers the whole point is to only define the rules 
you care about and anything that doesn't successfully match a rule 
is ignored.

Thus if the predicate fails, it's not an error -- it's simply not 
a match for that rule, and the parser will go try another 
alternative, or give up and skip it.

So I'm not surprised that the exception isn't being produced.



More information about the antlr-interest mailing list