> From: Gavin Lambert > Sent: Friday, February 27, 2009 6:17 PM > To: Laurent Caillette; antlr-interest > Subject: Re: [antlr-interest] Bug in ANTLR-3.1.2 with tree > grammar wildcard list label x+= ? > > At 13:07 28/02/2009, Laurent Caillette wrote: > >part > > : ( mediumbreak | largebreak )? > > > > ( p += levelIntroducer > > | p += paragraph > > | p += blockQuote > > | p += literal > > | p += bigDashedListItem > > | p += cellRowSequence > > ) > [...] > >/Users/Shared/Scratch/Novelang/antlrworks/java/NovelangParser.java: > >754: > >incompatible types > >found : NovelangParser.levelIntroducer_return > >required: NovelangParser.cellRowSequence_return > > p=levelIntroducer(); > > ^ > > > >It seems that p has taken the type of the first rule > >(levelIntroducer). Then attempting to set the result of > >cellRowSequence doesn't work. > > I'm surprised that you managed to get it to work as long as > you did -- that's been on my list of "don't do that" for most of v3. > > You can fix it by creating a subrule: > > content > : levelIntroducer > | paragraph > | blockQuote > | literal > | bigDashedListItem > | cellRowSequence > ; > > And then use p+=content in your original rule.
Bug or feature though? It seems inconsistent for what appear to be two semantically equivalent constructs to be totally fine in the one case and a silent failure in the other. -- Gary R. Van Sickle 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 -~----------~----~----~----~------~----~------~--~---
