[antlr-interest] Rewriting a list of tokens to a list of custom tokens
chwchw at gmx.de
Wed Oct 19 05:39:40 PDT 2011
Hello ANTLR community,
I want to get
to a list of a custom token type, say TYPE. That is, each element/token
of the list should change its original type to the type TYPE.
The following approach does not work because invalid java code is generated:
t+='void' (t+='*')* -> ^(TYPE[$t]+)
The following implicit list generation works fine, however each element
retains its original type:
t+='void' (t+='*')* -> ^($t+)
Can anyone tell me, whether and how this could be done?
Thanks in advance,
More information about the antlr-interest