blob: 820e0099a994b606b764bc05f3f32e2f2f28beeb [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 16: GraphPatternDefAST ::= OptAnnotationsAST OptShareableDefAST pattern TypeNameAST FormalParameterDefAST EQUAL PatternBodiesAST
*</b>
*/
public class GraphPatternDefAST extends ASTNode implements IGraphPatternDefAST
{
private IOptAnnotationsAST _OptAnnotationsAST;
private OptShareableDefAST _OptShareableDefAST;
private ITypeNameAST _TypeNameAST;
private IFormalParameterDefAST _FormalParameterDefAST;
private IPatternBodiesAST _PatternBodiesAST;
/**
* The value returned by <b>getOptAnnotationsAST</b> may be <b>null</b>
*/
public IOptAnnotationsAST getOptAnnotationsAST() { return _OptAnnotationsAST; }
/**
* The value returned by <b>getOptShareableDefAST</b> may be <b>null</b>
*/
public OptShareableDefAST getOptShareableDefAST() { return _OptShareableDefAST; }
public ITypeNameAST getTypeNameAST() { return _TypeNameAST; }
public IFormalParameterDefAST getFormalParameterDefAST() { return _FormalParameterDefAST; }
public IPatternBodiesAST getPatternBodiesAST() { return _PatternBodiesAST; }
public GraphPatternDefAST(IToken leftIToken, IToken rightIToken,
IOptAnnotationsAST _OptAnnotationsAST,
OptShareableDefAST _OptShareableDefAST,
ITypeNameAST _TypeNameAST,
IFormalParameterDefAST _FormalParameterDefAST,
IPatternBodiesAST _PatternBodiesAST)
{
super(leftIToken, rightIToken);
this._OptAnnotationsAST = _OptAnnotationsAST;
if (_OptAnnotationsAST != null) ((ASTNode) _OptAnnotationsAST).setParent(this);
this._OptShareableDefAST = _OptShareableDefAST;
if (_OptShareableDefAST != null) ((ASTNode) _OptShareableDefAST).setParent(this);
this._TypeNameAST = _TypeNameAST;
((ASTNode) _TypeNameAST).setParent(this);
this._FormalParameterDefAST = _FormalParameterDefAST;
((ASTNode) _FormalParameterDefAST).setParent(this);
this._PatternBodiesAST = _PatternBodiesAST;
((ASTNode) _PatternBodiesAST).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 GraphPatternDefAST)) return false;
GraphPatternDefAST other = (GraphPatternDefAST) o;
if (_OptAnnotationsAST == null && other.getOptAnnotationsAST() != null) return false;
else if (! _OptAnnotationsAST.equals(other.getOptAnnotationsAST())) return false;
if (_OptShareableDefAST == null && other.getOptShareableDefAST() != null) return false;
else if (! _OptShareableDefAST.equals(other.getOptShareableDefAST())) return false;
if (! _TypeNameAST.equals(other.getTypeNameAST())) return false;
if (! _FormalParameterDefAST.equals(other.getFormalParameterDefAST())) return false;
if (! _PatternBodiesAST.equals(other.getPatternBodiesAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getOptAnnotationsAST() == null ? 0 : getOptAnnotationsAST().hashCode());
hash = hash * 31 + (getOptShareableDefAST() == null ? 0 : getOptShareableDefAST().hashCode());
hash = hash * 31 + (getTypeNameAST().hashCode());
hash = hash * 31 + (getFormalParameterDefAST().hashCode());
hash = hash * 31 + (getPatternBodiesAST().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); }
}