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;
18 @SuppressWarnings("nls")
19 public abstract class Node implements Switchable, Cloneable
24 public abstract Object clone();
31 void parent(@SuppressWarnings("hiding") Node parent)
36 abstract void removeChild(Node child);
37 abstract void replaceChild(Node oldChild, Node newChild);
39 public void replaceBy(Node node)
41 this.parent.replaceChild(this, node);
44 protected String toString(Node node)
48 return node.toString();
54 protected String toString(List list)
56 StringBuffer s = new StringBuffer();
58 for(Iterator i = list.iterator(); i.hasNext();)
66 @SuppressWarnings("unchecked")
67 protected <T extends Node> T cloneNode(T node)
71 return (T) node.clone();
77 protected <T> List<T> cloneList(List<T> list)
79 List<T> clone = new LinkedList<T>();