Closed Tkrauss closed 11 years ago
I'd prefer the option 2, too! But I can't see why one node should hold all the tokens of its subtree. This seems very redundant to me, and I can't imagine a situation where this would be necessary atm...?
In theory, this would be the choice of the implementation. Since we need this method only if something went wrong and additional just for a (probably small) subtree of the whole AST is the subject, there's no need to hold the value in each node in every situation. I would prefer an ad-hoc computation, but -- like i already said -- this is a matter of the implementation.
So... if there are no more pleas, i'll define the interface as it was described (option 2) at 8pm today.
We need the support to associate tokens with an ASTNode for the purpose of debugging. I propose two alternatives, each associated with one method of the ASTNode Option 1:
Option 2:
I prefer option 2, since it is easy implementable using the current iterator ( at least, in the javabite-implementation) and ther's no need for more classes. What do you think?