1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 /* This file was generated by SableCC (http://www.sablecc.org/). */
14 package org.simantics.spreadsheet.common.expression.node;
16 import org.simantics.spreadsheet.common.expression.analysis.*;
18 @SuppressWarnings("nls")
19 public final class AUnaryplusUnary extends PUnary
22 private PUnary _unary_;
24 public AUnaryplusUnary()
29 public AUnaryplusUnary(
30 @SuppressWarnings("hiding") TPlus _plus_,
31 @SuppressWarnings("hiding") PUnary _unary_)
43 return new AUnaryplusUnary(
44 cloneNode(this._plus_),
45 cloneNode(this._unary_));
48 public void apply(Switch sw)
50 ((Analysis) sw).caseAUnaryplusUnary(this);
53 public TPlus getPlus()
58 public void setPlus(TPlus node)
60 if(this._plus_ != null)
62 this._plus_.parent(null);
67 if(node.parent() != null)
69 node.parent().removeChild(node);
78 public PUnary getUnary()
83 public void setUnary(PUnary node)
85 if(this._unary_ != null)
87 this._unary_.parent(null);
92 if(node.parent() != null)
94 node.parent().removeChild(node);
104 public String toString()
107 + toString(this._plus_)
108 + toString(this._unary_);
112 void removeChild(@SuppressWarnings("unused") Node child)
115 if(this._plus_ == child)
121 if(this._unary_ == child)
127 throw new RuntimeException("Not a child.");
131 void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
134 if(this._plus_ == oldChild)
136 setPlus((TPlus) newChild);
140 if(this._unary_ == oldChild)
142 setUnary((PUnary) newChild);
146 throw new RuntimeException("Not a child.");