blob: 15280d170a4de0823fa8c161edb0384a6346a863 [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 171: SequentialRuleAST ::= seq LBRACE AsmRulesAST RBRACE OptSemicolonAST
*</b>
*/
public class SequentialRuleAST extends ASTNode implements ISequentialRuleAST
{
private AsmRulesAST _AsmRulesAST;
private OptSemicolonAST _OptSemicolonAST;
public AsmRulesAST getAsmRulesAST() { return _AsmRulesAST; }
/**
* The value returned by <b>getOptSemicolonAST</b> may be <b>null</b>
*/
public OptSemicolonAST getOptSemicolonAST() { return _OptSemicolonAST; }
public SequentialRuleAST(IToken leftIToken, IToken rightIToken,
AsmRulesAST _AsmRulesAST,
OptSemicolonAST _OptSemicolonAST)
{
super(leftIToken, rightIToken);
this._AsmRulesAST = _AsmRulesAST;
((ASTNode) _AsmRulesAST).setParent(this);
this._OptSemicolonAST = _OptSemicolonAST;
if (_OptSemicolonAST != null) ((ASTNode) _OptSemicolonAST).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 SequentialRuleAST)) return false;
SequentialRuleAST other = (SequentialRuleAST) o;
if (! _AsmRulesAST.equals(other.getAsmRulesAST())) return false;
if (_OptSemicolonAST == null && other.getOptSemicolonAST() != null) return false;
else if (! _OptSemicolonAST.equals(other.getOptSemicolonAST())) return false;
return true;
}
public int hashCode()
{
int hash = 7;
hash = hash * 31 + (getAsmRulesAST().hashCode());
hash = hash * 31 + (getOptSemicolonAST() == null ? 0 : getOptSemicolonAST().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); }
}