1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 29 38 public abstract class SemanticObject extends CompilerObject { 39 protected Dec dec; 40 41 public SemanticObject(JavaCompiler compiler) { 42 super(compiler); 43 } 44 45 public SemanticObject(Dec dec) { 46 super(dec.getCompiler()); 47 this.dec = dec; 48 } 49 public String getName() { return dec.getName(); } 50 public String getId() { return dec.getId(); } 51 public String getBytecodeId() { return dec.getBytecodeId(); } 52 53 public Type getDeclaringType() { return dec.getDeclaringType(); } 54 55 57 public Dec getCorrespondingDec() { return dec; } 58 59 public String getKind() { return dec.getKind(); } 60 61 public String toShortString() { return dec.toShortString(); } 62 63 public String getDescriptor() { return dec.getDescriptor(); } 65 public int getStackDelta() { return dec.getStackDelta(); } 66 67 public Modifiers getModifiers() { return dec.getModifiers(); } 68 69 public boolean isAbstract() { return dec.isAbstract(); } 70 public boolean isStatic() { return dec.isStatic(); } 71 72 public boolean isInherited(Type inType) { return dec.isInherited(inType); } 73 public boolean conflictsWith(SemanticObject other) { 74 return dec.conflictsWith(other.dec); 75 } 76 public boolean checkOverride(Type inType, SemanticObject other) { 77 return dec.checkOverride(inType, other.dec); 78 } 79 public boolean dominates(SemanticObject other) { 80 return dec.dominates(other.dec); 81 } 82 83 public boolean isMoreSpecificThan(SemanticObject other) { 84 return dec.isMoreSpecificThan(other.dec); 85 } 86 public boolean isApplicable(Exprs params) { return dec.isApplicable(params); } 87 public boolean isAlmostApplicable(Exprs params) { return dec.isAlmostApplicable(params); } 88 89 public boolean isAccessible(ASTObject fromWhere) { return isAccessible(fromWhere, false); } 90 public boolean isAccessible(ASTObject fromWhere, boolean inBytecode) { 91 if (dec == null) { 92 System.out.println("no dec: " + this); 93 return false; 94 } 95 return dec.isAccessible(fromWhere, inBytecode); 96 } 97 98 public void showConflictError(SemanticObject other, String message) { 99 getCorrespondingDec().showError(toShortString() + " conflicts with " + 100 other.toShortString() + ": " + message); 101 } 102 103 public Expr updateTargetExpr(Expr expr) { 104 if (isStatic() && InterfaceDec.isHelperClass(getDeclaringType().getTypeDec())) { 105 return expr.getAST().makeTypeExpr(getDeclaringType()); 106 } 107 return expr; 108 } 109 } 110 | Popular Tags |