]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.basicexpression/src/org/simantics/basicexpression/node/AAddressValue.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.basicexpression / src / org / simantics / basicexpression / node / AAddressValue.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 AAddressValue extends PValue\r
9 {\r
10     private TAmpersand _ampersand_;\r
11     private PRange _range_;\r
12 \r
13     public AAddressValue()\r
14     {\r
15         // Constructor\r
16     }\r
17 \r
18     public AAddressValue(\r
19         @SuppressWarnings("hiding") TAmpersand _ampersand_,\r
20         @SuppressWarnings("hiding") PRange _range_)\r
21     {\r
22         // Constructor\r
23         setAmpersand(_ampersand_);\r
24 \r
25         setRange(_range_);\r
26 \r
27     }\r
28 \r
29     @Override\r
30     public Object clone()\r
31     {\r
32         return new AAddressValue(\r
33             cloneNode(this._ampersand_),\r
34             cloneNode(this._range_));\r
35     }\r
36 \r
37     public void apply(Switch sw)\r
38     {\r
39         ((Analysis) sw).caseAAddressValue(this);\r
40     }\r
41 \r
42     public TAmpersand getAmpersand()\r
43     {\r
44         return this._ampersand_;\r
45     }\r
46 \r
47     public void setAmpersand(TAmpersand node)\r
48     {\r
49         if(this._ampersand_ != null)\r
50         {\r
51             this._ampersand_.parent(null);\r
52         }\r
53 \r
54         if(node != null)\r
55         {\r
56             if(node.parent() != null)\r
57             {\r
58                 node.parent().removeChild(node);\r
59             }\r
60 \r
61             node.parent(this);\r
62         }\r
63 \r
64         this._ampersand_ = node;\r
65     }\r
66 \r
67     public PRange getRange()\r
68     {\r
69         return this._range_;\r
70     }\r
71 \r
72     public void setRange(PRange node)\r
73     {\r
74         if(this._range_ != null)\r
75         {\r
76             this._range_.parent(null);\r
77         }\r
78 \r
79         if(node != null)\r
80         {\r
81             if(node.parent() != null)\r
82             {\r
83                 node.parent().removeChild(node);\r
84             }\r
85 \r
86             node.parent(this);\r
87         }\r
88 \r
89         this._range_ = node;\r
90     }\r
91 \r
92     @Override\r
93     public String toString()\r
94     {\r
95         return ""\r
96             + toString(this._ampersand_)\r
97             + toString(this._range_);\r
98     }\r
99 \r
100     @Override\r
101     void removeChild(@SuppressWarnings("unused") Node child)\r
102     {\r
103         // Remove child\r
104         if(this._ampersand_ == child)\r
105         {\r
106             this._ampersand_ = null;\r
107             return;\r
108         }\r
109 \r
110         if(this._range_ == child)\r
111         {\r
112             this._range_ = null;\r
113             return;\r
114         }\r
115 \r
116         throw new RuntimeException("Not a child.");\r
117     }\r
118 \r
119     @Override\r
120     void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)\r
121     {\r
122         // Replace child\r
123         if(this._ampersand_ == oldChild)\r
124         {\r
125             setAmpersand((TAmpersand) newChild);\r
126             return;\r
127         }\r
128 \r
129         if(this._range_ == oldChild)\r
130         {\r
131             setRange((PRange) newChild);\r
132             return;\r
133         }\r
134 \r
135         throw new RuntimeException("Not a child.");\r
136     }\r
137 }\r