Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Detailed aspect info from AJDT parser
Detailed aspect info from AJDT parser [message #68983] Wed, 20 December 2006 14:27 Go to next message
Eclipse UserFriend
Originally posted by: seyaldro.t2.technion.ac.il

Hi,
I'm building an eclipse plug-in that translates from an AspectJ source
describing an aspect to a generic structural representation of the aspect.

After looking for parser usage examples I started with the method
AJCompilationUnitManager.getAJCompilationUnit(IFile), as I found in the
org.eclipse.ajdt.core.tests plug-in.

My problem is that I can't seem to find a way to get detailed information
about the different elements, e.g. a composite pointcut's structure.

Regarding pointcuts, I found the class
org.aspectj.weaver.patterns.Pointcut, which seems to be the root of a
hierarchy of specific pointcut types, such as WithinPoincut etc. but I
can't find a connection between PointcutElement and Pointcut, if it exists
at all.

Please point me in the right direction in order to get detailed
information of parsed aspects.

Thanks,
Eyal Dror.
Re: Detailed aspect info from AJDT parser [message #69090 is a reply to message #68983] Tue, 02 January 2007 17:09 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Eyal,

From AJDT you can obtain higher level information such as the structure
of compilation units, types, pointcuts, advice etc. To get more detailed
infomation you need to use the AspectJ parser, which is in the
org.aspectj.ajde plug-in. Below is a post from 19/10/2006 which gives
more information about using the AspectJ parser - also look at the
referenced bug reports for more information.

Regards,

Matt.


> Hi Rafa,
>
> You want to do something like:
>
> ASTParser parser = ASTParser.newParser(AST.JLS3);
> ICompilationUnit source = ( ICompilationUnit )
> org.eclipse.jdt.core.JavaCore.create(
> sourceFile);
> parser.setSource(source);
> CompilationUnit cu = (CompilationUnit) parser.createAST(monitor);
> cu.accept(new AjASTVisitor() {...});
>
> The AjASTVisitor and ASTParser are in the
> org.aspectj.org.eclipse.jdt.core.dom package. Also note that the AST
> that is returned from cu.getAST() is an AjAST (which is also in the
> org.aspectj.org.eclipse.jdt.core.dom package).
>
> There have been a couple of bugs/enhancements opened regarding the
> AspectJ AST which may have some other examples:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=88861 and
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=110465.
> Hope this helps,
>
> Helen

Eyal Dror wrote:
> Hi,
> I'm building an eclipse plug-in that translates from an AspectJ source
> describing an aspect to a generic structural representation of the aspect.
>
> After looking for parser usage examples I started with the method
> AJCompilationUnitManager.getAJCompilationUnit(IFile), as I found in the
> org.eclipse.ajdt.core.tests plug-in.
>
> My problem is that I can't seem to find a way to get detailed
> information about the different elements, e.g. a composite pointcut's
> structure.
>
> Regarding pointcuts, I found the class
> org.aspectj.weaver.patterns.Pointcut, which seems to be the root of a
> hierarchy of specific pointcut types, such as WithinPoincut etc. but I
> can't find a connection between PointcutElement and Pointcut, if it
> exists at all.
>
> Please point me in the right direction in order to get detailed
> information of parsed aspects.
>
> Thanks,
> Eyal Dror.
>
Re: Detailed aspect info from AJDT parser [message #69132 is a reply to message #69090] Wed, 03 January 2007 16:21 Go to previous message
Eclipse UserFriend
Originally posted by: seyaldro.t2.technion.ac.il

Thanks Matt, I'll try it as soon as possible.
Re: Detailed aspect info from AJDT parser [message #595659 is a reply to message #68983] Tue, 02 January 2007 17:09 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Eyal,

From AJDT you can obtain higher level information such as the structure
of compilation units, types, pointcuts, advice etc. To get more detailed
infomation you need to use the AspectJ parser, which is in the
org.aspectj.ajde plug-in. Below is a post from 19/10/2006 which gives
more information about using the AspectJ parser - also look at the
referenced bug reports for more information.

Regards,

Matt.


> Hi Rafa,
>
> You want to do something like:
>
> ASTParser parser = ASTParser.newParser(AST.JLS3);
> ICompilationUnit source = ( ICompilationUnit )
> org.eclipse.jdt.core.JavaCore.create(
> sourceFile);
> parser.setSource(source);
> CompilationUnit cu = (CompilationUnit) parser.createAST(monitor);
> cu.accept(new AjASTVisitor() {...});
>
> The AjASTVisitor and ASTParser are in the
> org.aspectj.org.eclipse.jdt.core.dom package. Also note that the AST
> that is returned from cu.getAST() is an AjAST (which is also in the
> org.aspectj.org.eclipse.jdt.core.dom package).
>
> There have been a couple of bugs/enhancements opened regarding the
> AspectJ AST which may have some other examples:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=88861 and
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=110465
> Hope this helps,
>
> Helen

Eyal Dror wrote:
> Hi,
> I'm building an eclipse plug-in that translates from an AspectJ source
> describing an aspect to a generic structural representation of the aspect.
>
> After looking for parser usage examples I started with the method
> AJCompilationUnitManager.getAJCompilationUnit(IFile), as I found in the
> org.eclipse.ajdt.core.tests plug-in.
>
> My problem is that I can't seem to find a way to get detailed
> information about the different elements, e.g. a composite pointcut's
> structure.
>
> Regarding pointcuts, I found the class
> org.aspectj.weaver.patterns.Pointcut, which seems to be the root of a
> hierarchy of specific pointcut types, such as WithinPoincut etc. but I
> can't find a connection between PointcutElement and Pointcut, if it
> exists at all.
>
> Please point me in the right direction in order to get detailed
> information of parsed aspects.
>
> Thanks,
> Eyal Dror.
>
Re: Detailed aspect info from AJDT parser [message #595679 is a reply to message #69090] Wed, 03 January 2007 16:21 Go to previous message
Eclipse UserFriend
Originally posted by: seyaldro.t2.technion.ac.il

Thanks Matt, I'll try it as soon as possible.
Previous Topic:PDF version of documentation
Next Topic:LTW and perthis/pertarget question...
Goto Forum:
  


Current Time: Fri Apr 26 21:57:05 GMT 2024

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

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

Back to the top