Hiya. Use the tokenrewrite stream and Java.g combo. add actions to
replace between { } with new action. :)
Ter
On Aug 9, 2009, at 6:18 PM, Ismet Ozalp wrote:
> Hello everybody,
>
> I am a newbie; I am trying to modify java sources. What I am trying
> to do is
>
> clear the codes in the methods and change them with one line of code
>
> example method
>
> public void delete(T t) {
> PersistenceManager pm = PMF.get().getPersistenceManager();
>
> try {
> pm.deletePersistent(t);
>
> } finally {
> pm.close();
> }
>
> }
>
> changed method
>
> public void delete(T t) {
> throw new UnsupportedOperationException();
> }
>
> So i need to modify the grammar some how to do this for methods in
> the source file
> currently I am trying to do something with
> http://www.antlr.org/grammar/1152141644268/Java.g
> which is written by Terence Parr. But I am a little bit lost, if
> anybody can point me to the right direction
> where I can find more information or examples about how to achieve
> this, it would be great....
>
> Thank you very much
> Ismet
>
>
> 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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address