[antlr-interest] gated semantic predicate usage

Jim Idle jimi at temporal-wave.com
Tue Jan 22 08:46:13 PST 2008


I have found that certain DFA decisions involving gated predicates do 
not generate quite the correct code, in that they work correctly when 
the gate is passed but give NVA errors when they do not. However, if you 
switch to the latest daily build (see downloads page) you will find that 
they (and som other DFA stuff) work perfectly as Ter has fixed 'em.

Jim

> -----Original Message-----
> From: Mark Volkmann [mailto:r.mark.volkmann at gmail.com]
> Sent: Tuesday, January 22, 2008 6:52 AM
> To: antlr-interest Interest
> Subject: [antlr-interest] gated semantic predicate usage
> 
> In the book in section 13.2 there is an example of using a gated
> semantic predicate to conditionally disable assert statements. When
> using this pattern in a parser grammar the result seems to be an error
> message like "mismatched input 'assert' expecting EOF" followed by a
> stack trace for a NullPointerException from the tree parser. I tried
> adding a catch at the end of the parser rule that contains the gated
> semantic predicate, but no exception is thrown. I'm confused about how
> to use this mechanism to disable certain statements and output a
> reasonable error message when they appear in input.
> 
> --
> R. Mark Volkmann
> Object Computing, Inc.




More information about the antlr-interest mailing list