[antlr-interest] Dumb newbie question dept: Anyway to simulate lexical states?

Loring Craymer lgcraymer at yahoo.com
Wed Jun 23 11:56:47 PDT 2010


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 <gerald at certiv.net>
> To: scott_boag at us.ibm.com
> Cc: antlr-interest at antlr.org
> 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


      



More information about the antlr-interest mailing list