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 AVariablePrimary extends PPrimary
\r
10 private TVariable _variable_;
\r
12 public AVariablePrimary()
\r
17 public AVariablePrimary(
\r
18 @SuppressWarnings("hiding") TVariable _variable_)
\r
21 setVariable(_variable_);
\r
26 public Object clone()
\r
28 return new AVariablePrimary(
\r
29 cloneNode(this._variable_));
\r
32 public void apply(Switch sw)
\r
34 ((Analysis) sw).caseAVariablePrimary(this);
\r
37 public TVariable getVariable()
\r
39 return this._variable_;
\r
42 public void setVariable(TVariable node)
\r
44 if(this._variable_ != null)
\r
46 this._variable_.parent(null);
\r
51 if(node.parent() != null)
\r
53 node.parent().removeChild(node);
\r
59 this._variable_ = node;
\r
63 public String toString()
\r
66 + toString(this._variable_);
\r
70 void removeChild(@SuppressWarnings("unused") Node child)
\r
73 if(this._variable_ == child)
\r
75 this._variable_ = null;
\r
79 throw new RuntimeException("Not a child.");
\r
83 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
\r
86 if(this._variable_ == oldChild)
\r
88 setVariable((TVariable) newChild);
\r
92 throw new RuntimeException("Not a child.");
\r