开发者

what is best java libraries to write custom refactoring scripts? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will l开发者_Python百科ikely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

I plan to do complex refactoring of large project, default ide capabilities is not enough. Please also provide tutorial link if possible.

Language: java, xml

I talk about programmatic api for java refactoring

Example I have created new api in project and I want automatically refractor some code to use it, ie source to source transformation of ast tree


There's always Eclipse; you should be able to access its Java refactoring machinery via its internal procedural APIs. Whether those are easily found or well documented, I don't know. No source-to-source transformations.

There is a tool called Jackpot that was supposedly designed to support this task. I believe it also only offers procedural APIs but I think they are intentionally well documented. No source-to-source transformation capability.

Our DMS Software Reengineering Toolkit with its Java Front End could be used for this.

DMS was designed to be general purpose program transformation engine for many languages (Java is just one it happens to know about). It can carry out arbitrary code changes. DMS provides parsing to ASTs, symbol table construction, an AST manipulation interface, including OP's request for pattern-directed source-to-source transformations, and regeneration of source text (including the original comments if unchanged) from any modified AST. DMS is happy to read all the files that make up your application, so you can effect changes that cross source file boundaries easily.

People may suggest using some parser generator. While parsing is necessary, it is hardly sufficient; a parser fails to do all the other things (above) that you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