After updating to 3.3, the following while-loop in my code for calling a
lexer never stops (i.e. The condition never becomes true):

while ((token = lexer.nextToken()) != org.antlr.runtime.Token.EOF_TOKEN)
{...}


In order to fix this problem, I changed my code to get the token before I
call the while-loop and check for the type directly, which works fine, but I
would prefer the above code because it's shorter.

I noticed the following line in the release notes:
- Instead of sharing Token.EOF_TOKEN, I'm now creating EOF tokens so I can
set the char position for better error messages.

That change seems to be the cause of my problem.

Thanks,
Frank 


_______________________________________________
antlr-dev mailing list
antlr-dev@antlr.org
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to