All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.xtext.nodemodel.ICompositeNode Maven / Gradle / Ivy

There is a newer version: 2.4.3
Show newest version
/*******************************************************************************
 * Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.xtext.nodemodel;

/**
 * A composite node in the parse tree. A composite node may or may not contain child nodes.
 * @author Sebastian Zarnekow - Initial contribution and API
 */
public interface ICompositeNode extends INode {

	/**
	 * Returns an iterable that provides access to the children of the composite node. Will never 
	 * return null but may be empty.
	 * @return an iterable that provides access to the children of the composite node.
	 * @see #hasChildren()
	 * @see #getFirstChild()
	 * @see #getLastChild()
	 */
	BidiIterable getChildren();
	
	/**
	 * Returns true if this node has any children.
	 * @return true if this node has any children.
	 * @see #getChildren()
	 * @see #getFirstChild()
	 * @see #getLastChild()
	 */
	boolean hasChildren();
	
	/**
	 * Returns the first child of this node. May be null or may be the same as the {@link #getLastChild() last child}.
	 * @return the first child of this node if any.
	 * @see #hasChildren()
	 * @see #getChildren()
	 */
	INode getFirstChild();
	
	/**
	 * Returns the last child of this node. May be null or may be the same as the {@link #getFirstChild() first child}.
	 * @return the last child of this node if any.
	 * @see #hasChildren()
	 * @see #getChildren()
	 */
	INode getLastChild();

	/**
	 * Return the number of tokens that the parser had to peek before it could decide to create this node. Never
	 * negative. Clients will usually not have to deal with {@link #getLookAhead()}.
	 * @return the number of tokens that the parser had to peek before it could decide to create this node.
	 */
	int getLookAhead();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy