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 AFunctionPrimary extends PPrimary
\r
21 private TFunc _func_;
\r
22 private PArgList _argList_;
\r
23 private TRPar _rPar_;
\r
25 public AFunctionPrimary()
\r
30 public AFunctionPrimary(
\r
31 @SuppressWarnings("hiding") TFunc _func_,
\r
32 @SuppressWarnings("hiding") PArgList _argList_,
\r
33 @SuppressWarnings("hiding") TRPar _rPar_)
\r
38 setArgList(_argList_);
\r
45 public Object clone()
\r
47 return new AFunctionPrimary(
\r
48 cloneNode(this._func_),
\r
49 cloneNode(this._argList_),
\r
50 cloneNode(this._rPar_));
\r
53 public void apply(Switch sw)
\r
55 ((Analysis) sw).caseAFunctionPrimary(this);
\r
58 public TFunc getFunc()
\r
63 public void setFunc(TFunc node)
\r
65 if(this._func_ != null)
\r
67 this._func_.parent(null);
\r
72 if(node.parent() != null)
\r
74 node.parent().removeChild(node);
\r
83 public PArgList getArgList()
\r
85 return this._argList_;
\r
88 public void setArgList(PArgList node)
\r
90 if(this._argList_ != null)
\r
92 this._argList_.parent(null);
\r
97 if(node.parent() != null)
\r
99 node.parent().removeChild(node);
\r
105 this._argList_ = node;
\r
108 public TRPar getRPar()
\r
110 return this._rPar_;
\r
113 public void setRPar(TRPar node)
\r
115 if(this._rPar_ != null)
\r
117 this._rPar_.parent(null);
\r
122 if(node.parent() != null)
\r
124 node.parent().removeChild(node);
\r
130 this._rPar_ = node;
\r
134 public String toString()
\r
137 + toString(this._func_)
\r
138 + toString(this._argList_)
\r
139 + toString(this._rPar_);
\r
143 void removeChild(@SuppressWarnings("unused") Node child)
\r
146 if(this._func_ == child)
\r
148 this._func_ = null;
\r
152 if(this._argList_ == child)
\r
154 this._argList_ = null;
\r
158 if(this._rPar_ == child)
\r
160 this._rPar_ = 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._func_ == oldChild)
\r
173 setFunc((TFunc) newChild);
\r
177 if(this._argList_ == oldChild)
\r
179 setArgList((PArgList) newChild);
\r
183 if(this._rPar_ == oldChild)
\r
185 setRPar((TRPar) newChild);
\r
189 throw new RuntimeException("Not a child.");
\r