I stumbled across some version history for JavaCC and actually,
KEEP_LINE_COL, i.e. the ability to turn it off was introduced as a
configuration option, maybe in 2003 or so. It seems like a very odd
thing to me. I have often wondered, under what circumstances would it
make sense to throw away the location information? Okay, it's true that
if you are very space-constrained, you could save 8 bytes per Token
object by not storing the location info, but... I just don't see it. It
doesn't seem like it would ever be a decent trade-off, a bit of space
optimization in exchange for eliminating your ability to trace back to
the origin of an error.
Probably every Token object has a memory overhead, of 60-80 bytes or so,
so the savings is utterly trivial at best. Besides, I have to think that
anybody so concerned about memory space utilization would not be doing
Java anyway....
The other thing I intend to do, BTW, is to include location info in the
basic Node.java/SimpleNode.java generated by the tree-building
machinery. It never made sense to me that the Token contained location
info by default, but all these ASTXXX nodes you generate did not. Of
course, you can add in location info, but you have to explicitly do so.
That does not make sense to me.
Anyway, if anybody has any objection to getting rid of KEEP_LINE_COL,
then please do say something. Maybe there is some aspect to this I
haven't considered.
JR