]> source.dussan.org Git - aspectj.git/commitdiff
more AST stuff: 110465
authoraclement <aclement>
Fri, 11 Nov 2005 08:29:32 +0000 (08:29 +0000)
committeraclement <aclement>
Fri, 11 Nov 2005 08:29:32 +0000 (08:29 +0000)
17 files changed:
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java

index 9a128d6dfe99963f3d0b6de1570aa8a2c3f2a073..eed69d89cc89f024906637ede0696210b561a780 100644 (file)
@@ -49,15 +49,17 @@ public class AfterAdviceDeclaration extends AdviceDeclaration {
         * Method declared on ASTNode.
         */
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       acceptChildren(visitor, this.parameters);
-                       acceptChild(visitor, getPointcut());
-                       acceptChildren(visitor, this.thrownExceptions);
-                       acceptChild(visitor, getBody());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               acceptChildren(visitor, this.parameters);
+                               acceptChild(visitor, getPointcut());
+                               acceptChildren(visitor, this.thrownExceptions);
+                               acceptChild(visitor, getBody());
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
index 508e80d82305b162e39cf4b2061077ccb0058507..f78e2a2a88cd21f990bc51b4ea62fec432231365 100644 (file)
@@ -133,16 +133,18 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration {
        }
        
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       acceptChildren(visitor, this.parameters);
-                       acceptChild(visitor, getPointcut());
-                       acceptChild(visitor, getReturning());
-                       acceptChildren(visitor, this.thrownExceptions);
-                       acceptChild(visitor, getBody());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               acceptChildren(visitor, this.parameters);
+                               acceptChild(visitor, getPointcut());
+                               acceptChild(visitor, getReturning());
+                               acceptChildren(visitor, this.thrownExceptions);
+                               acceptChild(visitor, getBody());
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
\ No newline at end of file
index 9d62d92b9575058510c1a76e05baba497f2e017f..0d5142278ce67ebaa2b562b7b9d127239a194556 100644 (file)
@@ -132,16 +132,18 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration {
        }
        
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       acceptChildren(visitor, this.parameters);
-                       acceptChild(visitor, getPointcut());
-                       acceptChild(visitor, getThrowing());
-                       acceptChildren(visitor, this.thrownExceptions);
-                       acceptChild(visitor, getBody());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               acceptChildren(visitor, this.parameters);
+                               acceptChild(visitor, getPointcut());
+                               acceptChild(visitor, getThrowing());
+                               acceptChildren(visitor, this.thrownExceptions);
+                               acceptChild(visitor, getBody());
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
\ No newline at end of file
index d0e0fad0c019c6784715c42d5f53337f889cf79d..6caa20013e25f507f26544d9767231c8cb1200d2 100644 (file)
@@ -105,14 +105,16 @@ public class AndPointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getLeft());
-                       acceptChild(visitor, getRight());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getLeft());
+                               acceptChild(visitor, getRight());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index 7e367103b86df675774653456920a08fc3b7c88e..915ab1a528a9b6c224efdcf36b5bb287c1485839 100644 (file)
@@ -239,21 +239,23 @@ public class AroundAdviceDeclaration extends AdviceDeclaration {
         * Method declared on ASTNode.
         */
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       if (ast.apiLevel == AST.JLS2_INTERNAL) {
-                               acceptChild(visitor, getReturnType());
-                       } else {
-                               acceptChild(visitor, getReturnType2());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               if (ast.apiLevel == AST.JLS2_INTERNAL) {
+                                       acceptChild(visitor, getReturnType());
+                               } else {
+                                       acceptChild(visitor, getReturnType2());
+                               }
+                               
+                               acceptChildren(visitor, this.parameters);
+                               acceptChild(visitor, getPointcut());
+                               acceptChildren(visitor, this.thrownExceptions);
+                               acceptChild(visitor, getBody());
                        }
-                       
-                       acceptChildren(visitor, this.parameters);
-                       acceptChild(visitor, getPointcut());
-                       acceptChildren(visitor, this.thrownExceptions);
-                       acceptChild(visitor, getBody());
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
index 4bd378d56cc0a30ca22dd1c4a558a5f78d55640f..043dc9822ac55d552b92bb6cf6bb32a80367a2a4 100644 (file)
@@ -49,15 +49,17 @@ public class BeforeAdviceDeclaration extends AdviceDeclaration {
         * Method declared on ASTNode.
         */
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       acceptChildren(visitor, this.parameters);
-                       acceptChild(visitor, getPointcut());
-                       acceptChildren(visitor, this.thrownExceptions);
-                       acceptChild(visitor, getBody());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               acceptChildren(visitor, this.parameters);
+                               acceptChild(visitor, getPointcut());
+                               acceptChildren(visitor, this.thrownExceptions);
+                               acceptChild(visitor, getBody());
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
index f57c415a8a698e9ab38c792651940c4fb02e580f..65b22b25eff9d4f1c927ee61dbc664c8b0698c66 100644 (file)
@@ -86,13 +86,15 @@ public class CflowPointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getBody());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getBody());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index 04c30911006c37fab92b9bf0d09271296710ac20..f33350582d0781f6ad30454adf7042347d9dd715 100644 (file)
@@ -107,12 +107,14 @@ public class DeclareDeclaration extends BodyDeclaration {
         * Method declared on ASTNode.
         */
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 
        /**
index d7d5d6ee0ab64740860a4c9db2906e89e04185c7..a8166127260faac33da731b278b4b70ce772bf04 100644 (file)
@@ -55,8 +55,10 @@ public class DefaultPointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               ((AjASTVisitor)visitor).endVisit(this);
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       ((AjASTVisitor)visitor).endVisit(this);
+               }
        }
        int treeSize() {
                return memSize();
index 9b8e4cf361582a24aa014f95b5a5183a35cfff18..5307c4bef2996109af6e9ba8a90a248a0d7a448e 100644 (file)
@@ -49,16 +49,18 @@ public class InterTypeFieldDeclaration extends FieldDeclaration {
        }
        
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getJavadoc());
-                       if (this.ast.apiLevel >= AST.JLS3) {
-                               acceptChildren(visitor, this.modifiers);
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getJavadoc());
+                               if (this.ast.apiLevel >= AST.JLS3) {
+                                       acceptChildren(visitor, this.modifiers);
+                               }
+                               acceptChild(visitor, getType());
+                               acceptChildren(visitor, this.variableDeclarationFragments);
                        }
-                       acceptChild(visitor, getType());
-                       acceptChildren(visitor, this.variableDeclarationFragments);
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
 }
\ No newline at end of file
index e9f44237014bb4da510e05fb5bef5b9536714b8e..9daecd31c46a49b0aadbe82986b66e16f694dd5c 100644 (file)
@@ -69,24 +69,27 @@ public class InterTypeMethodDeclaration extends MethodDeclaration {
        /* (omit javadoc for this method)
         * Method declared on ASTNode.
         */
-       void accept0(ASTVisitor ajvis) { 
-               boolean visitChildren = ajvis.visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(ajvis, getJavadoc());
-                       if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
-                               acceptChild(ajvis, getReturnType());
-                       } else {
-                               acceptChildren(ajvis, this.modifiers);
-                               acceptChildren(ajvis, (NodeList)this.typeParameters());
-                               acceptChild(ajvis, getReturnType2());
+       void accept0(ASTVisitor visitor) { 
+               if (visitor instanceof AjASTVisitor) {
+                       AjASTVisitor ajvis = (AjASTVisitor)visitor;
+                       boolean visitChildren = ajvis.visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(ajvis, getJavadoc());
+                               if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
+                                       acceptChild(ajvis, getReturnType());
+                               } else {
+                                       acceptChildren(ajvis, this.modifiers);
+                                       acceptChildren(ajvis, (NodeList)this.typeParameters());
+                                       acceptChild(ajvis, getReturnType2());
+                               }
+                               // n.b. visit return type even for constructors
+                               acceptChild(ajvis, getName());
+                               acceptChildren(ajvis, this.parameters);
+                               acceptChildren(ajvis, (NodeList)this.thrownExceptions());
+                               acceptChild(ajvis, getBody());
                        }
-                       // n.b. visit return type even for constructors
-                       acceptChild(ajvis, getName());
-                       acceptChildren(ajvis, this.parameters);
-                       acceptChildren(ajvis, (NodeList)this.thrownExceptions());
-                       acceptChild(ajvis, getBody());
+                       ajvis.endVisit(this);
                }
-               ajvis.endVisit(this);
        }
 }
