blob: b51f96eadc64a852826b7fe2565fa1c46b3ef839 [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 102: AsmFunctionDefAST ::= OptAnnotationsAST asmfunction TypeNameAST ArityOrTypeDeclAST ReturnTypeOptAST InitialValuesOptAST
*</b>
*/
public class AsmFunctionDefAST extends ASTNode implements IAsmFunctionDefAST
{
private IOptAnnotationsAST _OptAnnotationsAST;
private ITypeNameAST _TypeNameAST;
private IArityOrTypeDeclAST _ArityOrTypeDeclAST;
private ReturnTypeOptAST _ReturnTypeOptAST;
private IInitialValuesOptAST _InitialValuesOptAST;
/**
* The value returned by <b>getOptAnnotationsAST</b> may be <b>null</b>
*/
public IOptAnnotationsAST getOptAnnotationsAST() { return _OptAnnotationsAST; }
public ITypeNameAST getTypeNameAST() { return _TypeNameAST; }
public IArityOrTypeDeclAST getArityOrTypeDeclAST() { return _ArityOrTypeDeclAST; }
/**
* The value returned by <b>getReturnTypeOptAST</b> may be <b>null</b>
*/
public ReturnTypeOptAST getReturnTypeOptAST() { return _ReturnTypeOptAST; }
public IInitialValuesOptAST getInitialValuesOptAST() { return _InitialValuesOptAST; }
public AsmFunctionDefAST(IToken leftIToken, IToken rightIToken,
IOptAnnotationsAST _OptAnnotationsAST,
ITypeNameAST _TypeNameAST,
IArityOrTypeDeclAST _ArityOrTypeDeclAST,
ReturnTypeOptAST _ReturnTypeOptAST,
IInitialValuesOptAST _InitialValuesOptAST)
{
super(leftIToken, rightIToken);
this._OptAnnotationsAST = _OptAnnotationsAST;
if (_OptAnnotationsAST != null) ((ASTNode) _OptAnnotationsAST).setParent(this);
this._TypeNameAST = _TypeNameAST;
((ASTNode) _TypeNameAST).setParent(this);
this._ArityOrTypeDeclAST = _ArityOrTypeDeclAST;
((ASTNode) _ArityOrTypeDeclAST).setParent(this);
this._ReturnTypeOptAST = _ReturnTypeOptAST;
if (_ReturnTypeOptAST != null) ((ASTNode) _ReturnTypeOptAST).setParent(this);
this._InitialValuesOptAST = _InitialValuesOptAST;
((ASTNode) _InitialValuesOptAST).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 AsmFunctionDefAST)) return false;
AsmFunctionDefAST other = (AsmFunctionDefAST) o;
if (_OptAnnotationsAST == null && other.getOptAnnotationsAST() != null) return false;
else if (! _OptAnnotationsAST.equals(other.getOptAnnotationsAST())) return false;
if (! _TypeNameAST.equals(other.getTypeNameAST())) return false;
if (! _ArityOrTypeDeclAST.equals(other.getArityOrTypeDeclAST())) return false;
if (_ReturnTypeOptAST == null && other.getReturnTypeOptAST() != null) return false;
else if (! _ReturnTypeOptAST.equals(other.getReturnTypeOptAST())) return false;
if (! _InitialValuesOptAST.equals(other.getInitialValuesOptAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getOptAnnotationsAST() == null ? 0 : getOptAnnotationsAST().hashCode());
hash = hash * 31 + (getTypeNameAST().hashCode());
hash = hash * 31 + (getArityOrTypeDeclAST().hashCode());
hash = hash * 31 + (getReturnTypeOptAST() == null ? 0 : getReturnTypeOptAST().hashCode());
hash = hash * 31 + (getInitialValuesOptAST().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); }
}