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 AConstantValue extends PValue
\r
21 private TNumber _number_;
\r
23 public AConstantValue()
\r
28 public AConstantValue(
\r
29 @SuppressWarnings("hiding") TNumber _number_)
\r
32 setNumber(_number_);
\r
37 public Object clone()
\r
39 return new AConstantValue(
\r
40 cloneNode(this._number_));
\r
43 public void apply(Switch sw)
\r
45 ((Analysis) sw).caseAConstantValue(this);
\r
48 public TNumber getNumber()
\r
50 return this._number_;
\r
53 public void setNumber(TNumber node)
\r
55 if(this._number_ != null)
\r
57 this._number_.parent(null);
\r
62 if(node.parent() != null)
\r
64 node.parent().removeChild(node);
\r
70 this._number_ = node;
\r
74 public String toString()
\r
77 + toString(this._number_);
\r
81 void removeChild(@SuppressWarnings("unused") Node child)
\r
84 if(this._number_ == child)
\r
86 this._number_ = null;
\r
90 throw new RuntimeException("Not a child.");
\r
94 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
\r
97 if(this._number_ == oldChild)
\r
99 setNumber((TNumber) newChild);
\r
103 throw new RuntimeException("Not a child.");
\r