On Tue, Mar 16, 2010 at 8:10 AM, Brian Catlin <bri...@sannas.org> wrote:
> While that gets rid of those warnings (why don't the warnings print a > reasonable line number? I would call that a BUG), Note that the '!' is a valid operator inside your grammar, ANTLR just assumes that you're building trees. So, you're not doing anything wrong. But, yes, a warning with the line number of the improper use of rewrite operators would be nice. On Tue, Mar 16, 2010 at 8:10 AM, Brian Catlin <bri...@sannas.org> wrote: > the fundamental problem > of being able to parse (or otherwise capture the file name) still exists. > > Any ideas? > The error message is telling that your FILE_NAME is ambiguous. When matching one or more characters from: ~('|' | '<' | '>' | '*' | '?')+ then line breaks will also be matched, yet after that, the following could be matched: ('\r'? '\n') which has already been "eaten" by the previous part of your rule. You could fix that by adding line breaks to that first part of your rule, like this: FILE_NAME : ~('|' | '<' | '>' | '*' | '?'| '\r' | '\n')+ (('\r'? '\n') | EOF); Regards, Bart. 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.