[antlr-interest] Modifying Java Source

Ismet Ozalp ozalpismet at gmail.com
Sun Aug 9 18:18:29 PDT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090810/8c9e51d1/attachment.html 


More information about the antlr-interest mailing list