From 8d6f7108914750b3e213a1d8f6fe2551ca6bc113 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 19 Apr 2005 12:27:40 +0000 Subject: from branch: new tests supported --- .../src/org/aspectj/weaver/bcel/BcelRenderer.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'weaver') diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java index 553da757e..96c69d731 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java @@ -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())); + } } -- cgit v1.2.3