Friday, June 18, 2010

RefactoringNG

RefactoringNG is a flexible and powerful Java refactoring tool, implemented as NetBeans module. Refactoring rules are described as transformations of source abstract syntax trees to destination abstract syntax trees. For example, the rule that rewrites x = x + 1 to x++ is as follows:

 // x = x + 1 -> x++
 Assignment {
    Identifier [name: "x"],
    Binary [kind: PLUS] {
       Identifier [name: "x"],
       Literal [kind: INT_LITERAL, value: 1]
    }
 } ->
 Unary [kind: POSTFIX_INCREMENT] {
    Identifier [name: "x"]
 }
The names and structure of abstract syntax trees are the same as in Sun Java compiler. The tool uses Compiler Tree API (com.sun.*), the formal language model in the JDK API (javax.language.model.*), and NetBeans infrastructure. For example, if you have ever needed to replace the constructor call with a factory method or add an argument to each method call, you may appreciate how easily such tasks can be done with RefactoringNG:

Factory method

 // new Position(<args>) -> Position.create(<args>)
 NewClass {
    null,
    List<Tree>,
    Identifier [name: "Position"],
    List<Expression> [id: args],
    null
 } ->
 MethodInvocation {
    List<Tree> { },
    MemberSelect [identifier: "create"] {
       Identifier [name: "Position"]
    },
    List<Expression> [ref: args]
 }

Another argument

 // plus (<expr1>, <expr2>) -> plus (<expr1>, <expr2>, 5)
 MethodInvocation {
    List [size: 0],
    Identifier [name: "plus"],
    List<Expression> [id: args, size: 2]
 } ->
 MethodInvocation {
    List<Tree> [size: 0],
    Identifier [name: "plus"],
    List<Expression> {
       ListItems [ref: args],
       Literal [kind: INT_LITERAL, value: 5]
    }
 }
For more information, go to http://kenai.com/projects/refactoringng. For download, go to http://kenai.com/projects/refactoringng/downloads

5 comments:

Luc Duponcheel said...

looks like an interesting project to me Zdenek

it also looks somewhat similar to the jackpot project (I do not know if Oracle Labs is still supporting on it)

btw

I've looked at your parser code.
I am convinced that you would appreciate the power and elegance of Scala for writing parser code
(Scala has a powerful and elegant parser combinator library)

keep on doing the good work

Luc

Zdeněk Troníček said...

Hi Luc, good comment. It is similar to Jackpot and I hope it is superior.
As for the parser, I certainly will have a look at Scala way.

Enjoy your stay in Prague!

mmo25 said...

The year 2013, exactly where they will recommended your mission's "team-based racing,Inches interpersonal features along with visual information, all of these obtain because of from the kiosk video clip.
Cheap FIFA 15 Coins

buy FIFA 15 Coins

Toko Jual Obat Kuat Alat Bantu Sex 087733776655 said...

Klik Aja Di Bawah Ini
Pemesanan: 087733776655
http://obatkuat-57.com/
Jual Obat Pembesar Penis Vigrx Plus
Alat Bantu Sex Pria Dan Wanita
Rajanya Obat Kuat Sex
Obat Perangsang Wanita, Obat Gairah Wanita
Obat Pembesar Payudara Monyok, Payudara Kencang
Alat Pembesar Payudara Montok
Alat Pembesar Penis
Alat Sex Pria Boneka Moderen
Obat Pengental Sperma
Minyak Pembesar Penis, Obat Pemanjang Penis
Obat Hernia Paling Ampuh
Obat Pelangsing Badan, Melangsingkan Tubuh
Obat Perapet Vagina
Obat Peninggi Badan, Meninggikan Bada
Obat Pembesar Pantat, Pembesar Bokong
Obat Pemerah Bibir, Pemerah Puting
Obat Pemutih Wajah Alami Tensung Cream
Obat Penggemuk Badan
Obat Penghilang Tatto Permanen Herbal Alami
Kondom Antik Pria
Rajanya Obat Kuat Pria
Alat Bantu Sex Wanita Antik
Alat Bantu Sex Pria
Obat Kuat Herbal
Vimax Obat Pembesar Alat Vital
Cara Memutihkan Selangkangan dan Ketiak


Obat Pelangsing Badan Fatloss Jimpness Beauty
Selaput Dara Perawan Buatan


iklan obatkuat said...

OBAT KUAT RANJANG. COM

Selamat datang di toko online kami,semoga kehadiran kami bisa membantu menyelesaikan masalah rumah tangga anda

Info pemesanan
call : 082133991881
BBm : 323fac0b

KAMI MENJUAL PRODUK -PRODUK DI BAWAH INI

VIMAX CANADA PEMBESAR PENIS

LINTAH PAPUA PEMBESAR PENIS

OBAT KUAT SEK

ALAT-ALAT SEX

PENIS TEMPEL ELEKTRIK

SEX TOYS PRIA DAN WANITA

PENIS MUTIARA GETAR GOYANG MAJU MUNDUR

VAGINA SILIKON MANUAL

VAGINA SENTER 7 SPEED

PENIS NAGA
ELEKTRIK


PERANGSANG WANITA CAIR

PENINGGI BANDAN

KONDOM DURI SILIKON

PEMBESAR PENIS

GALERI KOSMETIK

CELANA HERNIA

CONTAK KAMI :
Hub: 082133991881
Pin bb: 323fac0b





SITUS BOKEP ARTIS

TANTE TANTE KESEPIAN

VIDEO TANTE BUGIL