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