[antlr-interest] Re: Stuff I don't like about ANTLR 2.x

Terence Parr parrt at cs.usfca.edu
Mon Mar 15 12:24:52 PST 2004


Ack...yeah, Java's contract for exceptions means you cannot generate 
the try/catch if you have nothing to match.  Hm....I guess we could 
detect that.

Is it a pain to avoid these just because you have a lot or is there a 
semantics reason?

Thanks,
Ter

On Mar 14, 2004, at 9:48 PM, oliver_kellogg wrote:

> Hi all,
>
> It turns out that changing the grammar to avoid the
> empty rules is major work.
> I figure that the lack of support for them is somewhat
> debatable since in the ANTLR C++ code, they work - only
> in the Java target generator they don't.
>
> So, if I had a single wish for the next ANTLR, it would
> be this - support for empty rules by the Java code
> generator.
>
> (-: Oliver
>
>
> oliver_kellogg wrote:
>> It does work for the C++ targeted grammar, but it
>> doesn't for the Java targeted one which I am currently
>> working on:
>>
>> AdaParser.java:7061: exception antlr.RecognitionException is never
>> thrown in body of corresponding try statement
>>
>> This happens while translating the method empty_component_items()
>> which is produced by the rule
>>
>> empty_component_items :  /* empty */
>> { #empty_component_items =
>> #(#[COMPONENT_ITEMS,
>> "COMPONENT_ITEMS"], #empty_component_items); }
>> ;
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list