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 AParameterFunction extends PFunction
009 {
010 private PName _name_;
011 private TLParenthese _lParenthese_;
012 private PArgumentList _argumentList_;
013 private TRParenthese _rParenthese_;
014
015 public AParameterFunction()
016 {
017 // Constructor
018 }
019
020 public AParameterFunction(
021 @SuppressWarnings("hiding") PName _name_,
022 @SuppressWarnings("hiding") TLParenthese _lParenthese_,
023 @SuppressWarnings("hiding") PArgumentList _argumentList_,
024 @SuppressWarnings("hiding") TRParenthese _rParenthese_)
025 {
026 // Constructor
027 setName(_name_);
028
029 setLParenthese(_lParenthese_);
030
031 setArgumentList(_argumentList_);
032
033 setRParenthese(_rParenthese_);
034
035 }
036
037 @Override
038 public Object clone()
039 {
040 return new AParameterFunction(
041 cloneNode(this._name_),
042 cloneNode(this._lParenthese_),
043 cloneNode(this._argumentList_),
044 cloneNode(this._rParenthese_));
045 }
046
047 public void apply(Switch sw)
048 {
049 ((Analysis) sw).caseAParameterFunction(this);
050 }
051
052 public PName getName()
053 {
054 return this._name_;
055 }
056
057 public void setName(PName node)
058 {
059 if(this._name_ != null)
060 {
061 this._name_.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._name_ = node;
075 }
076
077 public TLParenthese getLParenthese()
078 {
079 return this._lParenthese_;
080 }
081
082 public void setLParenthese(TLParenthese node)
083 {
084 if(this._lParenthese_ != null)
085 {
086 this._lParenthese_.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._lParenthese_ = node;
100 }
101
102 public PArgumentList getArgumentList()
103 {
104 return this._argumentList_;
105 }
106
107 public void setArgumentList(PArgumentList node)
108 {
109 if(this._argumentList_ != null)
110 {
111 this._argumentList_.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._argumentList_ = node;
125 }
126
127 public TRParenthese getRParenthese()
128 {
129 return this._rParenthese_;
130 }
131
132 public void setRParenthese(TRParenthese node)
133 {
134 if(this._rParenthese_ != null)
135 {
136 this._rParenthese_.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._rParenthese_ = node;
150 }
151
152 @Override
153 public String toString()
154 {
155 return ""
156 + toString(this._name_)
157 + toString(this._lParenthese_)
158 + toString(this._argumentList_)
159 + toString(this._rParenthese_);
160 }
161
162 @Override
163 void removeChild(@SuppressWarnings("unused") Node child)
164 {
165 // Remove child
166 if(this._name_ == child)
167 {
168 this._name_ = null;
169 return;
170 }
171
172 if(this._lParenthese_ == child)
173 {
174 this._lParenthese_ = null;
175 return;
176 }
177
178 if(this._argumentList_ == child)
179 {
180 this._argumentList_ = null;
181 return;
182 }
183
184 if(this._rParenthese_ == child)
185 {
186 this._rParenthese_ = 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._name_ == oldChild)
198 {
199 setName((PName) newChild);
200 return;
201 }
202
203 if(this._lParenthese_ == oldChild)
204 {
205 setLParenthese((TLParenthese) newChild);
206 return;
207 }
208
209 if(this._argumentList_ == oldChild)
210 {
211 setArgumentList((PArgumentList) newChild);
212 return;
213 }
214
215 if(this._rParenthese_ == oldChild)
216 {
217 setRParenthese((TRParenthese) newChild);
218 return;
219 }
220
221 throw new RuntimeException("Not a child.");
222 }
223 }