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 AUnaryplusUnary extends PUnary
11 private PUnary _unary_;
13 public AUnaryplusUnary()
18 public AUnaryplusUnary(
19 @SuppressWarnings("hiding") TPlus _plus_,
20 @SuppressWarnings("hiding") PUnary _unary_)
32 return new AUnaryplusUnary(
33 cloneNode(this._plus_),
34 cloneNode(this._unary_));
37 public void apply(Switch sw)
39 ((Analysis) sw).caseAUnaryplusUnary(this);
42 public TPlus getPlus()
47 public void setPlus(TPlus node)
49 if(this._plus_ != null)
51 this._plus_.parent(null);
56 if(node.parent() != null)
58 node.parent().removeChild(node);
67 public PUnary getUnary()
72 public void setUnary(PUnary node)
74 if(this._unary_ != null)
76 this._unary_.parent(null);
81 if(node.parent() != null)
83 node.parent().removeChild(node);
93 public String toString()
96 + toString(this._plus_)
97 + toString(this._unary_);
101 void removeChild(@SuppressWarnings("unused") Node child)
104 if(this._plus_ == child)
110 if(this._unary_ == child)
116 throw new RuntimeException("Not a child.");
120 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
123 if(this._plus_ == oldChild)
125 setPlus((TPlus) newChild);
129 if(this._unary_ == oldChild)
131 setUnary((PUnary) newChild);
135 throw new RuntimeException("Not a child.");