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