At 05:33 14/07/2009, Peterson, Joe wrote: >I've had to make a change to my grammar recently that requires me >to use a rule in a file that I use elsewhere. The rule is in a >separate file and I want to keep that to make it easier to >maintain. Because I have two locations that I need to use it, I >wind up with the warning: warning(138): another_file.g:0:0: >grammar another_file: no start rule (no rule can obviously be >followed by EOF). [...] >import a_file, another_file; >unit : list? group;
If you're only using a_file and another_file from this grammar, then changing unit to: unit : list? group EOF; ought to do the trick. If you are using another_file from other contexts (or if the above doesn't work), then you could try defining a throwaway rule in another_file.g: another_start : list EOF; (Don't actually call it, unless you're actually trying to use another_file.g as your top-level grammar somewhere else.) 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 -~----------~----~----~----~------~----~------~--~---
