https://javacc.dev.java.net/issues/show_bug.cgi?id=146
------- Additional comments from saquigley dev.java.net Mon Oct 22 14:36:18 +0000 2007 -------
I think that the get/setValue(Object) functionality you
suggest goes a long way
towards accomplishing what I originally asked for. Actually
it is better
because it is really the value of the token that is of
interest, not the token
itself.
>From my point of view the whole point this request is to
be able to add lexical
constants and identifiers to ASTs. Here is the type of
production I would end
up writing as a result:
void Integer() :
{}
{ <INTEGER>
{jjtThis.jjtSetValue(jjtThis.jjtGetToken(0).getValue());}
// Assuming that you are providing a jjtGetToken(n)
method
}
I assume that this would be very common and it would be nice
to build this
functionality into the syntax, for example as:
void Integer() :
{}
{ <INTEGER> #0 // where 0 is the position of the
token whose value is going
to be grabbed and stored
}
However, the class Token does not have a value field right
now. This field
along with getValue and SetValue would have to be added to
Token. This would
be very nice since now one has to add them manually to
subclasses even though
this should be a standard field in tokens.
(Once that is done, then the OOP structure of Token would
need to be cleaned up
to make this process smoother, as I suggested in #141, but
that it another story)
------------------------------------------------------------
---------
To unsubscribe, e-mail: issues-unsubscribe javacc.dev.java.net
For additional commands, e-mail: issues-help javacc.dev.java.net
|