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 Start extends Node
21 private PExpression _pExpression_;
30 @SuppressWarnings("hiding") PExpression _pExpression_,
31 @SuppressWarnings("hiding") EOF _eof_)
33 setPExpression(_pExpression_);
41 cloneNode(this._pExpression_),
42 cloneNode(this._eof_));
45 public void apply(Switch sw)
47 ((Analysis) sw).caseStart(this);
50 public PExpression getPExpression()
52 return this._pExpression_;
55 public void setPExpression(PExpression node)
57 if(this._pExpression_ != null)
59 this._pExpression_.parent(null);
64 if(node.parent() != null)
66 node.parent().removeChild(node);
72 this._pExpression_ = node;
80 public void setEOF(EOF node)
82 if(this._eof_ != null)
84 this._eof_.parent(null);
89 if(node.parent() != null)
91 node.parent().removeChild(node);
101 void removeChild(Node child)
103 if(this._pExpression_ == child)
105 this._pExpression_ = null;
109 if(this._eof_ == child)
115 throw new RuntimeException("Not a child.");
119 void replaceChild(Node oldChild, Node newChild)
121 if(this._pExpression_ == oldChild)
123 setPExpression((PExpression) newChild);
127 if(this._eof_ == oldChild)
129 setEOF((EOF) newChild);
133 throw new RuntimeException("Not a child.");
137 public String toString()
140 toString(this._pExpression_) +
141 toString(this._eof_);