blob: 1be52ad9e2a51f217f75d439f1e679c657cd36ec [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.*;
/**
*<em>
*<li>Rule 192: WhenConditionAST ::= WhenChangeAST
*</em>
*<p>
*<b>
*<li>Rule 193: WhenConditionAST ::= WhenConditionAST COMMA WhenChangeAST
*</b>
*/
public class WhenConditionAST extends ASTNode implements IWhenConditionAST
{
private IWhenConditionAST _WhenConditionAST;
private IWhenChangeAST _WhenChangeAST;
public IWhenConditionAST getWhenConditionAST() { return _WhenConditionAST; }
public IWhenChangeAST getWhenChangeAST() { return _WhenChangeAST; }
public WhenConditionAST(IToken leftIToken, IToken rightIToken,
IWhenConditionAST _WhenConditionAST,
IWhenChangeAST _WhenChangeAST)
{
super(leftIToken, rightIToken);
this._WhenConditionAST = _WhenConditionAST;
((ASTNode) _WhenConditionAST).setParent(this);
this._WhenChangeAST = _WhenChangeAST;
((ASTNode) _WhenChangeAST).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 WhenConditionAST)) return false;
WhenConditionAST other = (WhenConditionAST) o;
if (! _WhenConditionAST.equals(other.getWhenConditionAST())) return false;
if (! _WhenChangeAST.equals(other.getWhenChangeAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getWhenConditionAST().hashCode());
hash = hash * 31 + (getWhenChangeAST().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); }
}