blob: 1b74479e9704398b2c3bcdc290c0484c23a5996b [file] [log] [blame]
package org.eclipse.emf.emfatic.core.lang.gen.ast;
import org.eclipse.gymnast.runtime.core.ast.ASTNode;
import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
/**
*
* @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
*/
public class MultiplicityExpr extends EmfaticASTNode {
private SimpleMultiplicityExpr _lowerBound;
private EmfaticTokenNode _dot_dot;
private SimpleMultiplicityExpr _upperBound;
public SimpleMultiplicityExpr getLowerBound() {
return _lowerBound;
}
public EmfaticTokenNode getDot_dot() {
return _dot_dot;
}
public SimpleMultiplicityExpr getUpperBound() {
return _upperBound;
}
/**
* @return the number of children of this ASTNode
*/
public int getChildCount() {
int count = 0;
if (_lowerBound != null) count++;
if (_dot_dot != null) count++;
if (_upperBound != null) count++;
return count;
}
/**
* @param index the index of a child ASTNode to get
* @return the child ASTNode at the given index
* @throws IndexOutOfBoundsException when the index is out of bounds
*/
public ASTNode getChild(int index) {
int count = -1;
if ((_lowerBound != null) && (++count == index)) return _lowerBound;
if ((_dot_dot != null) && (++count == index)) return _dot_dot;
if ((_upperBound != null) && (++count == index)) return _upperBound;
throw new IndexOutOfBoundsException();
}
/**
* Construct a new MultiplicityExpr.
*/
public MultiplicityExpr(
SimpleMultiplicityExpr lowerBound,
TokenInfo dot_dot,
SimpleMultiplicityExpr upperBound
) {
super();
if (lowerBound != null) {
_lowerBound = lowerBound;
if (_lowerBound._parent != null) throw new RuntimeException();
_lowerBound._parent = this;
}
if (dot_dot != null) {
_dot_dot = new EmfaticTokenNode(dot_dot);
if (_dot_dot._parent != null) throw new RuntimeException();
_dot_dot._parent = this;
}
if (upperBound != null) {
_upperBound = upperBound;
if (_upperBound._parent != null) throw new RuntimeException();
_upperBound._parent = this;
}
}
/**
* This method overrides the superclass <code>acceptImpl</code> providing
* the same implementation. Here <code>this</code> refers to this specific node
* class, so the <code>beginVisit</code> and <code>endVisit</code> methods
* specific to this type in the visitor will be invoked.
*/
public void acceptImpl(EmfaticASTNodeVisitor visitor) {
boolean visitChildren = visitor.beginVisit(this);
if (visitChildren) visitChildren(visitor);
visitor.endVisit(this);
}
}