]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.basicexpression/src/org/simantics/basicexpression/node/AFunctionPrimary.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.basicexpression / src / org / simantics / basicexpression / node / AFunctionPrimary.java
1 /* This file was generated by SableCC (http://www.sablecc.org/). */\r
2 \r
3 package org.simantics.basicexpression.node;\r
4 \r
5 import org.simantics.basicexpression.analysis.*;\r
6 \r
7 @SuppressWarnings("nls")\r
8 public final class AFunctionPrimary extends PPrimary\r
9 {\r
10     private TFunc _func_;\r
11     private PArgList _argList_;\r
12     private TRPar _rPar_;\r
13 \r
14     public AFunctionPrimary()\r
15     {\r
16         // Constructor\r
17     }\r
18 \r
19     public AFunctionPrimary(\r
20         @SuppressWarnings("hiding") TFunc _func_,\r
21         @SuppressWarnings("hiding") PArgList _argList_,\r
22         @SuppressWarnings("hiding") TRPar _rPar_)\r
23     {\r
24         // Constructor\r
25         setFunc(_func_);\r
26 \r
27         setArgList(_argList_);\r
28 \r
29         setRPar(_rPar_);\r
30 \r
31     }\r
32 \r
33     @Override\r
34     public Object clone()\r
35     {\r
36         return new AFunctionPrimary(\r
37             cloneNode(this._func_),\r
38             cloneNode(this._argList_),\r
39             cloneNode(this._rPar_));\r
40     }\r
41 \r
42     public void apply(Switch sw)\r
43     {\r
44         ((Analysis) sw).caseAFunctionPrimary(this);\r
45     }\r
46 \r
47     public TFunc getFunc()\r
48     {\r
49         return this._func_;\r
50     }\r
51 \r
52     public void setFunc(TFunc node)\r
53     {\r
54         if(this._func_ != null)\r
55         {\r
56             this._func_.parent(null);\r
57         }\r
58 \r
59         if(node != null)\r
60         {\r
61             if(node.parent() != null)\r
62             {\r
63                 node.parent().removeChild(node);\r
64             }\r
65 \r
66             node.parent(this);\r
67         }\r
68 \r
69         this._func_ = node;\r
70     }\r
71 \r
72     public PArgList getArgList()\r
73     {\r
74         return this._argList_;\r
75     }\r
76 \r
77     public void setArgList(PArgList node)\r
78     {\r
79         if(this._argList_ != null)\r
80         {\r
81             this._argList_.parent(null);\r
82         }\r
83 \r
84         if(node != null)\r
85         {\r
86             if(node.parent() != null)\r
87             {\r
88                 node.parent().removeChild(node);\r
89             }\r
90 \r
91             node.parent(this);\r
92         }\r
93 \r
94         this._argList_ = node;\r
95     }\r
96 \r
97     public TRPar getRPar()\r
98     {\r
99         return this._rPar_;\r
100     }\r
101 \r
102     public void setRPar(TRPar node)\r
103     {\r
104         if(this._rPar_ != null)\r
105         {\r
106             this._rPar_.parent(null);\r
107         }\r
108 \r
109         if(node != null)\r
110         {\r
111             if(node.parent() != null)\r
112             {\r
113                 node.parent().removeChild(node);\r
114             }\r
115 \r
116             node.parent(this);\r
117         }\r
118 \r
119         this._rPar_ = node;\r
120     }\r
121 \r
122     @Override\r
123     public String toString()\r
124     {\r
125         return ""\r
126             + toString(this._func_)\r
127             + toString(this._argList_)\r
128             + toString(this._rPar_);\r
129     }\r
130 \r
131     @Override\r
132     void removeChild(@SuppressWarnings("unused") Node child)\r
133     {\r
134         // Remove child\r
135         if(this._func_ == child)\r
136         {\r
137             this._func_ = null;\r
138             return;\r
139         }\r
140 \r
141         if(this._argList_ == child)\r
142         {\r
143             this._argList_ = null;\r
144             return;\r
145         }\r
146 \r
147         if(this._rPar_ == child)\r
148         {\r
149             this._rPar_ = null;\r
150             return;\r
151         }\r
152 \r
153         throw new RuntimeException("Not a child.");\r
154     }\r
155 \r
156     @Override\r
157     void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)\r
158     {\r
159         // Replace child\r
160         if(this._func_ == oldChild)\r
161         {\r
162             setFunc((TFunc) newChild);\r
163             return;\r
164         }\r
165 \r
166         if(this._argList_ == oldChild)\r
167         {\r
168             setArgList((PArgList) newChild);\r
169             return;\r
170         }\r
171 \r
172         if(this._rPar_ == oldChild)\r
173         {\r
174             setRPar((TRPar) newChild);\r
175             return;\r
176         }\r
177 \r
178         throw new RuntimeException("Not a child.");\r
179     }\r
180 }\r