1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 import org.aspectj.compiler.base.JavaCompiler; 29 import org.aspectj.compiler.base.CodeWriter; 30 import java.io.IOException ; 31 32 36 37 public class CodeBody extends BlockStmt { 38 39 public CodeDec getEnclosingCodeDec() { 40 if (getParent() instanceof CodeDec) return (CodeDec)getParent(); 41 return super.getEnclosingCodeDec(); 42 } 43 public Dec getEnclosingDec() { 44 if (getParent() instanceof CodeDec) return (Dec)getParent(); 45 return super.getEnclosingDec(); 46 } 47 48 public void cleanup() { 49 super.cleanup(); 51 } 52 53 public void walkScope(ScopeWalker walker) { 55 if (walker.walkBodies()) super.walkScope(walker); 56 } 57 58 59 62 public ASTObject postCleanup(ByteCodeCleanupPass walker) { 65 makeTempsExplicit(); 66 return this; 67 } 68 69 72 public CodeBody(SourceLocation location, Stmts _stmts, boolean _parsed) { 73 this(location, null, _stmts, _parsed); 74 } 75 76 protected boolean parsed; 78 public boolean getParsed() { return parsed; } 79 public void setParsed(boolean _parsed) { parsed = _parsed; } 80 81 public CodeBody(SourceLocation location, Stmts _tmpStmts, Stmts _stmts, boolean _parsed) { 82 super(location, _tmpStmts, _stmts); 83 setParsed(_parsed); 84 } 85 protected CodeBody(SourceLocation source) { 86 super(source); 87 } 88 89 public ASTObject copyWalk(CopyWalker walker) { 90 CodeBody ret = new CodeBody(getSourceLocation()); 91 ret.preCopy(walker, this); 92 if (tmpStmts != null) ret.setTmpStmts( (Stmts)walker.process(tmpStmts) ); 93 if (stmts != null) ret.setStmts( (Stmts)walker.process(stmts) ); 94 ret.parsed = parsed; 95 return ret; 96 } 97 98 99 public String getDefaultDisplayName() { 100 return "CodeBody(parsed: "+parsed+")"; 101 } 102 103 } 105 | Popular Tags |