1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 import org.aspectj.compiler.base.*; 29 30 39 public class FromDecStmt extends Stmt { 40 public Type getLexicalType() { 41 return fromDec.getLexicalType(); 42 } 43 44 public void unparse(CodeWriter writer) { 45 writer.write(stmt); 46 } 47 48 public ASTObject postFixAST(final ASTFixerPass fixer) { 49 return stmt; 50 } 51 52 public ASTObject postCleanup(ByteCodeCleanupPass w) { 53 return stmt; 54 } 55 56 protected Stmt stmt; 58 public Stmt getStmt() { return stmt; } 59 public void setStmt(Stmt _stmt) { 60 if (_stmt != null) _stmt.setParent(this); 61 stmt = _stmt; 62 } 63 64 protected Dec fromDec; 65 public Dec getFromDec() { return fromDec; } 66 public void setFromDec(Dec _fromDec) { fromDec = _fromDec; } 67 68 public FromDecStmt(SourceLocation location, Stmt _stmt, Dec _fromDec) { 69 super(location); 70 setStmt(_stmt); 71 setFromDec(_fromDec); 72 } 73 protected FromDecStmt(SourceLocation source) { 74 super(source); 75 } 76 77 public ASTObject copyWalk(CopyWalker walker) { 78 FromDecStmt ret = new FromDecStmt(getSourceLocation()); 79 ret.preCopy(walker, this); 80 if (stmt != null) ret.setStmt( (Stmt)walker.process(stmt) ); 81 ret.fromDec = fromDec; 82 return ret; 83 } 84 85 public ASTObject getChildAt(int childIndex) { 86 switch(childIndex) { 87 case 0: return stmt; 88 default: return super.getChildAt(childIndex); 89 } 90 } 91 public String getChildNameAt(int childIndex) { 92 switch(childIndex) { 93 case 0: return "stmt"; 94 default: return super.getChildNameAt(childIndex); 95 } 96 } 97 public void setChildAt(int childIndex, ASTObject child) { 98 switch(childIndex) { 99 case 0: setStmt((Stmt)child); return; 100 default: super.setChildAt(childIndex, child); return; 101 } 102 } 103 public int getChildCount() { 104 return 1; 105 } 106 107 public String getDefaultDisplayName() { 108 return "FromDecStmt(fromDec: "+fromDec+")"; 109 } 110 111 } 113 114 115 | Popular Tags |