Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Fastest way to get ASTs for lots of related ITypeRoots?
Fastest way to get ASTs for lots of related ITypeRoots? [message #1709692] Wed, 30 September 2015 12:56 Go to next message
Andreas Sewe is currently offline Andreas SeweFriend
Messages: 111
Registered: June 2013
Senior Member
Hi,

what is the most efficient way to get JDT to parse (with resolved bindings) a whole lot of (related) ITypeRoots, e.g., all ITypeRoots in an IPackageFragmentRoot. Currently, I am using SharedASTProvider.getAST(typeRoot, WAIT_YES, monitor) in a big loop, but that is rather slow. I suspect that JDT is doing lots of duplicate work under the hood, so I wonder whether a more efficient solution exists.

Any pointers would be greatly appreciated.

FWIW, I have a workbench running; the solution need not be restricted to API available in a headless environment.

Best wishes,

Andreas
Re: Fastest way to get ASTs for lots of related ITypeRoots? [message #1709747 is a reply to message #1709692] Wed, 30 September 2015 16:55 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi Andreas,

I assume your type roots are in fact ICompilationUnits? If so, have you seen/tried org.eclipse.jdt.core.dom.ASTParser.createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor) ?

Stephan
Re: Fastest way to get ASTs for lots of related ITypeRoots? [message #1709748 is a reply to message #1709747] Wed, 30 September 2015 16:57 Go to previous messageGo to next message
Andreas Sewe is currently offline Andreas SeweFriend
Messages: 111
Registered: June 2013
Senior Member
No Message Body
Re: Fastest way to get ASTs for lots of related ITypeRoots? [message #1709750 is a reply to message #1709747] Wed, 30 September 2015 16:59 Go to previous messageGo to next message
Andreas Sewe is currently offline Andreas SeweFriend
Messages: 111
Registered: June 2013
Senior Member
Stephan Herrmann wrote on Wed, 30 September 2015 12:55
Hi Andreas,

I assume your type roots are in fact ICompilationUnits? If so, have you seen/tried org.eclipse.jdt.core.dom.ASTParser.createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor) ?


Yes, they are. Thanks for the pointer. I'll try this out.
Re: Fastest way to get ASTs for lots of related ITypeRoots? [message #1709826 is a reply to message #1709750] Thu, 01 October 2015 11:57 Go to previous message
Andreas Sewe is currently offline Andreas SeweFriend
Messages: 111
Registered: June 2013
Senior Member
Follow-up question: What to do if the ITypeRoots I have are IClassFiles (with attached sources)? Is creating BasicCompilationUnits from the IClassFiles, like ASTParser.internalCreateAST does, the way to go?
Previous Topic:Reg: Unable to store the dynamic XML - Critical- help required
Next Topic:Listening to Drop events in the Package Explorer view
Goto Forum:
  


Current Time: Fri Mar 29 08:37:55 GMT 2024

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

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

Back to the top