blob: 0fd2d8af59a97f40abee7b0831b5c98b6f677471 [file] [log] [blame]
/**
* Copyright (c) 2007 - 2009 OptXware Research and Development LLC.
* 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
*
* Contributors:
* Daniel Varro - Initial API and implementation
*
* This file was generated automatically based upon the VTCL LPG Parser
* VTCLParser.g
*/
package org.eclipse.viatra2.lpgparser.ast;
import lpg.lpgjavaruntime.*;
/**
*<b>
*<li>Rule 216: DeleteContentsAST ::= ArithmeticTermAST DeleteSemanticsOptAST
*</b>
*/
public class DeleteContentsAST extends ASTNode implements IDeleteContentsAST
{
private IArithmeticTermAST _ArithmeticTermAST;
private DeleteSemanticsOptAST _DeleteSemanticsOptAST;
public IArithmeticTermAST getArithmeticTermAST() { return _ArithmeticTermAST; }
/**
* The value returned by <b>getDeleteSemanticsOptAST</b> may be <b>null</b>
*/
public DeleteSemanticsOptAST getDeleteSemanticsOptAST() { return _DeleteSemanticsOptAST; }
public DeleteContentsAST(IToken leftIToken, IToken rightIToken,
IArithmeticTermAST _ArithmeticTermAST,
DeleteSemanticsOptAST _DeleteSemanticsOptAST)
{
super(leftIToken, rightIToken);
this._ArithmeticTermAST = _ArithmeticTermAST;
((ASTNode) _ArithmeticTermAST).setParent(this);
this._DeleteSemanticsOptAST = _DeleteSemanticsOptAST;
if (_DeleteSemanticsOptAST != null) ((ASTNode) _DeleteSemanticsOptAST).setParent(this);
initialize();
}
public boolean equals(Object o)
{
if (o == this) return true;
//
// The supers call is not required for now because Ast nodes
// can only extend the root Ast, AstToken and AstList and none
// of these nodes contain children.
//
// if (! super.equals(o)) return false;
//
if (! (o instanceof DeleteContentsAST)) return false;
DeleteContentsAST other = (DeleteContentsAST) o;
if (! _ArithmeticTermAST.equals(other.getArithmeticTermAST())) return false;
if (_DeleteSemanticsOptAST == null && other.getDeleteSemanticsOptAST() != null) return false;
else if (! _DeleteSemanticsOptAST.equals(other.getDeleteSemanticsOptAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getArithmeticTermAST().hashCode());
hash = hash * 31 + (getDeleteSemanticsOptAST() == null ? 0 : getDeleteSemanticsOptAST().hashCode());
return hash;
}
public void accept(Visitor v) { v.visit(this); }
public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
public Object accept(ResultVisitor v) { return v.visit(this); }
public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}