| /** |
| * 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 36: PatternCompositionAST ::= find QualifiedTypeNameAST ActualPatternParameterDefAST OptMatchCountAST |
| *</b> |
| */ |
| public class PatternCompositionAST extends ASTNode implements IPatternCompositionAST |
| { |
| private IQualifiedTypeNameAST _QualifiedTypeNameAST; |
| private IActualPatternParameterDefAST _ActualPatternParameterDefAST; |
| private OptMatchCountAST _OptMatchCountAST; |
| |
| public IQualifiedTypeNameAST getQualifiedTypeNameAST() { return _QualifiedTypeNameAST; } |
| public IActualPatternParameterDefAST getActualPatternParameterDefAST() { return _ActualPatternParameterDefAST; } |
| /** |
| * The value returned by <b>getOptMatchCountAST</b> may be <b>null</b> |
| */ |
| public OptMatchCountAST getOptMatchCountAST() { return _OptMatchCountAST; } |
| |
| public PatternCompositionAST(IToken leftIToken, IToken rightIToken, |
| IQualifiedTypeNameAST _QualifiedTypeNameAST, |
| IActualPatternParameterDefAST _ActualPatternParameterDefAST, |
| OptMatchCountAST _OptMatchCountAST) |
| { |
| super(leftIToken, rightIToken); |
| |
| this._QualifiedTypeNameAST = _QualifiedTypeNameAST; |
| ((ASTNode) _QualifiedTypeNameAST).setParent(this); |
| this._ActualPatternParameterDefAST = _ActualPatternParameterDefAST; |
| ((ASTNode) _ActualPatternParameterDefAST).setParent(this); |
| this._OptMatchCountAST = _OptMatchCountAST; |
| if (_OptMatchCountAST != null) ((ASTNode) _OptMatchCountAST).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 PatternCompositionAST)) return false; |
| PatternCompositionAST other = (PatternCompositionAST) o; |
| if (! _QualifiedTypeNameAST.equals(other.getQualifiedTypeNameAST())) return false; |
| if (! _ActualPatternParameterDefAST.equals(other.getActualPatternParameterDefAST())) return false; |
| if (_OptMatchCountAST == null && other.getOptMatchCountAST() != null) return false; |
| else if (! _OptMatchCountAST.equals(other.getOptMatchCountAST())) return false; |
| return true; |
| } |
| |
| public int hashCode() |
| { |
| int hash = 7; |
| hash = hash * 31 + (getQualifiedTypeNameAST().hashCode()); |
| hash = hash * 31 + (getActualPatternParameterDefAST().hashCode()); |
| hash = hash * 31 + (getOptMatchCountAST() == null ? 0 : getOptMatchCountAST().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); } |
| } |
| |
| |