/* This file was generated by SableCC (http://www.sablecc.org/). */ package org.simantics.basicexpression.node; import org.simantics.basicexpression.analysis.*; @SuppressWarnings("nls") public final class AVariablePrimary extends PPrimary { private TVariable _variable_; public AVariablePrimary() { // Constructor } public AVariablePrimary( @SuppressWarnings("hiding") TVariable _variable_) { // Constructor setVariable(_variable_); } @Override public Object clone() { return new AVariablePrimary( cloneNode(this._variable_)); } public void apply(Switch sw) { ((Analysis) sw).caseAVariablePrimary(this); } public TVariable getVariable() { return this._variable_; } public void setVariable(TVariable node) { if(this._variable_ != null) { this._variable_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._variable_ = node; } @Override public String toString() { return "" + toString(this._variable_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._variable_ == child) { this._variable_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._variable_ == oldChild) { setVariable((TVariable) newChild); return; } throw new RuntimeException("Not a child."); } }