punkyduck
punkyduck

Reputation: 719

Looking for AspectJ Parser

I am looking for a parser that gives me information of an AspectJ source file. Information like defined pointcuts, advices, ....

I searched on Google for some time, but didn't find anything usefull. It seems to be possible to use the parser that is included in the AspectJ compiler, but I couldnt find any information on how to use it.

The most promising thing I found are that unit tests: http://eclipsesourcecode.appspot.com/jsrcs/org.eclipse.ajdt/AJDT_src/org.eclipse.ajdt.core.tests/src/org/eclipse/ajdt/core/tests/javaelements/AspectElementTests.java.html

These tests test exactly what I want to do, but I couldnt find any information about the org.eclipse.ajdt.core.tests.javaelements.* classes that are used there.

Can someone help me?

Upvotes: 1

Views: 311

Answers (3)

mart
mart

Reputation: 2577

There is also AspectBench Compiler (abc) for AspectJ.

Upvotes: 1

Andrew Eisenberg
Andrew Eisenberg

Reputation: 28737

You will need to access the AspectJ git repository. It is available here:

http://git.eclipse.org/c/aspectj/org.aspectj.git/

In there, look for the org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser class.

This is the parser and only the parser. If you are looking to do something like what AJDT is doing, this is far from enough. You will have to start with org.aspectj.org.eclipse.jdt.internal.compiler.Compiler. But, there's still a lot of mucking around you'd need to to to find all the cross-cutting relationships.

THe nicest way to go about this is to create an eclipse plugin that calls into AJDT code.

Upvotes: 4

Miserable Variable
Miserable Variable

Reputation: 28752

I think the author mentioned recently that it is a hand-written parser so I suspect you will not find a different parser besides the one that is part of AspectJ/AJDT itself.

Since it is open source, your best bet is to look at the source code.

You might want to ask at the AspectJ mailing list https://dev.eclipse.org/mailman/listinfo/aspectj-users.

Upvotes: 1

Related Questions