Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] ajc AST Documentation

Martin Görg wrote:
> Alright, I just found the docs under docs/developer of the aspectj
> modules. That looks good. If someone knows of another nice place,
> please let me know.

In continuing my monolog: I find the above mentioned docs are by far
not enough. Is there any other way except crowling through the source
code to get information for questions like the following?

1) The framework, which I'm extending is using the ASTNode and ASTVisitor
from the package org.aspectj.org.eclipse.jdt.internal.compiler in
project org.eclipse.jdt.core to build a graph. However, the ASTNode
class in that package does not provide a way to get the underlying
AST. So how can I make some modifications on it like described in the
article in Reference [1]?

2) Can I modify an AST and then directly let ajc "compile" that
modified AST? Or do I first have to write the changes back to the
code and compile the code? I would like to do something like

// get AST
// modify AST
Main main = new Main().runMain(modifiedAST);

but I can't find an entry point for this. Shouldn't tools be able to
make performance improving modifications to the AST and then compile
without changing the underlying source code?

For these and probably other questions, I would love to have
something like a documentation other than the source code.

Any hints?

[1] http://www.eclipse.org/articles/article.php?file=Article-JavaCodeManipulation_AST/index.html

-- 
Martin



Back to the top