]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.basicexpression/src/org/simantics/basicexpression/node/Start.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.basicexpression / src / org / simantics / basicexpression / node / Start.java
1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2
3 package org.simantics.basicexpression.node;
4
5 import org.simantics.basicexpression.analysis.*;
6
7 @SuppressWarnings("nls")
8 public final class Start extends Node
9 {
10     private PExpression _pExpression_;
11     private EOF _eof_;
12
13     public Start()
14     {
15         // Empty body
16     }
17
18     public Start(
19         @SuppressWarnings("hiding") PExpression _pExpression_,
20         @SuppressWarnings("hiding") EOF _eof_)
21     {
22         setPExpression(_pExpression_);
23         setEOF(_eof_);
24     }
25
26     @Override
27     public Object clone()
28     {
29         return new Start(
30             cloneNode(this._pExpression_),
31             cloneNode(this._eof_));
32     }
33
34     public void apply(Switch sw)
35     {
36         ((Analysis) sw).caseStart(this);
37     }
38
39     public PExpression getPExpression()
40     {
41         return this._pExpression_;
42     }
43
44     public void setPExpression(PExpression node)
45     {
46         if(this._pExpression_ != null)
47         {
48             this._pExpression_.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._pExpression_ = 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
90     void removeChild(Node child)
91     {
92         if(this._pExpression_ == child)
93         {
94             this._pExpression_ = null;
95             return;
96         }
97
98         if(this._eof_ == child)
99         {
100             this._eof_ = null;
101             return;
102         }
103
104         throw new RuntimeException("Not a child.");
105     }
106
107     @Override
108     void replaceChild(Node oldChild, Node newChild)
109     {
110         if(this._pExpression_ == oldChild)
111         {
112             setPExpression((PExpression) newChild);
113             return;
114         }
115
116         if(this._eof_ == oldChild)
117         {
118             setEOF((EOF) newChild);
119             return;
120         }
121
122         throw new RuntimeException("Not a child.");
123     }
124
125     @Override
126     public String toString()
127     {
128         return "" +
129             toString(this._pExpression_) +
130             toString(this._eof_);
131     }
132 }