diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-12 03:40:07 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-12 03:40:07 +0200 |
commit | e84bdd32e71b029d8d1f2fa7849e998953984f47 (patch) | |
tree | d3e7ff61b9d1b84de36b5d41496f5436d853d114 /src/lombok/eclipse/EclipseASTAdapter.java | |
parent | 4c18c774fc60eca7e104b3eaa5535ce94ec66198 (diff) | |
download | lombok-e84bdd32e71b029d8d1f2fa7849e998953984f47.tar.gz lombok-e84bdd32e71b029d8d1f2fa7849e998953984f47.tar.bz2 lombok-e84bdd32e71b029d8d1f2fa7849e998953984f47.zip |
Singularly massive code change, too hard to document. Basically, hooking now occurs in the two most sane places:
- After the parser is done building a first rendition of the AST. (Usually lightweight and missing method bodies etc)
- After the parser is done taking such a lightweight AST and filling in the gaps.
Lombok then builts its own bidirectional and somewhat saner AST out of this, and hands this saner AST off for treatment. Things in the AST can be marked as 'handled'.
This seems to work swimmingly and should allow us to easily identify the annotations that are for us, and work our magic, no matter where they appear or on what, including
stuff inside method bodies.
Diffstat (limited to 'src/lombok/eclipse/EclipseASTAdapter.java')
-rw-r--r-- | src/lombok/eclipse/EclipseASTAdapter.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lombok/eclipse/EclipseASTAdapter.java b/src/lombok/eclipse/EclipseASTAdapter.java new file mode 100644 index 00000000..fa87872f --- /dev/null +++ b/src/lombok/eclipse/EclipseASTAdapter.java @@ -0,0 +1,25 @@ +package lombok.eclipse; + +import lombok.eclipse.EclipseAST.Node; + +import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; +import org.eclipse.jdt.internal.compiler.ast.Initializer; +import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; + +public abstract class EclipseASTAdapter implements EclipseASTVisitor { + @Override public void visitCompilationUnit(Node node, CompilationUnitDeclaration unit) {} + @Override public void endVisitCompilationUnit(Node node, CompilationUnitDeclaration unit) {} + @Override public void visitType(Node node, TypeDeclaration type) {} + @Override public void endVisitType(Node node, TypeDeclaration type) {} + @Override public void visitInitializer(Node node, Initializer initializer) {} + @Override public void endVisitInitializer(Node node, Initializer initializer) {} + @Override public void visitField(Node node, FieldDeclaration field) {} + @Override public void endVisitField(Node node, FieldDeclaration field) {} + @Override public void visitMethod(Node node, AbstractMethodDeclaration declaration) {} + @Override public void endVisitMethod(Node node, AbstractMethodDeclaration declaration) {} + @Override public void visitLocal(Node node, LocalDeclaration declaration) {} + @Override public void endVisitLocal(Node node, LocalDeclaration declaration) {} +} |