[antlr-interest] Help me please to correct error

mzukowski at yci.com mzukowski at yci.com
Mon Nov 18 11:33:33 PST 2002


This is due to linear approximate lookahead.  See the FAQ or previous posts
about it.  To fix use syntactic predicates like:

test :
 ( (A D)=> A D )
 | (  A B
    | C D
   )
 ;

Look at the generated code and you'll get an idea about why it gives that
warning.

You get bonus points for reducing the problem to a very simple rule!  If you
can't find previous posts let me know and I'll dig some up within a day or
two.  Busy at work here....

Monty

-----Original Message-----
From: alekseyandreev [mailto:andreev at quorum.ru]
Sent: Monday, November 18, 2002 10:03 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Help me please to correct error


While I have warning for the grammar?
How shall I change it ? 
Can I get correct grammar without changing 
parentheses positions ?

test :
  (   A B 
    | C D 
  )
  | ( A D )
  ;

warning: nondeterminism upon
    k==1:A
    k==2:D
    k==3:EOF



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list