[antlr-interest] tree parsing error messages

Terence Parr parrt at cs.usfca.edu
Tue Jan 4 12:20:17 PST 2005

Howdy folks,

It is common practice to create nodes in trees using imaginary tokens 
such as DECL or whatever.  The problem is that, because they are not 
associated with an actual input token with a line number, they have no 
line number.  Upon tree parse error you get "unexpected not DECL at 
0:0".  Not very helpful.

For 2.7.5, how about if I change getLine() so that by default it looks 
at the first child and asks for it's line information?  In one easy 
change, error messages should improve :)

CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!

More information about the antlr-interest mailing list