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 ADivMultiplicative extends PMultiplicative
10 private PMultiplicative _left_;
12 private PUnary _right_;
14 public ADivMultiplicative()
19 public ADivMultiplicative(
20 @SuppressWarnings("hiding") PMultiplicative _left_,
21 @SuppressWarnings("hiding") TDiv _div_,
22 @SuppressWarnings("hiding") PUnary _right_)
36 return new ADivMultiplicative(
37 cloneNode(this._left_),
38 cloneNode(this._div_),
39 cloneNode(this._right_));
42 public void apply(Switch sw)
44 ((Analysis) sw).caseADivMultiplicative(this);
47 public PMultiplicative getLeft()
52 public void setLeft(PMultiplicative node)
54 if(this._left_ != null)
56 this._left_.parent(null);
61 if(node.parent() != null)
63 node.parent().removeChild(node);
77 public void setDiv(TDiv node)
79 if(this._div_ != null)
81 this._div_.parent(null);
86 if(node.parent() != null)
88 node.parent().removeChild(node);
97 public PUnary getRight()
102 public void setRight(PUnary node)
104 if(this._right_ != null)
106 this._right_.parent(null);
111 if(node.parent() != null)
113 node.parent().removeChild(node);
123 public String toString()
126 + toString(this._left_)
127 + toString(this._div_)
128 + toString(this._right_);
132 void removeChild(@SuppressWarnings("unused") Node child)
135 if(this._left_ == child)
141 if(this._div_ == child)
147 if(this._right_ == child)
153 throw new RuntimeException("Not a child.");
157 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
160 if(this._left_ == oldChild)
162 setLeft((PMultiplicative) newChild);
166 if(this._div_ == oldChild)
168 setDiv((TDiv) newChild);
172 if(this._right_ == oldChild)
174 setRight((PUnary) newChild);
178 throw new RuntimeException("Not a child.");