Changing groovy syntax/grammar permanently using AntlrParserPlugin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Changing groovy syntax/grammar permanently using AntlrParserPlugin

Carlos Cortinhas
Hello everyone,

I've got a small project where I've got to alter the Groovy
syntax/grammar like adding a keyword, and every time that keyword
appears in the code an AST Transformation is invoked. And I've got a few
doubts on how can I do this:

The AntlrParserPlugin examples that I've seen apparently does some of
the work I want, I can just replace the keyword with the annotation of
the transformation, although I've got to first feed the
AntlrParserPlugin with the script that I want to compile and only after
that the "new" script that was generated will be ready to run normally.
Ideally I would like to put the plugin on the Groovy source if possible,
and make it that every time I compile new scripts they would pass
through the plugin automatically and seamlessly. Is there a way to do this?
I'm not even sure if this is a good approach to take..( probably not :p)

If any of you could provide me some alternatives and/or examples I would
be much grateful.

And I'm sorry if I wasn't clear on my questions, or if they are
'beginner' ones :p

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...