1 2 3 package org.sablecc.sablecc.syntax3.node; 4 5 import org.sablecc.sablecc.syntax3.analysis.*; 6 7 @SuppressWarnings ("nls") 8 public final class ANormalState extends PNormalState 9 { 10 private TIdentifier _name_; 11 private PTokenCollection _tokenCollection_; 12 private PPriorities _priorities_; 13 private PIgnored _ignored_; 14 private PLookahead _lookahead_; 15 16 public ANormalState() 17 { 18 } 20 21 public ANormalState( 22 @SuppressWarnings ("hiding") TIdentifier _name_, 23 @SuppressWarnings ("hiding") PTokenCollection _tokenCollection_, 24 @SuppressWarnings ("hiding") PPriorities _priorities_, 25 @SuppressWarnings ("hiding") PIgnored _ignored_, 26 @SuppressWarnings ("hiding") PLookahead _lookahead_) 27 { 28 setName(_name_); 30 31 setTokenCollection(_tokenCollection_); 32 33 setPriorities(_priorities_); 34 35 setIgnored(_ignored_); 36 37 setLookahead(_lookahead_); 38 39 } 40 41 @Override 42 public Object clone() 43 { 44 return new ANormalState( 45 cloneNode(this._name_), 46 cloneNode(this._tokenCollection_), 47 cloneNode(this._priorities_), 48 cloneNode(this._ignored_), 49 cloneNode(this._lookahead_)); 50 } 51 52 public void apply(Switch sw) 53 { 54 ((Analysis) sw).caseANormalState(this); 55 } 56 57 public TIdentifier getName() 58 { 59 return this._name_; 60 } 61 62 public void setName(TIdentifier node) 63 { 64 if(this._name_ != null) 65 { 66 this._name_.parent(null); 67 } 68 69 if(node != null) 70 { 71 if(node.parent() != null) 72 { 73 node.parent().removeChild(node); 74 } 75 76 node.parent(this); 77 } 78 79 this._name_ = node; 80 } 81 82 public PTokenCollection getTokenCollection() 83 { 84 return this._tokenCollection_; 85 } 86 87 public void setTokenCollection(PTokenCollection node) 88 { 89 if(this._tokenCollection_ != null) 90 { 91 this._tokenCollection_.parent(null); 92 } 93 94 if(node != null) 95 { 96 if(node.parent() != null) 97 { 98 node.parent().removeChild(node); 99 } 100 101 node.parent(this); 102 } 103 104 this._tokenCollection_ = node; 105 } 106 107 public PPriorities getPriorities() 108 { 109 return this._priorities_; 110 } 111 112 public void setPriorities(PPriorities node) 113 { 114 if(this._priorities_ != null) 115 { 116 this._priorities_.parent(null); 117 } 118 119 if(node != null) 120 { 121 if(node.parent() != null) 122 { 123 node.parent().removeChild(node); 124 } 125 126 node.parent(this); 127 } 128 129 this._priorities_ = node; 130 } 131 132 public PIgnored getIgnored() 133 { 134 return this._ignored_; 135 } 136 137 public void setIgnored(PIgnored node) 138 { 139 if(this._ignored_ != null) 140 { 141 this._ignored_.parent(null); 142 } 143 144 if(node != null) 145 { 146 if(node.parent() != null) 147 { 148 node.parent().removeChild(node); 149 } 150 151 node.parent(this); 152 } 153 154 this._ignored_ = node; 155 } 156 157 public PLookahead getLookahead() 158 { 159 return this._lookahead_; 160 } 161 162 public void setLookahead(PLookahead node) 163 { 164 if(this._lookahead_ != null) 165 { 166 this._lookahead_.parent(null); 167 } 168 169 if(node != null) 170 { 171 if(node.parent() != null) 172 { 173 node.parent().removeChild(node); 174 } 175 176 node.parent(this); 177 } 178 179 this._lookahead_ = node; 180 } 181 182 @Override 183 public String toString() 184 { 185 return "" 186 + toString(this._name_) 187 + toString(this._tokenCollection_) 188 + toString(this._priorities_) 189 + toString(this._ignored_) 190 + toString(this._lookahead_); 191 } 192 193 @Override 194 void removeChild(@SuppressWarnings ("unused") Node child) 195 { 196 if(this._name_ == child) 198 { 199 this._name_ = null; 200 return; 201 } 202 203 if(this._tokenCollection_ == child) 204 { 205 this._tokenCollection_ = null; 206 return; 207 } 208 209 if(this._priorities_ == child) 210 { 211 this._priorities_ = null; 212 return; 213 } 214 215 if(this._ignored_ == child) 216 { 217 this._ignored_ = null; 218 return; 219 } 220 221 if(this._lookahead_ == child) 222 { 223 this._lookahead_ = null; 224 return; 225 } 226 227 throw new RuntimeException ("Not a child."); 228 } 229 230 @Override 231 void replaceChild(@SuppressWarnings ("unused") Node oldChild, @SuppressWarnings ("unused") Node newChild) 232 { 233 if(this._name_ == oldChild) 235 { 236 setName((TIdentifier) newChild); 237 return; 238 } 239 240 if(this._tokenCollection_ == oldChild) 241 { 242 setTokenCollection((PTokenCollection) newChild); 243 return; 244 } 245 246 if(this._priorities_ == oldChild) 247 { 248 setPriorities((PPriorities) newChild); 249 return; 250 } 251 252 if(this._ignored_ == oldChild) 253 { 254 setIgnored((PIgnored) newChild); 255 return; 256 } 257 258 if(this._lookahead_ == oldChild) 259 { 260 setLookahead((PLookahead) newChild); 261 return; 262 } 263 264 throw new RuntimeException ("Not a child."); 265 } 266 } 267 | Popular Tags |