diff options
author | aclement <aclement> | 2005-04-19 12:27:40 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-04-19 12:27:40 +0000 |
commit | 8d6f7108914750b3e213a1d8f6fe2551ca6bc113 (patch) | |
tree | 7d8f532c99fe5c5e7886b0dc4c58bc036c2a3f72 | |
parent | 948b3bf6a77530dec7f6e4b73e183050559cada3 (diff) | |
download | aspectj-8d6f7108914750b3e213a1d8f6fe2551ca6bc113.tar.gz aspectj-8d6f7108914750b3e213a1d8f6fe2551ca6bc113.zip |
from branch: new tests supported
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java | 28 |
1 files changed, 28 insertions, 0 deletions
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())); + } } |