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 AExprValue extends PValue
11 private PExpression _expression_;
20 @SuppressWarnings("hiding") TLPar _lPar_,
21 @SuppressWarnings("hiding") PExpression _expression_,
22 @SuppressWarnings("hiding") TRPar _rPar_)
27 setExpression(_expression_);
36 return new AExprValue(
37 cloneNode(this._lPar_),
38 cloneNode(this._expression_),
39 cloneNode(this._rPar_));
42 public void apply(Switch sw)
44 ((Analysis) sw).caseAExprValue(this);
47 public TLPar getLPar()
52 public void setLPar(TLPar node)
54 if(this._lPar_ != null)
56 this._lPar_.parent(null);
61 if(node.parent() != null)
63 node.parent().removeChild(node);
72 public PExpression getExpression()
74 return this._expression_;
77 public void setExpression(PExpression node)
79 if(this._expression_ != null)
81 this._expression_.parent(null);
86 if(node.parent() != null)
88 node.parent().removeChild(node);
94 this._expression_ = 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._lPar_)
127 + toString(this._expression_)
128 + toString(this._rPar_);
132 void removeChild(@SuppressWarnings("unused") Node child)
135 if(this._lPar_ == child)
141 if(this._expression_ == child)
143 this._expression_ = 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._lPar_ == oldChild)
162 setLPar((TLPar) newChild);
166 if(this._expression_ == oldChild)
168 setExpression((PExpression) newChild);
172 if(this._rPar_ == oldChild)
174 setRPar((TRPar) newChild);
178 throw new RuntimeException("Not a child.");