| 1 | /* This file was generated by SableCC (http://www.sablecc.org/). */ |
| 2 | |
| 3 | package uk.co.zonetora.fj.ast.node; |
| 4 | |
| 5 | import java.util.*; |
| 6 | import uk.co.zonetora.fj.ast.analysis.*; |
| 7 | |
| 8 | public final class AObjectCreationNonLeftRecTerm extends PNonLeftRecTerm |
| 9 | { |
| 10 | private TNew _new_; |
| 11 | private TIdentifier _identifier_; |
| 12 | private TLPar _lPar_; |
| 13 | private PTermList _termList_; |
| 14 | private TRPar _rPar_; |
| 15 | |
| 16 | public AObjectCreationNonLeftRecTerm() |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | public AObjectCreationNonLeftRecTerm( |
| 21 | TNew _new_, |
| 22 | TIdentifier _identifier_, |
| 23 | TLPar _lPar_, |
| 24 | PTermList _termList_, |
| 25 | TRPar _rPar_) |
| 26 | { |
| 27 | setNew(_new_); |
| 28 | |
| 29 | setIdentifier(_identifier_); |
| 30 | |
| 31 | setLPar(_lPar_); |
| 32 | |
| 33 | setTermList(_termList_); |
| 34 | |
| 35 | setRPar(_rPar_); |
| 36 | |
| 37 | } |
| 38 | public Object clone() |
| 39 | { |
| 40 | return new AObjectCreationNonLeftRecTerm( |
| 41 | (TNew) cloneNode(_new_), |
| 42 | (TIdentifier) cloneNode(_identifier_), |
| 43 | (TLPar) cloneNode(_lPar_), |
| 44 | (PTermList) cloneNode(_termList_), |
| 45 | (TRPar) cloneNode(_rPar_)); |
| 46 | } |
| 47 | |
| 48 | public void apply(Switch sw) |
| 49 | { |
| 50 | ((Analysis) sw).caseAObjectCreationNonLeftRecTerm(this); |
| 51 | } |
| 52 | |
| 53 | public TNew getNew() |
| 54 | { |
| 55 | return _new_; |
| 56 | } |
| 57 | |
| 58 | public void setNew(TNew node) |
| 59 | { |
| 60 | if(_new_ != null) |
| 61 | { |
| 62 | _new_.parent(null); |
| 63 | } |
| 64 | |
| 65 | if(node != null) |
| 66 | { |
| 67 | if(node.parent() != null) |
| 68 | { |
| 69 | node.parent().removeChild(node); |
| 70 | } |
| 71 | |
| 72 | node.parent(this); |
| 73 | } |
| 74 | |
| 75 | _new_ = node; |
| 76 | } |
| 77 | |
| 78 | public TIdentifier getIdentifier() |
| 79 | { |
| 80 | return _identifier_; |
| 81 | } |
| 82 | |
| 83 | public void setIdentifier(TIdentifier node) |
| 84 | { |
| 85 | if(_identifier_ != null) |
| 86 | { |
| 87 | _identifier_.parent(null); |
| 88 | } |
| 89 | |
| 90 | if(node != null) |
| 91 | { |
| 92 | if(node.parent() != null) |
| 93 | { |
| 94 | node.parent().removeChild(node); |
| 95 | } |
| 96 | |
| 97 | node.parent(this); |
| 98 | } |
| 99 | |
| 100 | _identifier_ = node; |
| 101 | } |
| 102 | |
| 103 | public TLPar getLPar() |
| 104 | { |
| 105 | return _lPar_; |
| 106 | } |
| 107 | |
| 108 | public void setLPar(TLPar node) |
| 109 | { |
| 110 | if(_lPar_ != null) |
| 111 | { |
| 112 | _lPar_.parent(null); |
| 113 | } |
| 114 | |
| 115 | if(node != null) |
| 116 | { |
| 117 | if(node.parent() != null) |
| 118 | { |
| 119 | node.parent().removeChild(node); |
| 120 | } |
| 121 | |
| 122 | node.parent(this); |
| 123 | } |
| 124 | |
| 125 | _lPar_ = node; |
| 126 | } |
| 127 | |
| 128 | public PTermList getTermList() |
| 129 | { |
| 130 | return _termList_; |
| 131 | } |
| 132 | |
| 133 | public void setTermList(PTermList node) |
| 134 | { |
| 135 | if(_termList_ != null) |
| 136 | { |
| 137 | _termList_.parent(null); |
| 138 | } |
| 139 | |
| 140 | if(node != null) |
| 141 | { |
| 142 | if(node.parent() != null) |
| 143 | { |
| 144 | node.parent().removeChild(node); |
| 145 | } |
| 146 | |
| 147 | node.parent(this); |
| 148 | } |
| 149 | |
| 150 | _termList_ = node; |
| 151 | } |
| 152 | |
| 153 | public TRPar getRPar() |
| 154 | { |
| 155 | return _rPar_; |
| 156 | } |
| 157 | |
| 158 | public void setRPar(TRPar node) |
| 159 | { |
| 160 | if(_rPar_ != null) |
| 161 | { |
| 162 | _rPar_.parent(null); |
| 163 | } |
| 164 | |
| 165 | if(node != null) |
| 166 | { |
| 167 | if(node.parent() != null) |
| 168 | { |
| 169 | node.parent().removeChild(node); |
| 170 | } |
| 171 | |
| 172 | node.parent(this); |
| 173 | } |
| 174 | |
| 175 | _rPar_ = node; |
| 176 | } |
| 177 | |
| 178 | public String toString() |
| 179 | { |
| 180 | return "" |
| 181 | + toString(_new_) |
| 182 | + toString(_identifier_) |
| 183 | + toString(_lPar_) |
| 184 | + toString(_termList_) |
| 185 | + toString(_rPar_); |
| 186 | } |
| 187 | |
| 188 | void removeChild(Node child) |
| 189 | { |
| 190 | if(_new_ == child) |
| 191 | { |
| 192 | _new_ = null; |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | if(_identifier_ == child) |
| 197 | { |
| 198 | _identifier_ = null; |
| 199 | return; |
| 200 | } |
| 201 | |
| 202 | if(_lPar_ == child) |
| 203 | { |
| 204 | _lPar_ = null; |
| 205 | return; |
| 206 | } |
| 207 | |
| 208 | if(_termList_ == child) |
| 209 | { |
| 210 | _termList_ = null; |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | if(_rPar_ == child) |
| 215 | { |
| 216 | _rPar_ = null; |
| 217 | return; |
| 218 | } |
| 219 | |
| 220 | } |
| 221 | |
| 222 | void replaceChild(Node oldChild, Node newChild) |
| 223 | { |
| 224 | if(_new_ == oldChild) |
| 225 | { |
| 226 | setNew((TNew) newChild); |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | if(_identifier_ == oldChild) |
| 231 | { |
| 232 | setIdentifier((TIdentifier) newChild); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | if(_lPar_ == oldChild) |
| 237 | { |
| 238 | setLPar((TLPar) newChild); |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | if(_termList_ == oldChild) |
| 243 | { |
| 244 | setTermList((PTermList) newChild); |
| 245 | return; |
| 246 | } |
| 247 | |
| 248 | if(_rPar_ == oldChild) |
| 249 | { |
| 250 | setRPar((TRPar) newChild); |
| 251 | return; |
| 252 | } |
| 253 | |
| 254 | } |
| 255 | } |