How to get method bindings with AsmHierarchyBuilder? [message #69302] |
Tue, 16 January 2007 11:56  |
Eclipse User |
|
|
|
Originally posted by: m.bartsch.rdg.ac.uk
Hi,
I am trying to analyze AspectJ code and would like to retrieve method bindings from a method call
that appears in a source code file. I would like to know, for example, what is the return type of
the method call and what is the type of the object whose method is invoked.
Another reply to a similar email revealed that using an AjAST visitor does not seem to work (yet).
So I tried to find another way and found AsmHierachyBuilder. So far, I found out that the following
needs to be done:
1. Subclass AsmHierachyBuilder and implement the visit methods that I am interested in.
2. Register this visitor with Ajde.getDefault().getBuildManager().setAsmHierarchyBuilder
3. Compile the project. (?)
I have three questions:
1. Is this approach correct and might be the right way to obtain method bindings?
2. How do I compile an AspectJ project in Eclipse programmatically so that my registered
AsmHierarchyBuilder will be used? So far, I only saw solutions that passed a config.lst file to the
Ajde.getDefault().getBuildManager().build() method. I would like to avoid creating a config.lst
file, since there must already be a build configuration present in Eclipse. My code will run in an
Eclipse plugin.
Thanks a lot for your help and support,
Marc.
|
|
|
|
Re: How to get method bindings with AsmHierarchyBuilder? [message #69339 is a reply to message #69323] |
Thu, 18 January 2007 07:15  |
Eclipse User |
|
|
|
Originally posted by: m.bartsch.rdg.ac.uk
Hi Michael,
Thanks a lot for your help. I had a quick look at it and it works brilliantly. Sometimes, the things
are just right under your nose.
Best wishes,
Marc.
Michael Pisula schrieb:
> Hi Marc,
>
> as for compiling the project, I think I might help you, as we use
> exactly the same approach in our AspectJ analysis tool. Basically we set
> the HierarchyBuilder to our subclass and then call project.build(..) on
> the IProject object of the project we want to build. In between we set
> the current AspectJProject with
> AspectJPlugin.getDefault().setCurrentProject(project);
> and set the build configuration we want to use.
>
> Hope I could help you there.
>
> Michael
|
|
|
Re: How to get method bindings with AsmHierarchyBuilder? [message #595760 is a reply to message #69302] |
Wed, 17 January 2007 08:09  |
Eclipse User |
|
|
|
Hi Marc,
as for compiling the project, I think I might help you, as we use
exactly the same approach in our AspectJ analysis tool. Basically we set
the HierarchyBuilder to our subclass and then call project.build(..) on
the IProject object of the project we want to build. In between we set
the current AspectJProject with
AspectJPlugin.getDefault().setCurrentProject(project);
and set the build configuration we want to use.
Hope I could help you there.
Michael
|
|
|
Re: How to get method bindings with AsmHierarchyBuilder? [message #595769 is a reply to message #69323] |
Thu, 18 January 2007 07:15  |
Eclipse User |
|
|
|
Originally posted by: m.bartsch.rdg.ac.uk
Hi Michael,
Thanks a lot for your help. I had a quick look at it and it works brilliantly. Sometimes, the things
are just right under your nose.
Best wishes,
Marc.
Michael Pisula schrieb:
> Hi Marc,
>
> as for compiling the project, I think I might help you, as we use
> exactly the same approach in our AspectJ analysis tool. Basically we set
> the HierarchyBuilder to our subclass and then call project.build(..) on
> the IProject object of the project we want to build. In between we set
> the current AspectJProject with
> AspectJPlugin.getDefault().setCurrentProject(project);
> and set the build configuration we want to use.
>
> Hope I could help you there.
>
> Michael
|
|
|
Powered by
FUDForum. Page generated in 0.04167 seconds