Re: ( A | B )* A



Sreenivas Viswanadha wrote:
kurstk@xxxxxxxxx wrote:

Hi,

I have ( A | B )* A in my grammar file, but javacc gives a warning
about the lookahead and it doesn't work.
Is there a better way to write this?
I just want the input to be zero or more combinations of A or B and
always end with A.


While you may be able to come up with something like ( A | (B* A) )+ for

Actually, you can just do (B* A)+, but I would still stick to using actions to give an error and continue.


Sreeni,
.