Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to get the compilation unit produced by the compiler
How to get the compilation unit produced by the compiler [message #830403] Tue, 27 March 2012 11:24 Go to next message
Eclipse UserFriend
Hello there,

Instead of creating a compilation unit from AST, I was wondering if it is possible to get a hold on the compilation unit that the compiler produced.

Thanks in advance.
Re: How to get the compilation unit produced by the compiler [message #830928 is a reply to message #830403] Wed, 28 March 2012 04:30 Go to previous message
Eclipse UserFriend
The compilation unit that compiler produced is internal and it is exposed outside through the DOM/AST. Here are some internal ways to get hold of the internal CompilationUnit.
- If you use setResolveBindings(true) while creating the AST, the references to the internal CompilationUnit is still kept at DefaultBindingResolver#newAstToOldAst.
- Look at org.eclipse.jdt.internal.compiler.Compiler.compile(ICompilationUnit[]) and it's references and see if you want to call directly.
Note that internal types/methods are liable to change which could break your code.

Previous Topic:Move refactoring programmatically
Next Topic:Eclipse's rename refactoring in code
Goto Forum:
  


Current Time: Wed Jul 23 09:40:52 EDT 2025

Powered by FUDForum. Page generated in 0.10800 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top