[antlr-interest] BUG? - Antlr hoists unhoistable predicates

Jim Idle jimi at temporal-wave.com
Mon Oct 8 15:15:19 PDT 2007


I think that this is a very sensible and considered explanation of the
issue.

Perhaps the real issue is that we need the "cookbook" that Ter has ruminated
on in the past. It is this kind of thing that is generally better explained
by example and documentation, though it is good that people can ask things
here and get considered advice :-)

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Benjamin Niemann
> Sent: Monday, October 08, 2007 11:35 AM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] BUG? - Antlr hoists unhoistable
> predicates
> 
> Good evening,
> 
> Austin Hastings wrote:
> > Johannes Luber wrote:
> >> Austin Hastings wrote:
> > If it's hard or impossible to internally suppress hoisting predicates
> > when they reference local context, that's fine - emit a diagnostic
> > message telling me that I'm making a mistake. I'll happily accept a
> > message telling me "you can't do that" instead of chasing around the
> > generated code in a java debugger trying to understand why my grammar
> > stopped working.
> 
> Unfortunately this bug is very hard to catch, because the contents of
> {..}?
> is code in the target language (after replacing $thingies), which is an
> opaque blob of character for the (target agnostic) tool.
> ANTLR might complain about suspicious $... replacements in hoistable
> predicates, but that covers only a part of the possible bugs.
> IMHO the approach that code in actions should be debugged using target
> specific tools is a good trade off to keep the complexity of ANTLR at a
> reasonable level.
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.4/1056 - Release Date: 10/7/2007
6:12 PM
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071008/9a8d9e6b/attachment-0001.html 


More information about the antlr-interest mailing list