001 /* This file was generated by SableCC (http://www.sablecc.org/). */
002
003 package org.jdmp.core.script.jdmp.node;
004
005 import org.jdmp.core.script.jdmp.analysis.*;
006
007 @SuppressWarnings("nls")
008 public final class ARangeLevel5 extends PLevel5
009 {
010 private PLevel4 _min_;
011 private TColon _colon_;
012 private PStepsize _stepsize_;
013 private PLevel4 _max_;
014
015 public ARangeLevel5()
016 {
017 // Constructor
018 }
019
020 public ARangeLevel5(
021 @SuppressWarnings("hiding") PLevel4 _min_,
022 @SuppressWarnings("hiding") TColon _colon_,
023 @SuppressWarnings("hiding") PStepsize _stepsize_,
024 @SuppressWarnings("hiding") PLevel4 _max_)
025 {
026 // Constructor
027 setMin(_min_);
028
029 setColon(_colon_);
030
031 setStepsize(_stepsize_);
032
033 setMax(_max_);
034
035 }
036
037 @Override
038 public Object clone()
039 {
040 return new ARangeLevel5(
041 cloneNode(this._min_),
042 cloneNode(this._colon_),
043 cloneNode(this._stepsize_),
044 cloneNode(this._max_));
045 }
046
047 public void apply(Switch sw)
048 {
049 ((Analysis) sw).caseARangeLevel5(this);
050 }
051
052 public PLevel4 getMin()
053 {
054 return this._min_;
055 }
056
057 public void setMin(PLevel4 node)
058 {
059 if(this._min_ != null)
060 {
061 this._min_.parent(null);
062 }
063
064 if(node != null)
065 {
066 if(node.parent() != null)
067 {
068 node.parent().removeChild(node);
069 }
070
071 node.parent(this);
072 }
073
074 this._min_ = node;
075 }
076
077 public TColon getColon()
078 {
079 return this._colon_;
080 }
081
082 public void setColon(TColon node)
083 {
084 if(this._colon_ != null)
085 {
086 this._colon_.parent(null);
087 }
088
089 if(node != null)
090 {
091 if(node.parent() != null)
092 {
093 node.parent().removeChild(node);
094 }
095
096 node.parent(this);
097 }
098
099 this._colon_ = node;
100 }
101
102 public PStepsize getStepsize()
103 {
104 return this._stepsize_;
105 }
106
107 public void setStepsize(PStepsize node)
108 {
109 if(this._stepsize_ != null)
110 {
111 this._stepsize_.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._stepsize_ = node;
125 }
126
127 public PLevel4 getMax()
128 {
129 return this._max_;
130 }
131
132 public void setMax(PLevel4 node)
133 {
134 if(this._max_ != null)
135 {
136 this._max_.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._max_ = node;
150 }
151
152 @Override
153 public String toString()
154 {
155 return ""
156 + toString(this._min_)
157 + toString(this._colon_)
158 + toString(this._stepsize_)
159 + toString(this._max_);
160 }
161
162 @Override
163 void removeChild(@SuppressWarnings("unused") Node child)
164 {
165 // Remove child
166 if(this._min_ == child)
167 {
168 this._min_ = null;
169 return;
170 }
171
172 if(this._colon_ == child)
173 {
174 this._colon_ = null;
175 return;
176 }
177
178 if(this._stepsize_ == child)
179 {
180 this._stepsize_ = null;
181 return;
182 }
183
184 if(this._max_ == child)
185 {
186 this._max_ = 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 // Replace child
197 if(this._min_ == oldChild)
198 {
199 setMin((PLevel4) newChild);
200 return;
201 }
202
203 if(this._colon_ == oldChild)
204 {
205 setColon((TColon) newChild);
206 return;
207 }
208
209 if(this._stepsize_ == oldChild)
210 {
211 setStepsize((PStepsize) newChild);
212 return;
213 }
214
215 if(this._max_ == oldChild)
216 {
217 setMax((PLevel4) newChild);
218 return;
219 }
220
221 throw new RuntimeException("Not a child.");
222 }
223 }