[antlr-interest] combining tokens in rewrite rule

Jose Ventura jose.ventura.roda at gmail.com
Mon Jan 22 00:08:47 PST 2007


You can build the tree manually:

{## = #( #[ID, "text required"] ,##);}


2007/1/21, Manu <manunews at gmail.com>:
>
> Hi,
>
> I want to combine tokens when generating the AST.
>
> For example, for a rule like this:
>
> namespaceSpec:  (ID) ('.' ID)*;
>
> i want to generate a tree rule that returns a new tree with only one
> ID token, that is the result of all ID and '.' concatenation. Is there
> a way to do this?
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070122/b88274e9/attachment.html 


More information about the antlr-interest mailing list