1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 /* This file was generated by SableCC (http://www.sablecc.org/). */
14 package org.simantics.spreadsheet.common.expression.node;
16 import org.simantics.spreadsheet.common.expression.analysis.*;
18 @SuppressWarnings("nls")
19 public final class AAddressValue extends PValue
21 private TAmpersand _ampersand_;
22 private PRange _range_;
24 public AAddressValue()
30 @SuppressWarnings("hiding") TAmpersand _ampersand_,
31 @SuppressWarnings("hiding") PRange _range_)
34 setAmpersand(_ampersand_);
43 return new AAddressValue(
44 cloneNode(this._ampersand_),
45 cloneNode(this._range_));
48 public void apply(Switch sw)
50 ((Analysis) sw).caseAAddressValue(this);
53 public TAmpersand getAmpersand()
55 return this._ampersand_;
58 public void setAmpersand(TAmpersand node)
60 if(this._ampersand_ != null)
62 this._ampersand_.parent(null);
67 if(node.parent() != null)
69 node.parent().removeChild(node);
75 this._ampersand_ = node;
78 public PRange getRange()
83 public void setRange(PRange node)
85 if(this._range_ != null)
87 this._range_.parent(null);
92 if(node.parent() != null)
94 node.parent().removeChild(node);
104 public String toString()
107 + toString(this._ampersand_)
108 + toString(this._range_);
112 void removeChild(@SuppressWarnings("unused") Node child)
115 if(this._ampersand_ == child)
117 this._ampersand_ = null;
121 if(this._range_ == child)
127 throw new RuntimeException("Not a child.");
131 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
134 if(this._ampersand_ == oldChild)
136 setAmpersand((TAmpersand) newChild);
140 if(this._range_ == oldChild)
142 setRange((PRange) newChild);
146 throw new RuntimeException("Not a child.");