I have a grammar that contains the following production: objectMember : functionExpression | ID;
The unit tests for the above production, however, sometimes passed and sometimes failed. After some investigation, I found that the reason for the failure was that EOF wasn't in the expected follow set, which makes sense when I'm parsing the whole language. As a workaround, I changed my production, adding EOF as an optional terminal as follows: objectMember : functionExpression EOF? | ID EOF?; Everything now works but I'm curious if a better solution for testing individual grammar productions exists. Suggestions or alternatives? Thanks. --Kaleb http://twitter.com/kalebpederson http://kalebpederson.com 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 -~----------~----~----~----~------~----~------~--~---
