1 2 3 package soot.jimple.parser.node; 4 5 import java.util.*; 6 import soot.jimple.parser.analysis.*; 7 8 public final class AAssignStatement extends PStatement 9 { 10 private PVariable _variable_; 11 private TEquals _equals_; 12 private PExpression _expression_; 13 private TSemicolon _semicolon_; 14 15 public AAssignStatement() 16 { 17 } 18 19 public AAssignStatement( 20 PVariable _variable_, 21 TEquals _equals_, 22 PExpression _expression_, 23 TSemicolon _semicolon_) 24 { 25 setVariable(_variable_); 26 27 setEquals(_equals_); 28 29 setExpression(_expression_); 30 31 setSemicolon(_semicolon_); 32 33 } 34 public Object clone() 35 { 36 return new AAssignStatement( 37 (PVariable) cloneNode(_variable_), 38 (TEquals) cloneNode(_equals_), 39 (PExpression) cloneNode(_expression_), 40 (TSemicolon) cloneNode(_semicolon_)); 41 } 42 43 public void apply(Switch sw) 44 { 45 ((Analysis) sw).caseAAssignStatement(this); 46 } 47 48 public PVariable getVariable() 49 { 50 return _variable_; 51 } 52 53 public void setVariable(PVariable node) 54 { 55 if(_variable_ != null) 56 { 57 _variable_.parent(null); 58 } 59 60 if(node != null) 61 { 62 if(node.parent() != null) 63 { 64 node.parent().removeChild(node); 65 } 66 67 node.parent(this); 68 } 69 70 _variable_ = node; 71 } 72 73 public TEquals getEquals() 74 { 75 return _equals_; 76 } 77 78 public void setEquals(TEquals node) 79 { 80 if(_equals_ != null) 81 { 82 _equals_.parent(null); 83 } 84 85 if(node != null) 86 { 87 if(node.parent() != null) 88 { 89 node.parent().removeChild(node); 90 } 91 92 node.parent(this); 93 } 94 95 _equals_ = node; 96 } 97 98 public PExpression getExpression() 99 { 100 return _expression_; 101 } 102 103 public void setExpression(PExpression node) 104 { 105 if(_expression_ != null) 106 { 107 _expression_.parent(null); 108 } 109 110 if(node != null) 111 { 112 if(node.parent() != null) 113 { 114 node.parent().removeChild(node); 115 } 116 117 node.parent(this); 118 } 119 120 _expression_ = node; 121 } 122 123 public TSemicolon getSemicolon() 124 { 125 return _semicolon_; 126 } 127 128 public void setSemicolon(TSemicolon node) 129 { 130 if(_semicolon_ != null) 131 { 132 _semicolon_.parent(null); 133 } 134 135 if(node != null) 136 { 137 if(node.parent() != null) 138 { 139 node.parent().removeChild(node); 140 } 141 142 node.parent(this); 143 } 144 145 _semicolon_ = node; 146 } 147 148 public String toString() 149 { 150 return "" 151 + toString(_variable_) 152 + toString(_equals_) 153 + toString(_expression_) 154 + toString(_semicolon_); 155 } 156 157 void removeChild(Node child) 158 { 159 if(_variable_ == child) 160 { 161 _variable_ = null; 162 return; 163 } 164 165 if(_equals_ == child) 166 { 167 _equals_ = null; 168 return; 169 } 170 171 if(_expression_ == child) 172 { 173 _expression_ = null; 174 return; 175 } 176 177 if(_semicolon_ == child) 178 { 179 _semicolon_ = null; 180 return; 181 } 182 183 } 184 185 void replaceChild(Node oldChild, Node newChild) 186 { 187 if(_variable_ == oldChild) 188 { 189 setVariable((PVariable) newChild); 190 return; 191 } 192 193 if(_equals_ == oldChild) 194 { 195 setEquals((TEquals) newChild); 196 return; 197 } 198 199 if(_expression_ == oldChild) 200 { 201 setExpression((PExpression) newChild); 202 return; 203 } 204 205 if(_semicolon_ == oldChild) 206 { 207 setSemicolon((TSemicolon) newChild); 208 return; 209 } 210 211 } 212 } 213 | Popular Tags |