KickJava   Java API By Example, From Geeks To Geeks.

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


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 AIntervalRegularExpression extends PRegularExpression
9 {
10     private PCharacter _lowerBound_;
11     private PCharacter _upperBound_;
12
13     public AIntervalRegularExpression()
14     {
15         // Constructor
16
}
17
18     public AIntervalRegularExpression(
19         @SuppressWarnings JavaDoc("hiding") PCharacter _lowerBound_,
20         @SuppressWarnings JavaDoc("hiding") PCharacter _upperBound_)
21     {
22         // Constructor
23
setLowerBound(_lowerBound_);
24
25         setUpperBound(_upperBound_);
26
27     }
28
29     @Override JavaDoc
30     public Object JavaDoc clone()
31     {
32         return new AIntervalRegularExpression(
33             cloneNode(this._lowerBound_),
34             cloneNode(this._upperBound_));
35     }
36
37     public void apply(Switch sw)
38     {
39         ((Analysis) sw).caseAIntervalRegularExpression(this);
40     }
41
42     public PCharacter getLowerBound()
43     {
44         return this._lowerBound_;
45     }
46
47     public void setLowerBound(PCharacter node)
48     {
49         if(this._lowerBound_ != null)
50         {
51             this._lowerBound_.parent(null);
52         }
53
54         if(node != null)
55         {
56             if(node.parent() != null)
57             {
58                 node.parent().removeChild(node);
59             }
60
61             node.parent(this);
62         }
63
64         this._lowerBound_ = node;
65     }
66
67     public PCharacter getUpperBound()
68     {
69         return this._upperBound_;
70     }
71
72     public void setUpperBound(PCharacter node)
73     {
74         if(this._upperBound_ != null)
75         {
76             this._upperBound_.parent(null);
77         }
78
79         if(node != null)
80         {
81             if(node.parent() != null)
82             {
83                 node.parent().removeChild(node);
84             }
85
86             node.parent(this);
87         }
88
89         this._upperBound_ = node;
90     }
91
92     @Override JavaDoc
93     public String JavaDoc toString()
94     {
95         return ""
96             + toString(this._lowerBound_)
97             + toString(this._upperBound_);
98     }
99
100     @Override JavaDoc
101     void removeChild(@SuppressWarnings JavaDoc("unused") Node child)
102     {
103         // Remove child
104
if(this._lowerBound_ == child)
105         {
106             this._lowerBound_ = null;
107             return;
108         }
109
110         if(this._upperBound_ == child)
111         {
112             this._upperBound_ = null;
113             return;
114         }
115
116         throw new RuntimeException JavaDoc("Not a child.");
117     }
118
119     @Override JavaDoc
120     void replaceChild(@SuppressWarnings JavaDoc("unused") Node oldChild, @SuppressWarnings JavaDoc("unused") Node newChild)
121     {
122         // Replace child
123
if(this._lowerBound_ == oldChild)
124         {
125             setLowerBound((PCharacter) newChild);
126             return;
127         }
128
129         if(this._upperBound_ == oldChild)
130         {
131             setUpperBound((PCharacter) newChild);
132             return;
133         }
134
135         throw new RuntimeException JavaDoc("Not a child.");
136     }
137 }
138
Popular Tags