[antlr-interest] Alternative(s) 2 were disabled for that input

jack zhang jackgzhang2 at yahoo.com
Thu Sep 18 16:46:23 PDT 2008


Hi,
  I keep getting following errors:

warning(138): Query.g:0:0: grammar Query: no start rule (no rule can obviously be followed by EOF)
warning(200): Query.g:27:40: Decision can match input such as "OR" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): Query.g:31:39: Decision can match input such as "AND" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): Query.g:39:7: Decision can match input such as "WORD" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input

  I kind of understand why because if the input is "OR" the parser will just freak out. What I want do is a simple boolean query input validator

(1) valid input:
a OR b
c AND d
a OR b AND d

(2) invalid input:
a AND  
AND b (This is not working)

What's wrong with the grammer? I really cannot figure it out.

Thanks !




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080918/6aa7a900/attachment.html 


More information about the antlr-interest mailing list