Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Access AST generated by JDT at build time
Access AST generated by JDT at build time [message #509967] Mon, 25 January 2010 17:21 Go to next message
Eclipse UserFriend
Hi all,

I am faced with a problem that i can't seem to solve on my own. I want to generate some xmls out of the ASTs created by the JDT from java files and for that I have created a compilation participant and i have overridden the buildFinished method.
Problem is that, for me to get my hands on the AST of a compilation unit I have to reparse that unit. Is there any way to receive from JDT the ASTs generated at build time? It seems such a big waste of time to regenerate them....
Any ideas?

Thanks,
Andrei Serea
Re: Access AST generated by JDT at build time [message #509997 is a reply to message #509967] Mon, 25 January 2010 23:33 Go to previous messageGo to next message
Eclipse UserFriend
Le 2010-01-25 17:21, Andrei Serea a écrit :
> I am faced with a problem that i can't seem to solve on my own. I want
> to generate some xmls out of the ASTs created by the JDT from java files
> and for that I have created a compilation participant and i have
> overridden the buildFinished method.
> Problem is that, for me to get my hands on the AST of a compilation unit
> I have to reparse that unit. Is there any way to receive from JDT the
> ASTs generated at build time? It seems such a big waste of time to
> regenerate them....
> Any ideas?
The compiler uses its own AST tree. So you would need to create the
DOM/AST anyway. It is only if you are listening to reconcile operation
that you can retrieve the AST.
Are you requesting bindings when you parse again the unit ?
--
Olivier
Re: Access AST generated by JDT at build time [message #510084 is a reply to message #509997] Tue, 26 January 2010 09:06 Go to previous message
Eclipse UserFriend
OK, now I understand. The jdt compiler uses a different ast.
No, i'm not requesting bindings so the penalty is not that big. But even so,it would have been a shame to miss any chance of improvement...so I asked.

Thanks!
Previous Topic:Problem with ASTVisitor
Next Topic:How to clear/wipe all currently listed error lines in "Problems" pane?
Goto Forum:
  


Current Time: Sun Mar 23 21:16:28 EDT 2025

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

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

Back to the top