Micha wrote:
It isn't as cut and dried as the longest match - it is trying to make sense of your ambiguity basically, so when you don't get what you want, you have to guide it with more information. But, it isn't context sensitive so remember that the lexer runs first, then the parser runs with the results.On Saturday 16 May 2009 12:52:13 Jesper Larsson wrote: Then it would not be an LL recognizer but just a pattern matcher like lex. You can always use a different lexer, but in practice once you get the hang of where you need to direct it, it isn't particularly complicated. If you want the longest match, then left factor everything and let it do that: A ( B (C|) |) ; And set the token type at the appropriate points. Jim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
