1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.JavaCompiler; 28 import org.aspectj.compiler.base.CodeWriter; 29 30 34 35 public class NewInnerInstanceExpr extends NewInstanceExpr { 38 public ASTObject postScope(ScopeWalker walker) { 40 super.postScope(walker); 41 return this; 42 } 44 45 public void preScope(ScopeWalker walker) { 46 if (getEnclosingInstanceExpr() == null) { 52 super.preScope(walker); 53 return; 54 } 55 setEnclosingInstanceExpr((Expr)walker.process(getEnclosingInstanceExpr())); 57 Type myType = 58 getEnclosingInstanceExpr().getType().getInnerType(getInnerName(), 59 this, true); 60 setTypeD(myType.makeTypeD()); 61 if (typeDec != null) { 62 ((ClassDec)typeDec).setSuperClass(myType.makeTypeD()); 63 } 64 } 65 66 protected String innerName; 68 public String getInnerName() { return innerName; } 69 public void setInnerName(String _innerName) { innerName = _innerName; } 70 71 public NewInnerInstanceExpr(SourceLocation location, Expr _enclosingInstanceExpr, TypeD _typeD, Exprs _args, TypeDec _typeDec, Constructor _constructor, String _innerName) { 72 super(location, _enclosingInstanceExpr, _typeD, _args, _typeDec, _constructor); 73 setInnerName(_innerName); 74 } 75 protected NewInnerInstanceExpr(SourceLocation source) { 76 super(source); 77 } 78 79 public ASTObject copyWalk(CopyWalker walker) { 80 NewInnerInstanceExpr ret = new NewInnerInstanceExpr(getSourceLocation()); 81 ret.preCopy(walker, this); 82 if (enclosingInstanceExpr != null) ret.setEnclosingInstanceExpr( (Expr)walker.process(enclosingInstanceExpr) ); 83 if (typeD != null) ret.setTypeD( (TypeD)walker.process(typeD) ); 84 if (args != null) ret.setArgs( (Exprs)walker.process(args) ); 85 if (typeDec != null) ret.setTypeDec( (TypeDec)walker.process(typeDec) ); 86 ret.constructor = constructor; 87 ret.innerName = innerName; 88 return ret; 89 } 90 91 92 public String getDefaultDisplayName() { 93 return "NewInnerInstanceExpr(constructor: "+constructor+", "+"innerName: "+innerName+")"; 94 } 95 96 } 98 | Popular Tags |