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

com.sap.cds.ql.cqn.CqnToken Maven / Gradle / Ivy

There is a newer version: 3.6.1
Show newest version
/*******************************************************************
 * © 2019 SAP SE or an SAP affiliate company. All rights reserved. *
 *******************************************************************/
package com.sap.cds.ql.cqn;

import java.util.stream.Stream;

import com.google.common.annotations.Beta;
import com.sap.cds.JSONizable;

public interface CqnToken extends JSONizable {

	/**
	 * Traverses the expression tree represented by this token with a given
	 * {@code visitor}. The traversal order is depth-first. If this token has
	 * child nodes they are traversed first by dispatching the visitor to the
	 * children's {@code accept} methods.
	 * 
	 * Afterwards this token is passed to the visitor's {@code visit} method
	 * specific for this token's type.
	 * 
	 * @param visitor the {@link CqnVisitor}
	 */
	void accept(CqnVisitor visitor);

	@Beta
	default Stream tokens() {
		return Stream.of(this);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy