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

org.intocps.maestro.ast.ADivideBinaryExp Maven / Gradle / Ivy

/*******************************************************************************
* Copyright (c) 2009, 2011 Overture Team and others.
*
* Overture is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Overture is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Overture.  If not, see .
*
* The Overture Tool web-site: http://overturetool.org/
*******************************************************************************/

/* This file was generated by ASTcreator (http://www.lausdahl.com/). */

package org.intocps.maestro.ast;


import org.intocps.maestro.ast.analysis.intf.IAnalysis;
import org.intocps.maestro.ast.analysis.AnalysisException;
import java.util.HashMap;
import org.intocps.maestro.ast.analysis.intf.IAnswer;
import org.intocps.maestro.ast.node.PExp;
import org.intocps.maestro.ast.ADivideBinaryExp;
import org.intocps.maestro.ast.analysis.intf.IQuestionAnswer;
import java.util.Map;
import java.lang.Boolean;
import org.intocps.maestro.ast.node.SBinaryExpBase;
import org.intocps.maestro.ast.analysis.intf.IQuestion;
import java.lang.String;
import org.intocps.maestro.ast.node.INode;


/**
* Generated file by AST Creator
* @author Kenneth Lausdahl
*
*/
@SuppressWarnings({"all"})
public class ADivideBinaryExp extends SBinaryExpBase
{
	private static final long serialVersionUID = 1L;


	/**
	 * Creates a new default constructor {@link ADivideBinaryExp} node with no children.
	 */
	public ADivideBinaryExp()
	{

	}


	/**
	* Creates a new complete constructor {@code ADivideBinaryExp} node with the given nodes as children.
	* @deprecated This method should not be used, use AstFactory instead.
	* The basic child nodes are removed from their previous parents.
	*/
	public ADivideBinaryExp(PExp left_, PExp right_)
	{
		super(left_,right_);

	}


	/**
	* Forwarding hashCode call to {@link Object#hashCode()}.
	**/
	@Override
	public int hashCode()
	{
		return super.hashCode();
	}


	/**
	 * Returns a deep clone of this {@link ADivideBinaryExp} node.
	 * @return a deep clone of this {@link ADivideBinaryExp} node
	 */
	public ADivideBinaryExp clone()
	{
		return new ADivideBinaryExp(
			cloneNode(_left),
			cloneNode(_right)
		);
	}


	/**
	 * Removes the {@link INode} {@code child} as a child of this {@link ADivideBinaryExp} node.
	 * Do not call this method with any graph fields of this node. This will cause any child's
	 * with the same reference to be removed unintentionally or {@link RuntimeException}will be thrown.
	 * @param child the child node to be removed from this {@link ADivideBinaryExp} node
	 * @throws RuntimeException if {@code child} is not a child of this {@link ADivideBinaryExp} node
	 */
	public void removeChild(INode child)
	{
		if (this._left == child) {
			this._left = null;
			return;
		}

		if (this._right == child) {
			this._right = null;
			return;
		}

		throw new RuntimeException("Not a child.");
	}


	/**
	 * Creates a map of all field names and their value
	 * @param includeInheritedFields if true all inherited fields are included
	 * @return a a map of names to values of all fields
	 */
	@Override
	public Map getChildren(Boolean includeInheritedFields)
	{
		Map fields = new HashMap();
		if(includeInheritedFields)
		{
			fields.putAll(super.getChildren(includeInheritedFields));
		}
		return fields;
	}



	public String toString()
	{
		return "" + _left+" / "+_right;
	}


	/**
	* Essentially this.toString().equals(o.toString()).
	**/
	@Override
	public boolean equals(Object o)
	{
		if (o != null && o instanceof ADivideBinaryExp)		{
			 return toString().equals(o.toString());
		}
		return false;
	}


	/**
	 * Creates a deep clone of this {@link ADivideBinaryExp} node while putting all
	 * old node-new node relations in the map {@code oldToNewMap}.
	 * @param oldToNewMap the map filled with the old node-new node relation
	 * @return a deep clone of this {@link ADivideBinaryExp} node
	 */
	public ADivideBinaryExp clone(Map oldToNewMap)
	{
		ADivideBinaryExp node = new ADivideBinaryExp(
			cloneNode(_left, oldToNewMap),
			cloneNode(_right, oldToNewMap)
		);
		oldToNewMap.put(this, node);
		return node;
	}


	/**
	* Calls the {@link IAnalysis#caseADivideBinaryExp(ADivideBinaryExp)} of the {@link IAnalysis} {@code caller}.
	* @param caller the {@link IAnalysis} to which this {@link ADivideBinaryExp} node is applied
	*/
	@Override
	public void apply(IAnalysis caller) throws AnalysisException
	{
		caller.caseADivideBinaryExp(this);
	}


	/**
	* Calls the {@link IAnswer#caseADivideBinaryExp(ADivideBinaryExp)} of the {@link IAnswer} {@code caller}.
	* @param caller the {@link IAnswer} to which this {@link ADivideBinaryExp} node is applied
	*/
	@Override
	public  A apply(IAnswer caller) throws AnalysisException
	{
		return caller.caseADivideBinaryExp(this);
	}


	/**
	* Calls the {@link IQuestion#caseADivideBinaryExp(ADivideBinaryExp, Object)} of the {@link IQuestion} {@code caller}.
	* @param caller the {@link IQuestion} to which this {@link ADivideBinaryExp} node is applied
	* @param question the question provided to {@code caller}
	*/
	@Override
	public  void apply(IQuestion caller, Q question) throws AnalysisException
	{
		caller.caseADivideBinaryExp(this,question);
	}


	/**
	* Calls the {@link IQuestionAnswer#caseADivideBinaryExp(ADivideBinaryExp, Object)} of the {@link IQuestionAnswer} {@code caller}.
	* @param caller the {@link IQuestionAnswer} to which this {@link ADivideBinaryExp} node is applied
	* @param question the question provided to {@code caller}
	*/
	@Override
	public  A apply(IQuestionAnswer caller, Q question) throws AnalysisException
	{
		return caller.caseADivideBinaryExp(this,question);
	}



}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy