https://javacc.dev.java.net/issues/show_bug.cgi?id=217 Issue #|217
Summary|Interaction between TRACK_TOKENS and NODE_SCOPE_HOOK
Component|javacc
Version|4.2
Platform|All
OS/Version|All
URL|
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|ENHANCEMENT
Priority|P3
Subcomponent|jjtree
Assigned to|sreeni
Reported by|tvernum
------- Additional comments from
tvernum@... Sun Jan 25 00:29:51 +0000 2009 -------
With both TRACK_TOKENS and NODE_SCOPE_HOOK turned on, the generated jj file will
look something like this:
jjtreeOpenNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
// Production rules
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
jjtn000.jjtSetLastToken(getToken(0));
}
Which means that the node that is passed to the open hook, has no idea of the
first token, and the close hook cannot be sure which is the last token.
This limits the amount of token processing that the node hooks can do.
At the very least the documentation should make this clear, although it would be
preferable if the hooks could make use of the node's token.
---------------------------------------------------------------------
To unsubscribe, e-mail:
issues-unsubscribe@...
For additional commands, e-mail:
issues-help@...