[antlr-interest] getting the correct line # from an exception

Bryan Ewbank ewbank at gmail.com
Fri Mar 3 20:32:49 PST 2006


In addition to the notes from Vladimir...

Make sure to count newlines in comments, and at the end of comments,
as well as those that are "visible" as whitespace.  If you are using
the C preprocessor, also make sure you track #line directives.

Mark Felzer wrote:
> When my grammar contains an illegal token an exception is properly thrown
> The exceptions message seems to always indicate the line # as being "1"
> which is sorta useless when it comes to debugging,


More information about the antlr-interest mailing list