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