blob: 1cc66f49d1a5519b0904acf839b1cf4918f70edb [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 275: ConstrainedVariablesAST ::= VariableDefAST TypeOptAST ContainmentConstraintOptAST
*</b>
*/
public class ConstrainedVariablesAST0 extends ASTNode implements IConstrainedVariablesAST
{
private VariableDefAST _VariableDefAST;
private TypeOptAST _TypeOptAST;
private IContainmentConstraintOptAST _ContainmentConstraintOptAST;
public VariableDefAST getVariableDefAST() { return _VariableDefAST; }
/**
* The value returned by <b>getTypeOptAST</b> may be <b>null</b>
*/
public TypeOptAST getTypeOptAST() { return _TypeOptAST; }
/**
* The value returned by <b>getContainmentConstraintOptAST</b> may be <b>null</b>
*/
public IContainmentConstraintOptAST getContainmentConstraintOptAST() { return _ContainmentConstraintOptAST; }
public ConstrainedVariablesAST0(IToken leftIToken, IToken rightIToken,
VariableDefAST _VariableDefAST,
TypeOptAST _TypeOptAST,
IContainmentConstraintOptAST _ContainmentConstraintOptAST)
{
super(leftIToken, rightIToken);
this._VariableDefAST = _VariableDefAST;
((ASTNode) _VariableDefAST).setParent(this);
this._TypeOptAST = _TypeOptAST;
if (_TypeOptAST != null) ((ASTNode) _TypeOptAST).setParent(this);
this._ContainmentConstraintOptAST = _ContainmentConstraintOptAST;
if (_ContainmentConstraintOptAST != null) ((ASTNode) _ContainmentConstraintOptAST).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 ConstrainedVariablesAST0)) return false;
ConstrainedVariablesAST0 other = (ConstrainedVariablesAST0) o;
if (! _VariableDefAST.equals(other.getVariableDefAST())) return false;
if (_TypeOptAST == null && other.getTypeOptAST() != null) return false;
else if (! _TypeOptAST.equals(other.getTypeOptAST())) return false;
if (_ContainmentConstraintOptAST == null && other.getContainmentConstraintOptAST() != null) return false;
else if (! _ContainmentConstraintOptAST.equals(other.getContainmentConstraintOptAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getVariableDefAST().hashCode());
hash = hash * 31 + (getTypeOptAST() == null ? 0 : getTypeOptAST().hashCode());
hash = hash * 31 + (getContainmentConstraintOptAST() == null ? 0 : getContainmentConstraintOptAST().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); }
}