1 24 25 package org.aspectj.compiler.crosscuts.ast; 26 27 import org.aspectj.compiler.base.ast.*; 28 import org.aspectj.compiler.base.*; 29 import org.aspectj.compiler.crosscuts.*; 30 import org.aspectj.compiler.base.bcg.CodeBuilder; 31 32 import java.util.*; 33 34 39 public class ProceedExpr extends Expr { 40 protected Type discoverType() { return enclosingAround.getResultType(); } 41 42 public boolean isLegalStmt() { 43 return true; 44 } 45 46 protected void cgValue(CodeBuilder cb) { 47 getCompiler().internalError(this, "should no longer exist"); 48 } 49 50 51 53 public Set getPossibleExceptions(boolean deFacto) { 54 if (deFacto) { 55 Set set = new HashSet(); 56 set.add(getTypeManager().getThrowableType()); 57 return set; 58 } else { 59 return Collections.EMPTY_SET; 60 } 61 } 62 63 64 65 68 public void walkFlow(FlowCheckerPass w) { 69 w.process(getArgs()); 70 w.setExns(FlowCheckerPass.ESet.getEmpty().add(getTypeManager().getThrowableType())); 71 } 72 73 protected Exprs args; 75 public Exprs getArgs() { return args; } 76 public void setArgs(Exprs _args) { 77 if (_args != null) _args.setParent(this); 78 args = _args; 79 } 80 81 protected AroundAdviceDec enclosingAround; 82 public AroundAdviceDec getEnclosingAround() { return enclosingAround; } 83 public void setEnclosingAround(AroundAdviceDec _enclosingAround) { enclosingAround = _enclosingAround; } 84 85 public ProceedExpr(SourceLocation location, Exprs _args, AroundAdviceDec _enclosingAround) { 86 super(location); 87 setArgs(_args); 88 setEnclosingAround(_enclosingAround); 89 } 90 protected ProceedExpr(SourceLocation source) { 91 super(source); 92 } 93 94 public ASTObject copyWalk(CopyWalker walker) { 95 ProceedExpr ret = new ProceedExpr(getSourceLocation()); 96 ret.preCopy(walker, this); 97 if (args != null) ret.setArgs( (Exprs)walker.process(args) ); 98 ret.enclosingAround = enclosingAround; 99 return ret; 100 } 101 102 public ASTObject getChildAt(int childIndex) { 103 switch(childIndex) { 104 case 0: return args; 105 default: return super.getChildAt(childIndex); 106 } 107 } 108 public String getChildNameAt(int childIndex) { 109 switch(childIndex) { 110 case 0: return "args"; 111 default: return super.getChildNameAt(childIndex); 112 } 113 } 114 public void setChildAt(int childIndex, ASTObject child) { 115 switch(childIndex) { 116 case 0: setArgs((Exprs)child); return; 117 default: super.setChildAt(childIndex, child); return; 118 } 119 } 120 public int getChildCount() { 121 return 1; 122 } 123 124 public String getDefaultDisplayName() { 125 return "ProceedExpr(enclosingAround: "+enclosingAround+")"; 126 } 127 128 } 130 | Popular Tags |