1 24 25 package org.aspectj.compiler.base.cst; 26 27 import java.util.*; 28 import org.aspectj.compiler.base.ast.*; 29 30 import org.aspectj.compiler.base.JavaCompiler; 31 import org.aspectj.compiler.base.CodeWriter; 32 import java.io.IOException ; 33 34 import org.aspectj.compiler.base.bcg.CodeBuilder; 35 36 40 41 public class UnresolvedExpr extends AssignableExpr { 42 protected void cgLvalue(CodeBuilder cb) {} 45 protected void cgLtoRvalue(CodeBuilder cb) {} 46 protected void cgAssignment(CodeBuilder cb) {} 47 protected void cgDupLvalue(CodeBuilder cb) {} 48 protected void cgDupRvalue(CodeBuilder cb) {} 49 51 public Type discoverType() { 52 return null; 53 } 54 55 public ASTObject postScope(ScopeWalker walker) { 57 Expr newExpr = name.resolveExpr(walker.getScope()); 58 if (isLhs() && !(newExpr instanceof AssignableExpr)) { 61 showError("assignable expression required here"); 62 return this; 63 } 64 65 return newExpr; 66 } 67 68 protected Name name; 70 public Name getName() { return name; } 71 public void setName(Name _name) { 72 if (_name != null) _name.setParent(this); 73 name = _name; 74 } 75 76 public UnresolvedExpr(SourceLocation location, Name _name) { 77 super(location); 78 setName(_name); 79 } 80 protected UnresolvedExpr(SourceLocation source) { 81 super(source); 82 } 83 84 public ASTObject copyWalk(CopyWalker walker) { 85 UnresolvedExpr ret = new UnresolvedExpr(getSourceLocation()); 86 ret.preCopy(walker, this); 87 if (name != null) ret.setName( (Name)walker.process(name) ); 88 return ret; 89 } 90 91 public ASTObject getChildAt(int childIndex) { 92 switch(childIndex) { 93 case 0: return name; 94 default: return super.getChildAt(childIndex); 95 } 96 } 97 public String getChildNameAt(int childIndex) { 98 switch(childIndex) { 99 case 0: return "name"; 100 default: return super.getChildNameAt(childIndex); 101 } 102 } 103 public void setChildAt(int childIndex, ASTObject child) { 104 switch(childIndex) { 105 case 0: setName((Name)child); return; 106 default: super.setChildAt(childIndex, child); return; 107 } 108 } 109 public int getChildCount() { 110 return 1; 111 } 112 113 public String getDefaultDisplayName() { 114 return "UnresolvedExpr()"; 115 } 116 117 } 119 | Popular Tags |