-----Original Message-----
From: Mark Wright [mailto:[email protected]]
Sent: Wednesday, March 24, 2010 2:32 PM
Hi Stefan,
This is described in chapter 9 (in particular starting at section 9.5
on)
of the ANTLR book (The Definitive ANTLR Reference). One way that
is described in the book (which is highly recommended) which
would probably be easier for your situation is to use:
options { /* other options you need */
rewrite = true; }
if this is supported by the ANTLR runtime target you are using,
and whatever the equivalent of TokenRewriteStream is for that
target (it could be called something completely different).
------------------------------------------
Mark,
thanks for the reply. I was looking into the book, but just couldn't
find the way to do, what I wanted.
I was using the technique you mentioned. And I got to this point:
function
: ID
'('
(
arg1 = expression
(',' arg2 = expression
)*
)?
')'
-> template() "aaaaa"
;
This replaces the whole function with the text "aaaaa". But what I
really wanted to do is to get the replacement text from a function call.
Now I know, that what I wanted to do is:
-> { new StringTemplate(myFunction(myParams)) }
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.