KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sablecc > sablecc > syntax3 > node > AInternalState


1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2
3 package org.sablecc.sablecc.syntax3.node;
4
5 import org.sablecc.sablecc.syntax3.analysis.*;
6
7 @SuppressWarnings JavaDoc("nls")
8 public final class AInternalState extends PInternalState
9 {
10     private TIdentifier _name_;
11     private PTokenCollection _tokenCollection_;
12     private PPriorities _priorities_;
13     private PLookahead _lookahead_;
14
15     public AInternalState()
16     {
17         // Constructor
18
}
19
20     public AInternalState(
21         @SuppressWarnings JavaDoc("hiding") TIdentifier _name_,
22         @SuppressWarnings JavaDoc("hiding") PTokenCollection _tokenCollection_,
23         @SuppressWarnings JavaDoc("hiding") PPriorities _priorities_,
24         @SuppressWarnings JavaDoc("hiding") PLookahead _lookahead_)
25     {
26         // Constructor
27
setName(_name_);
28
29         setTokenCollection(_tokenCollection_);
30
31         setPriorities(_priorities_);
32
33         setLookahead(_lookahead_);
34
35     }
36
37     @Override JavaDoc
38     public Object JavaDoc clone()
39     {
40         return new AInternalState(
41             cloneNode(this._name_),
42             cloneNode(this._tokenCollection_),
43             cloneNode(this._priorities_),
44             cloneNode(this._lookahead_));
45     }
46
47     public void apply(Switch sw)
48     {
49         ((Analysis) sw).caseAInternalState(this);
50     }
51
52     public TIdentifier getName()
53     {
54         return this._name_;
55     }
56
57     public void setName(TIdentifier node)
58     {
59         if(this._name_ != null)
60         {
61             this._name_.parent(null);
62         }
63
64         if(node != null)
65         {
66             if(node.parent() != null)
67             {
68                 node.parent().removeChild(node);
69             }
70
71             node.parent(this);
72         }
73
74         this._name_ = node;
75     }
76
77     public PTokenCollection getTokenCollection()
78     {
79         return this._tokenCollection_;
80     }
81
82     public void setTokenCollection(PTokenCollection node)
83     {
84         if(this._tokenCollection_ != null)
85         {
86             this._tokenCollection_.parent(null);
87         }
88
89         if(node != null)
90         {
91             if(node.parent() != null)
92             {
93                 node.parent().removeChild(node);
94             }
95
96             node.parent(this);
97         }
98
99         this._tokenCollection_ = node;
100     }
101
102     public PPriorities getPriorities()
103     {
104         return this._priorities_;
105     }
106
107     public void setPriorities(PPriorities node)
108     {
109         if(this._priorities_ != null)
110         {
111             this._priorities_.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._priorities_ = node;
125     }
126
127     public PLookahead getLookahead()
128     {
129         return this._lookahead_;
130     }
131
132     public void setLookahead(PLookahead node)
133     {
134         if(this._lookahead_ != null)
135         {
136             this._lookahead_.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._lookahead_ = node;
150     }
151
152     @Override JavaDoc
153     public String JavaDoc toString()
154     {
155         return ""
156             + toString(this._name_)
157             + toString(this._tokenCollection_)
158             + toString(this._priorities_)
159             + toString(this._lookahead_);
160     }
161
162     @Override JavaDoc
163     void removeChild(@SuppressWarnings JavaDoc("unused") Node child)
164     {
165         // Remove child
166
if(this._name_ == child)
167         {
168             this._name_ = null;
169             return;
170         }
171
172         if(this._tokenCollection_ == child)
173         {
174             this._tokenCollection_ = null;
175             return;
176         }
177
178         if(this._priorities_ == child)
179         {
180             this._priorities_ = null;
181             return;
182         }
183
184         if(this._lookahead_ == child)
185         {
186             this._lookahead_ = null;
187             return;
188         }
189
190         throw new RuntimeException JavaDoc("Not a child.");
191     }
192
193     @Override JavaDoc
194     void replaceChild(@SuppressWarnings JavaDoc("unused") Node oldChild, @SuppressWarnings JavaDoc("unused") Node newChild)
195     {
196         // Replace child
197
if(this._name_ == oldChild)
198         {
199             setName((TIdentifier) newChild);
200             return;
201         }
202
203         if(this._tokenCollection_ == oldChild)
204         {
205             setTokenCollection((PTokenCollection) newChild);
206             return;
207         }
208
209         if(this._priorities_ == oldChild)
210         {
211             setPriorities((PPriorities) newChild);
212             return;
213         }
214
215         if(this._lookahead_ == oldChild)
216         {
217             setLookahead((PLookahead) newChild);
218             return;
219         }
220
221         throw new RuntimeException JavaDoc("Not a child.");
222     }
223 }
224
Popular Tags