1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 /* This file was generated by SableCC (http://www.sablecc.org/). */
\r
14 package org.simantics.spreadsheet.common.expression.node;
\r
16 import org.simantics.spreadsheet.common.expression.analysis.*;
\r
18 @SuppressWarnings("nls")
\r
19 public final class AMultiRange extends PRange
\r
21 private TCell _left_;
\r
22 private TColon _colon_;
\r
23 private TCell _right_;
\r
25 public AMultiRange()
\r
31 @SuppressWarnings("hiding") TCell _left_,
\r
32 @SuppressWarnings("hiding") TColon _colon_,
\r
33 @SuppressWarnings("hiding") TCell _right_)
\r
45 public Object clone()
\r
47 return new AMultiRange(
\r
48 cloneNode(this._left_),
\r
49 cloneNode(this._colon_),
\r
50 cloneNode(this._right_));
\r
53 public void apply(Switch sw)
\r
55 ((Analysis) sw).caseAMultiRange(this);
\r
58 public TCell getLeft()
\r
63 public void setLeft(TCell node)
\r
65 if(this._left_ != null)
\r
67 this._left_.parent(null);
\r
72 if(node.parent() != null)
\r
74 node.parent().removeChild(node);
\r
83 public TColon getColon()
\r
85 return this._colon_;
\r
88 public void setColon(TColon node)
\r
90 if(this._colon_ != null)
\r
92 this._colon_.parent(null);
\r
97 if(node.parent() != null)
\r
99 node.parent().removeChild(node);
\r
105 this._colon_ = node;
\r
108 public TCell getRight()
\r
110 return this._right_;
\r
113 public void setRight(TCell node)
\r
115 if(this._right_ != null)
\r
117 this._right_.parent(null);
\r
122 if(node.parent() != null)
\r
124 node.parent().removeChild(node);
\r
130 this._right_ = node;
\r
134 public String toString()
\r
137 + toString(this._left_)
\r
138 + toString(this._colon_)
\r
139 + toString(this._right_);
\r
143 void removeChild(@SuppressWarnings("unused") Node child)
\r
146 if(this._left_ == child)
\r
148 this._left_ = null;
\r
152 if(this._colon_ == child)
\r
154 this._colon_ = null;
\r
158 if(this._right_ == child)
\r
160 this._right_ = null;
\r
164 throw new RuntimeException("Not a child.");
\r
168 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
\r
171 if(this._left_ == oldChild)
\r
173 setLeft((TCell) newChild);
\r
177 if(this._colon_ == oldChild)
\r
179 setColon((TColon) newChild);
\r
183 if(this._right_ == oldChild)
\r
185 setRight((TCell) newChild);
\r
189 throw new RuntimeException("Not a child.");
\r