[antlr-interest] MismatchedTokenException not reporting line and column number

Ivanhoe Abrahams ivanhoeabrahams at gmail.com
Wed Feb 27 00:37:31 PST 2008


Hi

I am new to Antlr and am using  "The Definitive ANTLR Reference" as a
reference,
In
that book on page 238 it states that MismatchedTokenException
"indicates that the parser was looking for a particular symbol that it

did not find at the current input position".


Now, reading that, I would assume that when a
MismatchedTokenException occurs, I would be able to retrieve the line
and column number of the input position described in the above

definition, but I keep getting -1 for charPositionInLine field and 0
for the line field of that Exception. Could anyone please explain to me
how I can get the correct line and column number for the
MismatchedTokenException or if there is some othe place where I can get

that info?

BTW when my parser encounters a NoViableAltException I do get the
correct information...

Thank you in advance..

PS. The book has been really helpful.
Ivanhoe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080227/a1503693/attachment.html 


More information about the antlr-interest mailing list