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 31 34 35 public class FormalDec extends VarDec { 36 37 public FormalDec(SourceLocation location, TypeD typeD, String id) { 38 this(location,new Modifiers(location,0), typeD, id, null); 39 } 40 41 public boolean isBound = false; 43 44 public String toString() { 45 return "FormalDec("+getTypeD().getString()+" "+getId()+")"; 46 } 47 48 public boolean isField() { return false; } 49 50 public void unparse(CodeWriter writer) { 51 writeModifiers(writer); 52 writer.write(typeD); 53 writer.requiredSpace(); 54 writer.write(id); 55 } 56 57 60 public void walkFlow(FlowCheckerPass w) { 61 w.setVars(w.getVars().addAssigned(this)); 62 } 63 64 66 public FormalDec(SourceLocation location, Modifiers _modifiers, TypeD _typeD, String _id, Expr _initializer) { 67 super(location, _modifiers, _typeD, _id, _initializer); 68 69 } 70 protected FormalDec(SourceLocation source) { 71 super(source); 72 } 73 74 public ASTObject copyWalk(CopyWalker walker) { 75 FormalDec ret = new FormalDec(getSourceLocation()); 76 ret.preCopy(walker, this); 77 if (modifiers != null) ret.setModifiers( (Modifiers)walker.process(modifiers) ); 78 if (typeD != null) ret.setTypeD( (TypeD)walker.process(typeD) ); 79 ret.id = id; 80 if (initializer != null) ret.setInitializer( (Expr)walker.process(initializer) ); 81 return ret; 82 } 83 84 85 public String getDefaultDisplayName() { 86 return "FormalDec(id: "+id+")"; 87 } 88 89 } 91 | Popular Tags |