I am a newbie to JavaCC and am trying to translate the following set
of prolog production
Phrase(not av(Attr,yes))- - > [not, Attr].
Phrase(not av(Attr,yes)) - - > [not, a, Attr].
Phrase(not av(Attr,yes)) - - > [not, an, Attr].
Phrase(not av(Attr,Val)) - - > [not, Attr, is, Val].
Phrase(not av(Attr, Val)) - - > [not,Attr, are, Val].
Phrase(av(Attr, Val)) - - > [Attr, is, Val].
Phrase(av(Attr, Val)) - - > [Attr, are, Val].
Phrase( av(Attr,yes)) - - > [Attr].
I came up with
<NOT> (<_A>|<_AN>) <IDENTIFIER>
|
[<NOT>] <IDENTIFIER> [[<IS>|<ARE>] <IDENTIFIER>]
it gives a warning
[exec] Java Compiler Compiler Version 4.0 (Parser Generator)
[exec] (type "javacc" with no arguments for help)
[exec] Reading from file rule.jj . . .
[exec] Warning: Choice conflict involving two expansions at
[exec] line 347, column 9 and line 349, column 3 respectively.
[exec] A common prefix is: "not"
[exec] Consider using a lookahead of 2 for earlier expansion.
Whats the right way do do this?


|