\ No newline at end of file
index f897d98b0ca56d163ebbe0b6ec2ee80c38141662..fc0408ea7c1437d5954ec90e0af3c9ecf9c538c8 100644 (file)
@@ -81,13 +81,15 @@ public class NotPointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getBody());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getBody());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index f9ee05023e4610fc5b1d82f90bacd6ca047e25d1..2fb1cee2cc04ddcd8fb25da4a077c0527caa178c 100644 (file)
@@ -106,14 +106,16 @@ public class OrPointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getLeft());
-                       acceptChild(visitor, getRight());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getLeft());
+                               acceptChild(visitor, getRight());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index a8054b3d8646da082de9c29dacdef0691fcbf5b9..106a99c225cd8b1bc2f7eefd3b3478df71bd62b1 100644 (file)
@@ -91,13 +91,15 @@ public class PerCflow extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getBody());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getBody());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index 95721475336c5149777bdea14eb8cf13b37d1309..a288611fa3a3555ba7e6d586f1ca8668ff5dce84 100644 (file)
@@ -91,13 +91,15 @@ public class PerObject extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getBody());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getBody());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index 5a83a9ea9fac6c458feba9afe9beab243535c213..8b6d22c39d9684bdddcf263b82d9ed9549b00677 100644 (file)
@@ -55,12 +55,14 @@ public class PerTypeWithin extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       // ajh02: remember to visit the type thingy here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               // ajh02: remember to visit the type thingy here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return
index 83de6fdc7fec9b54508a731aaf7af3c2bf693fd4..7ecd8b5c1f1eb2fae005eaa66c37d7aef0e2cbd8 100644 (file)
@@ -91,13 +91,15 @@ public class ReferencePointcut extends PointcutDesignator {
                return ((AjASTMatcher)matcher).match(this, other);
        }
        void accept0(ASTVisitor visitor) {
-               boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
-               if (visitChildren) {
-                       // visit children in normal left to right reading order
-                       acceptChild(visitor, getName());
-                       // todo: accept the parameters here
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       if (visitChildren) {
+                               // visit children in normal left to right reading order
+                               acceptChild(visitor, getName());
+                               // todo: accept the parameters here
+                       }
+                       ((AjASTVisitor)visitor).endVisit(this);
                }
-               ((AjASTVisitor)visitor).endVisit(this);
        }
        int treeSize() {
                return