]> source.dussan.org Git - aspectj.git/commitdiff
from branch: new tests supported
authoraclement <aclement>
Tue, 19 Apr 2005 12:27:40 +0000 (12:27 +0000)
committeraclement <aclement>
Tue, 19 Apr 2005 12:27:40 +0000 (12:27 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java

index 553da757ee04fc776adb6ffde66f45b708060aa4..96c69d73104f30625f2ec515be76757464d276e9 100644 (file)
@@ -26,9 +26,11 @@ import org.aspectj.weaver.TypeX;
 import org.aspectj.weaver.ast.And;
 import org.aspectj.weaver.ast.Call;
 import org.aspectj.weaver.ast.CallExpr;
+import org.aspectj.weaver.ast.CastExpr;
 import org.aspectj.weaver.ast.Expr;
 import org.aspectj.weaver.ast.FieldGet;
 import org.aspectj.weaver.ast.FieldGetCall;
+import org.aspectj.weaver.ast.FieldGetOn;
 import org.aspectj.weaver.ast.HasAnnotation;
 import org.aspectj.weaver.ast.IExprVisitor;
 import org.aspectj.weaver.ast.ITestVisitor;
@@ -36,6 +38,7 @@ import org.aspectj.weaver.ast.Instanceof;
 import org.aspectj.weaver.ast.Literal;
 import org.aspectj.weaver.ast.Not;
 import org.aspectj.weaver.ast.Or;
+import org.aspectj.weaver.ast.StringConstExpr;
 import org.aspectj.weaver.ast.Test;
 import org.aspectj.weaver.ast.Var;
 
@@ -278,4 +281,29 @@ public class BcelRenderer implements ITestVisitor, IExprVisitor {
                callIl.append(Utility.createInvoke(fact, world, method));
                instructions.insert(callIl);            
        }
+
+    /**
+     * Visit a string constant
+     * @param stringConst
+     */
+    public void visit(StringConstExpr stringConst) {
+        instructions.insert(fact.createConstant(stringConst.getStringConst()));
+    }
+
+    /**
+     * Visit a CHECKCAST
+     * @param castExpr
+     */
+    public void visit(CastExpr castExpr) {
+        instructions.append(fact.createCheckCast(new ObjectType(castExpr.getTypeName())));
+    }
+
+    /**
+     * Visit a field GET (static or not, depends on the field)
+     * @param fieldGet
+     */
+    public void visit(FieldGetOn fieldGet) {
+               Member field = fieldGet.getField();
+               instructions.insert(Utility.createGetOn(fact, field, fieldGet.getDeclaringType()));             
+    }
 }