[antlr-interest] Syntactic predicate not being generated
    Terence Parr 
    parrt at cs.usfca.edu
       
    Sun Jul 31 20:37:42 PDT 2005
    
    
  
On Jul 31, 2005, at 10:18 PM, Olivier Dragon wrote:
> What happens is that you can't have a switch because of the predicate.
> ANTLR should detect that and revert back to if-statements. The switch
> causes problems because once LA(1) matches, the code is stuck in that
> case (unless there's no break but that defeats the switch purpose and
> complicates the logic). That makes predicates useless. ANTLR seems to
> decide that using the switch is more important than using the  
> predicate.
>
> I can reproduce with 2.7.5 and 2.7.6 (which comes with antlr eclipse).
Do you have a simple 2-liner that does this?
I'm terrified of changing the 2.x analyzer without unit tests, but  
perhaps it will be obvious when I look.
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
    
    
More information about the antlr-interest
mailing list