[antlr-interest] MismatchedTokenException

Ayal Spitz aspitz at gmail.com
Fri Dec 29 18:41:54 PST 2006


Does anyone know if there is a way to get the incomplete token that is
causing the parser to throw a MismatchedTokenException?

Here is what I'm doing. I have the following grammar:
parser : STRING;
STRING : '"' .* '"';

When I parse the following text:
"Test

I get the MismatchedTokenException. The token tied to the exception looks
like this:
[@-1,0:0='<no text>',<-1>,0:-1]

What I really need is the token that represents the incomplete STRING token.

Anyone have any ideas how to get this?

Thanks - AYAL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061229/3aae3768/attachment.html 


More information about the antlr-interest mailing list