[antlr-interest] Rewriting in non tree grammar

Indhu Bharathi indhu.b at s7software.com
Thu Feb 26 12:55:30 PST 2009


Hi,

 

Suppose I want to do something like this

 

methodDecl       :               scope t=returnType ident LRAPEN RPAREN

                                {

                                                insertBefore(t,
"something");

                                                or

                                                replace(t, "something");

                                                or

                                                insertAfter(t, "something");

                                }

 

 

How can I do this in ANTLR? Note that 'returnType' is non-terminal. Also, I
don't want to use tree grammar or string templates. Is this possible with
TokenRewriteStream. Is there some documented example in the wiki?

 

Advance thanks for any help.

 

- Indhu

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090227/2e6dd1c9/attachment.html 


More information about the antlr-interest mailing list