KickJava   Java API By Example, From Geeks To Geeks.

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


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 ARangeRegularExpression extends PRegularExpression
9 {
10     private PRegularExpression _regularExpression_;
11     private TNumber _from_;
12     private TNumber _to_;
13
14     public ARangeRegularExpression()
15     {
16         // Constructor
17
}
18
19     public ARangeRegularExpression(
20         @SuppressWarnings JavaDoc("hiding") PRegularExpression _regularExpression_,
21         @SuppressWarnings JavaDoc("hiding") TNumber _from_,
22         @SuppressWarnings JavaDoc("hiding") TNumber _to_)
23     {
24         // Constructor
25
setRegularExpression(_regularExpression_);
26
27         setFrom(_from_);
28
29         setTo(_to_);
30
31     }
32
33     @Override JavaDoc
34     public Object JavaDoc clone()
35     {
36         return new ARangeRegularExpression(
37             cloneNode(this._regularExpression_),
38             cloneNode(this._from_),
39             cloneNode(this._to_));
40     }
41
42     public void apply(Switch sw)
43     {
44         ((Analysis) sw).caseARangeRegularExpression(this);
45     }
46
47     public PRegularExpression getRegularExpression()
48     {
49         return this._regularExpression_;
50     }
51
52     public void setRegularExpression(PRegularExpression node)
53     {
54         if(this._regularExpression_ != null)
55         {
56             this._regularExpression_.parent(null);
57         }
58
59         if(node != null)
60         {
61             if(node.parent() != null)
62             {
63                 node.parent().removeChild(node);
64             }
65
66             node.parent(this);
67         }
68
69         this._regularExpression_ = node;
70     }
71
72     public TNumber getFrom()
73     {
74         return this._from_;
75     }
76
77     public void setFrom(TNumber node)
78     {
79         if(this._from_ != null)
80         {
81             this._from_.parent(null);
82         }
83
84         if(node != null)
85         {
86             if(node.parent() != null)
87             {
88                 node.parent().removeChild(node);
89             }
90
91             node.parent(this);
92         }
93
94         this._from_ = node;
95     }
96
97     public TNumber getTo()
98     {
99         return this._to_;
100     }
101
102     public void setTo(TNumber node)
103     {
104         if(this._to_ != null)
105         {
106             this._to_.parent(null);
107         }
108
109         if(node != null)
110         {
111             if(node.parent() != null)
112             {
113                 node.parent().removeChild(node);
114             }
115
116             node.parent(this);
117         }
118
119         this._to_ = node;
120     }
121
122     @Override JavaDoc
123     public String JavaDoc toString()
124     {
125         return ""
126             + toString(this._regularExpression_)
127             + toString(this._from_)
128             + toString(this._to_);
129     }
130
131     @Override JavaDoc
132     void removeChild(@SuppressWarnings JavaDoc("unused") Node child)
133     {
134         // Remove child
135
if(this._regularExpression_ == child)
136         {
137             this._regularExpression_ = null;
138             return;
139         }
140
141         if(this._from_ == child)
142         {
143             this._from_ = null;
144             return;
145         }
146
147         if(this._to_ == child)
148         {
149             this._to_ = null;
150             return;
151         }
152
153         throw new RuntimeException JavaDoc("Not a child.");
154     }
155
156     @Override JavaDoc
157     void replaceChild(@SuppressWarnings JavaDoc("unused") Node oldChild, @SuppressWarnings JavaDoc("unused") Node newChild)
158     {
159         // Replace child
160
if(this._regularExpression_ == oldChild)
161         {
162             setRegularExpression((PRegularExpression) newChild);
163             return;
164         }
165
166         if(this._from_ == oldChild)
167         {
168             setFrom((TNumber) newChild);
169             return;
170         }
171
172         if(this._to_ == oldChild)
173         {
174             setTo((TNumber) newChild);
175             return;
176         }
177
178         throw new RuntimeException JavaDoc("Not a child.");
179     }
180 }
181
Popular Tags