1 /* This file was generated by SableCC (http://www.sablecc.org/). */
\r
3 package org.simantics.basicexpression.node;
\r
5 import org.simantics.basicexpression.analysis.*;
\r
7 @SuppressWarnings("nls")
\r
8 public final class AFunctionPrimary extends PPrimary
\r
10 private TFunc _func_;
\r
11 private PArgList _argList_;
\r
12 private TRPar _rPar_;
\r
14 public AFunctionPrimary()
\r
19 public AFunctionPrimary(
\r
20 @SuppressWarnings("hiding") TFunc _func_,
\r
21 @SuppressWarnings("hiding") PArgList _argList_,
\r
22 @SuppressWarnings("hiding") TRPar _rPar_)
\r
27 setArgList(_argList_);
\r
34 public Object clone()
\r
36 return new AFunctionPrimary(
\r
37 cloneNode(this._func_),
\r
38 cloneNode(this._argList_),
\r
39 cloneNode(this._rPar_));
\r
42 public void apply(Switch sw)
\r
44 ((Analysis) sw).caseAFunctionPrimary(this);
\r
47 public TFunc getFunc()
\r
52 public void setFunc(TFunc node)
\r
54 if(this._func_ != null)
\r
56 this._func_.parent(null);
\r
61 if(node.parent() != null)
\r
63 node.parent().removeChild(node);
\r
72 public PArgList getArgList()
\r
74 return this._argList_;
\r
77 public void setArgList(PArgList node)
\r
79 if(this._argList_ != null)
\r
81 this._argList_.parent(null);
\r
86 if(node.parent() != null)
\r
88 node.parent().removeChild(node);
\r
94 this._argList_ = node;
\r
97 public TRPar getRPar()
\r
102 public void setRPar(TRPar node)
\r
104 if(this._rPar_ != null)
\r
106 this._rPar_.parent(null);
\r
111 if(node.parent() != null)
\r
113 node.parent().removeChild(node);
\r
119 this._rPar_ = node;
\r
123 public String toString()
\r
126 + toString(this._func_)
\r
127 + toString(this._argList_)
\r
128 + toString(this._rPar_);
\r
132 void removeChild(@SuppressWarnings("unused") Node child)
\r
135 if(this._func_ == child)
\r
137 this._func_ = null;
\r
141 if(this._argList_ == child)
\r
143 this._argList_ = null;
\r
147 if(this._rPar_ == child)
\r
149 this._rPar_ = null;
\r
153 throw new RuntimeException("Not a child.");
\r
157 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
\r
160 if(this._func_ == oldChild)
\r
162 setFunc((TFunc) newChild);
\r
166 if(this._argList_ == oldChild)
\r
168 setArgList((PArgList) newChild);
\r
172 if(this._rPar_ == oldChild)
\r
174 setRPar((TRPar) newChild);
\r
178 throw new RuntimeException("Not a child.");
\r