| 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 ACastTerm extends PTerm |
| 9 | { |
| 10 | private TLSq _lSq_; |
| 11 | private TIdentifier _identifier_; |
| 12 | private TRSq _rSq_; |
| 13 | private PNonLeftRecTerm _nonLeftRecTerm_; |
| 14 | |
| 15 | public ACastTerm() |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | public ACastTerm( |
| 20 | TLSq _lSq_, |
| 21 | TIdentifier _identifier_, |
| 22 | TRSq _rSq_, |
| 23 | PNonLeftRecTerm _nonLeftRecTerm_) |
| 24 | { |
| 25 | setLSq(_lSq_); |
| 26 | |
| 27 | setIdentifier(_identifier_); |
| 28 | |
| 29 | setRSq(_rSq_); |
| 30 | |
| 31 | setNonLeftRecTerm(_nonLeftRecTerm_); |
| 32 | |
| 33 | } |
| 34 | public Object clone() |
| 35 | { |
| 36 | return new ACastTerm( |
| 37 | (TLSq) cloneNode(_lSq_), |
| 38 | (TIdentifier) cloneNode(_identifier_), |
| 39 | (TRSq) cloneNode(_rSq_), |
| 40 | (PNonLeftRecTerm) cloneNode(_nonLeftRecTerm_)); |
| 41 | } |
| 42 | |
| 43 | public void apply(Switch sw) |
| 44 | { |
| 45 | ((Analysis) sw).caseACastTerm(this); |
| 46 | } |
| 47 | |
| 48 | public TLSq getLSq() |
| 49 | { |
| 50 | return _lSq_; |
| 51 | } |
| 52 | |
| 53 | public void setLSq(TLSq node) |
| 54 | { |
| 55 | if(_lSq_ != null) |
| 56 | { |
| 57 | _lSq_.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 | _lSq_ = node; |
| 71 | } |
| 72 | |
| 73 | public TIdentifier getIdentifier() |
| 74 | { |
| 75 | return _identifier_; |
| 76 | } |
| 77 | |
| 78 | public void setIdentifier(TIdentifier node) |
| 79 | { |
| 80 | if(_identifier_ != null) |
| 81 | { |
| 82 | _identifier_.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 | _identifier_ = node; |
| 96 | } |
| 97 | |
| 98 | public TRSq getRSq() |
| 99 | { |
| 100 | return _rSq_; |
| 101 | } |
| 102 | |
| 103 | public void setRSq(TRSq node) |
| 104 | { |
| 105 | if(_rSq_ != null) |
| 106 | { |
| 107 | _rSq_.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 | _rSq_ = node; |
| 121 | } |
| 122 | |
| 123 | public PNonLeftRecTerm getNonLeftRecTerm() |
| 124 | { |
| 125 | return _nonLeftRecTerm_; |
| 126 | } |
| 127 | |
| 128 | public void setNonLeftRecTerm(PNonLeftRecTerm node) |
| 129 | { |
| 130 | if(_nonLeftRecTerm_ != null) |
| 131 | { |
| 132 | _nonLeftRecTerm_.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 | _nonLeftRecTerm_ = node; |
| 146 | } |
| 147 | |
| 148 | public String toString() |
| 149 | { |
| 150 | return "" |
| 151 | + toString(_lSq_) |
| 152 | + toString(_identifier_) |
| 153 | + toString(_rSq_) |
| 154 | + toString(_nonLeftRecTerm_); |
| 155 | } |
| 156 | |
| 157 | void removeChild(Node child) |
| 158 | { |
| 159 | if(_lSq_ == child) |
| 160 | { |
| 161 | _lSq_ = null; |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | if(_identifier_ == child) |
| 166 | { |
| 167 | _identifier_ = null; |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | if(_rSq_ == child) |
| 172 | { |
| 173 | _rSq_ = null; |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | if(_nonLeftRecTerm_ == child) |
| 178 | { |
| 179 | _nonLeftRecTerm_ = null; |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | } |
| 184 | |
| 185 | void replaceChild(Node oldChild, Node newChild) |
| 186 | { |
| 187 | if(_lSq_ == oldChild) |
| 188 | { |
| 189 | setLSq((TLSq) newChild); |
| 190 | return; |
| 191 | } |
| 192 | |
| 193 | if(_identifier_ == oldChild) |
| 194 | { |
| 195 | setIdentifier((TIdentifier) newChild); |
| 196 | return; |
| 197 | } |
| 198 | |
| 199 | if(_rSq_ == oldChild) |
| 200 | { |
| 201 | setRSq((TRSq) newChild); |
| 202 | return; |
| 203 | } |
| 204 | |
| 205 | if(_nonLeftRecTerm_ == oldChild) |
| 206 | { |
| 207 | setNonLeftRecTerm((PNonLeftRecTerm) newChild); |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | } |
| 212 | } |