[antlr-interest] (v3) Header names

Terence Parr parrt at cs.usfca.edu
Sat Aug 5 08:48:23 PDT 2006


Hi Sean, did you see the tree construction page?  It shows NEWNODE 
['newnode'] constructors...
Ter
On Aug 5, 2006, at 8:37 AM, Sean Walton wrote:

> When I am rewriting some data, I would like to give some header  
> nodes a string name, e.g., 'newnode':
>
>    ... -> ^('newnode' $blah $bleah)
>
> I also create a token for 'newnode' and give it a symbolic name:
>
>    tokens {... NEWNODE='newnode';...}
>
> But, when I look at the generated tree, a number appears instead  
> (unlike other head nodes that use scanned token strings), and the  
> *Lexer lists NEWNODE with the number but has lost the string.
> Is there a way to get the original string?
>
> -Sean



More information about the antlr-interest mailing list