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 public abstract class NewExpr extends AnyCallExpr { 35 public Expr getExpr() { return null; } 36 public Expr getExprOrThis() { return null; } 37 public String getId() { return "new"; } 38 public Type getReturnType() { return getType(); } 39 40 public Type getCalledType() { 41 return getCodeDec().getDeclaringType(); 42 } 43 44 public void setExpr(Expr expr) {} 45 public void setArgs(Exprs args) {} 46 47 protected TypeD typeD; 49 public TypeD getTypeD() { return typeD; } 50 public void setTypeD(TypeD _typeD) { 51 if (_typeD != null) _typeD.setParent(this); 52 typeD = _typeD; 53 } 54 55 public NewExpr(SourceLocation location, TypeD _typeD) { 56 super(location); 57 setTypeD(_typeD); 58 } 59 protected NewExpr(SourceLocation source) { 60 super(source); 61 } 62 63 public ASTObject getChildAt(int childIndex) { 64 switch(childIndex) { 65 case 0: return typeD; 66 default: return super.getChildAt(childIndex); 67 } 68 } 69 public String getChildNameAt(int childIndex) { 70 switch(childIndex) { 71 case 0: return "typeD"; 72 default: return super.getChildNameAt(childIndex); 73 } 74 } 75 public void setChildAt(int childIndex, ASTObject child) { 76 switch(childIndex) { 77 case 0: setTypeD((TypeD)child); return; 78 default: super.setChildAt(childIndex, child); return; 79 } 80 } 81 public int getChildCount() { 82 return 1; 83 } 84 85 public String getDefaultDisplayName() { 86 return "NewExpr()"; 87 } 88 89 } 91 | Popular Tags |