> -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of David Maier > Sent: Wednesday, July 07, 2010 9:42 AM > To: Andrew Haley; [email protected] > 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 List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
