1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 /* This file was generated by SableCC (http://www.sablecc.org/). */
\r
14 package org.simantics.spreadsheet.common.expression.node;
\r
16 import org.simantics.spreadsheet.common.expression.analysis.*;
\r
18 @SuppressWarnings("nls")
\r
19 public final class Start extends Node
\r
21 private PExpression _pExpression_;
\r
30 @SuppressWarnings("hiding") PExpression _pExpression_,
\r
31 @SuppressWarnings("hiding") EOF _eof_)
\r
33 setPExpression(_pExpression_);
\r
38 public Object clone()
\r
41 cloneNode(this._pExpression_),
\r
42 cloneNode(this._eof_));
\r
45 public void apply(Switch sw)
\r
47 ((Analysis) sw).caseStart(this);
\r
50 public PExpression getPExpression()
\r
52 return this._pExpression_;
\r
55 public void setPExpression(PExpression node)
\r
57 if(this._pExpression_ != null)
\r
59 this._pExpression_.parent(null);
\r
64 if(node.parent() != null)
\r
66 node.parent().removeChild(node);
\r
72 this._pExpression_ = node;
\r
80 public void setEOF(EOF node)
\r
82 if(this._eof_ != null)
\r
84 this._eof_.parent(null);
\r
89 if(node.parent() != null)
\r
91 node.parent().removeChild(node);
\r
101 void removeChild(Node child)
\r
103 if(this._pExpression_ == child)
\r
105 this._pExpression_ = null;
\r
109 if(this._eof_ == child)
\r
115 throw new RuntimeException("Not a child.");
\r
119 void replaceChild(Node oldChild, Node newChild)
\r
121 if(this._pExpression_ == oldChild)
\r
123 setPExpression((PExpression) newChild);
\r
127 if(this._eof_ == oldChild)
\r
129 setEOF((EOF) newChild);
\r
133 throw new RuntimeException("Not a child.");
\r
137 public String toString()
\r
140 toString(this._pExpression_) +
\r
141 toString(this._eof_);
\r