| 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 AFieldAccessTerm extends PTerm |
| 9 | { |
| 10 | private PNonLeftRecTerm _nonLeftRecTerm_; |
| 11 | private TPeriod _period_; |
| 12 | private TIdentifier _identifier_; |
| 13 | |
| 14 | public AFieldAccessTerm() |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | public AFieldAccessTerm( |
| 19 | PNonLeftRecTerm _nonLeftRecTerm_, |
| 20 | TPeriod _period_, |
| 21 | TIdentifier _identifier_) |
| 22 | { |
| 23 | setNonLeftRecTerm(_nonLeftRecTerm_); |
| 24 | |
| 25 | setPeriod(_period_); |
| 26 | |
| 27 | setIdentifier(_identifier_); |
| 28 | |
| 29 | } |
| 30 | public Object clone() |
| 31 | { |
| 32 | return new AFieldAccessTerm( |
| 33 | (PNonLeftRecTerm) cloneNode(_nonLeftRecTerm_), |
| 34 | (TPeriod) cloneNode(_period_), |
| 35 | (TIdentifier) cloneNode(_identifier_)); |
| 36 | } |
| 37 | |
| 38 | public void apply(Switch sw) |
| 39 | { |
| 40 | ((Analysis) sw).caseAFieldAccessTerm(this); |
| 41 | } |
| 42 | |
| 43 | public PNonLeftRecTerm getNonLeftRecTerm() |
| 44 | { |
| 45 | return _nonLeftRecTerm_; |
| 46 | } |
| 47 | |
| 48 | public void setNonLeftRecTerm(PNonLeftRecTerm node) |
| 49 | { |
| 50 | if(_nonLeftRecTerm_ != null) |
| 51 | { |
| 52 | _nonLeftRecTerm_.parent(null); |
| 53 | } |
| 54 | |
| 55 | if(node != null) |
| 56 | { |
| 57 | if(node.parent() != null) |
| 58 | { |
| 59 | node.parent().removeChild(node); |
| 60 | } |
| 61 | |
| 62 | node.parent(this); |
| 63 | } |
| 64 | |
| 65 | _nonLeftRecTerm_ = node; |
| 66 | } |
| 67 | |
| 68 | public TPeriod getPeriod() |
| 69 | { |
| 70 | return _period_; |
| 71 | } |
| 72 | |
| 73 | public void setPeriod(TPeriod node) |
| 74 | { |
| 75 | if(_period_ != null) |
| 76 | { |
| 77 | _period_.parent(null); |
| 78 | } |
| 79 | |
| 80 | if(node != null) |
| 81 | { |
| 82 | if(node.parent() != null) |
| 83 | { |
| 84 | node.parent().removeChild(node); |
| 85 | } |
| 86 | |
| 87 | node.parent(this); |
| 88 | } |
| 89 | |
| 90 | _period_ = node; |
| 91 | } |
| 92 | |
| 93 | public TIdentifier getIdentifier() |
| 94 | { |
| 95 | return _identifier_; |
| 96 | } |
| 97 | |
| 98 | public void setIdentifier(TIdentifier node) |
| 99 | { |
| 100 | if(_identifier_ != null) |
| 101 | { |
| 102 | _identifier_.parent(null); |
| 103 | } |
| 104 | |
| 105 | if(node != null) |
| 106 | { |
| 107 | if(node.parent() != null) |
| 108 | { |
| 109 | node.parent().removeChild(node); |
| 110 | } |
| 111 | |
| 112 | node.parent(this); |
| 113 | } |
| 114 | |
| 115 | _identifier_ = node; |
| 116 | } |
| 117 | |
| 118 | public String toString() |
| 119 | { |
| 120 | return "" |
| 121 | + toString(_nonLeftRecTerm_) |
| 122 | + toString(_period_) |
| 123 | + toString(_identifier_); |
| 124 | } |
| 125 | |
| 126 | void removeChild(Node child) |
| 127 | { |
| 128 | if(_nonLeftRecTerm_ == child) |
| 129 | { |
| 130 | _nonLeftRecTerm_ = null; |
| 131 | return; |
| 132 | } |
| 133 | |
| 134 | if(_period_ == child) |
| 135 | { |
| 136 | _period_ = null; |
| 137 | return; |
| 138 | } |
| 139 | |
| 140 | if(_identifier_ == child) |
| 141 | { |
| 142 | _identifier_ = null; |
| 143 | return; |
| 144 | } |
| 145 | |
| 146 | } |
| 147 | |
| 148 | void replaceChild(Node oldChild, Node newChild) |
| 149 | { |
| 150 | if(_nonLeftRecTerm_ == oldChild) |
| 151 | { |
| 152 | setNonLeftRecTerm((PNonLeftRecTerm) newChild); |
| 153 | return; |
| 154 | } |
| 155 | |
| 156 | if(_period_ == oldChild) |
| 157 | { |
| 158 | setPeriod((TPeriod) newChild); |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | if(_identifier_ == oldChild) |
| 163 | { |
| 164 | setIdentifier((TIdentifier) newChild); |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | } |
| 169 | } |