KickJava   Java API By Example, From Geeks To Geeks.

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


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