The major barrier to use of lexical states with ANTLR 3 is the rule option "backtracking = true" that is tacked onto the Tokens rule when it is constructed. That seems to interfere with predicate hoisting.
--Loring ----- Original Message ---- > From: Gerald Rosenberg <[email protected]> > To: [email protected] > Cc: [email protected] > Sent: Wed, June 23, 2010 9:26:00 AM > Subject: Re: [antlr-interest] Dumb newbie question dept: Anyway to simulate > lexical states? > > ------ Original Message (Wednesday, June 23, 2010 11:34:09 AM) From: > scott_boag ------ Subject: [antlr-interest] Dumb newbie question dept: Anyway > to simulate lexical states? > So, the concrete question is, is it > possible in ANTLR3 to filter out sets > of tokens based on a > predicates > The short answer is, yes. Without > knowing more about the problem you are having, I can only guess that you may > be failing to recognize that the lexer is effectively k=1. An easy > solution is to not leave gaps in predicate predictions. List: > href="http://www.antlr.org/mailman/listinfo/antlr-interest" target=_blank > >http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: > href="http://www.antlr.org/mailman/options/antlr-interest/your-email-address" > target=_blank > >http://www.antlr.org/mailman/options/antlr-interest/your-email-address 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.
