[antlr-interest] insert after tree?

Geoff hendrey geoff_hendrey at yahoo.com
Sun Jan 6 00:22:07 PST 2008


>From my Java program, I want to insert text after a *tree* not after a token.

I guess I am looking for a "TreeRewriteStream" as opposed to a TokenRewriteStream. 

As a workaroud I tried creating an imaginary token in my grammar file and using it to identify the rightmost side of a tree. Like this:

a 'func' a ->^('func' a+ IMAGINARY)

But then as I found out, the IMAGINARY Token doesn't seem to work with TokenRewriteStream.insertAfter.

Can anybody advise on how I can insert text immediately after a particular tree? (The text is static so perhaps there is a way to do it from the grammar file...)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080106/8097db76/attachment.html 


More information about the antlr-interest mailing list