[antlr-interest] org.antlr.runtime.tree.RewriteEmptyStreamException

Jim Idle jimi at temporal-wave.com
Wed Jul 7 10:39:12 PDT 2010



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of David Maier
> Sent: Wednesday, July 07, 2010 9:42 AM
> To: Andrew Haley; antlr-interest at antlr.org
> Subject: Re: [antlr-interest]
> org.antlr.runtime.tree.RewriteEmptyStreamException
> 
> Hi again,
> 
> 
> thanks for your quick reply Andrew. But shouldn't the following rule be
> enough to make ANTRL aware of that it can be void:
> 
> sp_decls:  (sp_decl ';')* -> (sp_decl)*;

No, that only concerns the rewrite for that rule. Higher up, if there are going to be empty sets, you need to say so there too, or change:

sp_decls:

so that it does not have the * operator then use sp_decls* in the higher rule.

> 
> I mean that the Kleene operator (*) means to also match the empty word,
> right? So I think the following is true for rules named 'a', 'b' and
> 'c':

What you think it might or should do and what it does are not always the same thing ;-)

Jim






More information about the antlr-interest mailing list