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 AUnaryminusUnary extends PUnary
10 private TMinus _minus_;
11 private PUnary _unary_;
13 public AUnaryminusUnary()
18 public AUnaryminusUnary(
19 @SuppressWarnings("hiding") TMinus _minus_,
20 @SuppressWarnings("hiding") PUnary _unary_)
32 return new AUnaryminusUnary(
33 cloneNode(this._minus_),
34 cloneNode(this._unary_));
37 public void apply(Switch sw)
39 ((Analysis) sw).caseAUnaryminusUnary(this);
42 public TMinus getMinus()
47 public void setMinus(TMinus node)
49 if(this._minus_ != null)
51 this._minus_.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._minus_)
97 + toString(this._unary_);
101 void removeChild(@SuppressWarnings("unused") Node child)
104 if(this._minus_ == 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._minus_ == oldChild)
125 setMinus((TMinus) newChild);
129 if(this._unary_ == oldChild)
131 setUnary((PUnary) newChild);
135 throw new RuntimeException("Not a child.");