I'm about to deep-six the KEEP_LINE_COL option. Any objections to that?

1 view
Skip to first unread message

Jonathan Revusky

unread,
Aug 11, 2008, 8:53:24 PM8/11/08
to kawadd...@googlegroups.com
I am about to get rid of the KEEP_LINE_COL option in KawaDD. This is an
option that is true by default, so the option I would be getting rid of
is the ability to turn it off, i.e. to throw away location information.

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

Reply all
Reply to author
Forward
0 new messages