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 ASelectionToken extends PToken 9 { 10 private PSelection _selection_; 11 private PSelector _selector_; 12 private PRegularExpression _regularExpression_; 13 private TThreeDots _threeDots_; 14 15 public ASelectionToken() 16 { 17 } 19 20 public ASelectionToken( 21 @SuppressWarnings ("hiding") PSelection _selection_, 22 @SuppressWarnings ("hiding") PSelector _selector_, 23 @SuppressWarnings ("hiding") PRegularExpression _regularExpression_, 24 @SuppressWarnings ("hiding") TThreeDots _threeDots_) 25 { 26 setSelection(_selection_); 28 29 setSelector(_selector_); 30 31 setRegularExpression(_regularExpression_); 32 33 setThreeDots(_threeDots_); 34 35 } 36 37 @Override 38 public Object clone() 39 { 40 return new ASelectionToken( 41 cloneNode(this._selection_), 42 cloneNode(this._selector_), 43 cloneNode(this._regularExpression_), 44 cloneNode(this._threeDots_)); 45 } 46 47 public void apply(Switch sw) 48 { 49 ((Analysis) sw).caseASelectionToken(this); 50 } 51 52 public PSelection getSelection() 53 { 54 return this._selection_; 55 } 56 57 public void setSelection(PSelection node) 58 { 59 if(this._selection_ != null) 60 { 61 this._selection_.parent(null); 62 } 63 64 if(node != null) 65 { 66 if(node.parent() != null) 67 { 68 node.parent().removeChild(node); 69 } 70 71 node.parent(this); 72 } 73 74 this._selection_ = node; 75 } 76 77 public PSelector getSelector() 78 { 79 return this._selector_; 80 } 81 82 public void setSelector(PSelector node) 83 { 84 if(this._selector_ != null) 85 { 86 this._selector_.parent(null); 87 } 88 89 if(node != null) 90 { 91 if(node.parent() != null) 92 { 93 node.parent().removeChild(node); 94 } 95 96 node.parent(this); 97 } 98 99 this._selector_ = node; 100 } 101 102 public PRegularExpression getRegularExpression() 103 { 104 return this._regularExpression_; 105 } 106 107 public void setRegularExpression(PRegularExpression node) 108 { 109 if(this._regularExpression_ != null) 110 { 111 this._regularExpression_.parent(null); 112 } 113 114 if(node != null) 115 { 116 if(node.parent() != null) 117 { 118 node.parent().removeChild(node); 119 } 120 121 node.parent(this); 122 } 123 124 this._regularExpression_ = node; 125 } 126 127 public TThreeDots getThreeDots() 128 { 129 return this._threeDots_; 130 } 131 132 public void setThreeDots(TThreeDots node) 133 { 134 if(this._threeDots_ != null) 135 { 136 this._threeDots_.parent(null); 137 } 138 139 if(node != null) 140 { 141 if(node.parent() != null) 142 { 143 node.parent().removeChild(node); 144 } 145 146 node.parent(this); 147 } 148 149 this._threeDots_ = node; 150 } 151 152 @Override 153 public String toString() 154 { 155 return "" 156 + toString(this._selection_) 157 + toString(this._selector_) 158 + toString(this._regularExpression_) 159 + toString(this._threeDots_); 160 } 161 162 @Override 163 void removeChild(@SuppressWarnings ("unused") Node child) 164 { 165 if(this._selection_ == child) 167 { 168 this._selection_ = null; 169 return; 170 } 171 172 if(this._selector_ == child) 173 { 174 this._selector_ = null; 175 return; 176 } 177 178 if(this._regularExpression_ == child) 179 { 180 this._regularExpression_ = null; 181 return; 182 } 183 184 if(this._threeDots_ == child) 185 { 186 this._threeDots_ = null; 187 return; 188 } 189 190 throw new RuntimeException ("Not a child."); 191 } 192 193 @Override 194 void replaceChild(@SuppressWarnings ("unused") Node oldChild, @SuppressWarnings ("unused") Node newChild) 195 { 196 if(this._selection_ == oldChild) 198 { 199 setSelection((PSelection) newChild); 200 return; 201 } 202 203 if(this._selector_ == oldChild) 204 { 205 setSelector((PSelector) newChild); 206 return; 207 } 208 209 if(this._regularExpression_ == oldChild) 210 { 211 setRegularExpression((PRegularExpression) newChild); 212 return; 213 } 214 215 if(this._threeDots_ == oldChild) 216 { 217 setThreeDots((TThreeDots) newChild); 218 return; 219 } 220 221 throw new RuntimeException ("Not a child."); 222 } 223 } 224 | Popular Tags |