blob: e9dd7d5107e3f68f4b9b64174f496e9793ddab25 [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 Reference extends ClassMemberDecl {
private Annotations _annotations;
private Modifiers _modifiers;
private ReferenceKind _referenceKind;
private TypeWithMulti _typeWithMulti;
private EmfaticTokenNode _hash;
private EmfaticTokenNode _oppositeName;
private EmfaticTokenNode _name;
private EmfaticTokenNode _semi;
public Annotations getAnnotations() {
return _annotations;
}
public Modifiers getModifiers() {
return _modifiers;
}
public ReferenceKind getReferenceKind() {
return _referenceKind;
}
public TypeWithMulti getTypeWithMulti() {
return _typeWithMulti;
}
public EmfaticTokenNode getHash() {
return _hash;
}
public EmfaticTokenNode getOppositeName() {
return _oppositeName;
}
public EmfaticTokenNode getName() {
return _name;
}
public EmfaticTokenNode getSemi() {
return _semi;
}
/**
* @return the number of children of this ASTNode
*/
public int getChildCount() {
int count = 0;
if (_annotations != null) count++;
if (_modifiers != null) count++;
if (_referenceKind != null) count++;
if (_typeWithMulti != null) count++;
if (_hash != null) count++;
if (_oppositeName != null) count++;
if (_name != null) count++;
if (_semi != 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 ((_annotations != null) && (++count == index)) return _annotations;
if ((_modifiers != null) && (++count == index)) return _modifiers;
if ((_referenceKind != null) && (++count == index)) return _referenceKind;
if ((_typeWithMulti != null) && (++count == index)) return _typeWithMulti;
if ((_hash != null) && (++count == index)) return _hash;
if ((_oppositeName != null) && (++count == index)) return _oppositeName;
if ((_name != null) && (++count == index)) return _name;
if ((_semi != null) && (++count == index)) return _semi;
throw new IndexOutOfBoundsException();
}
/**
* Construct a new Reference.
*/
public Reference(
Annotations annotations,
Modifiers modifiers,
ReferenceKind referenceKind,
TypeWithMulti typeWithMulti,
TokenInfo hash,
TokenInfo oppositeName,
TokenInfo name,
TokenInfo semi
) {
super();
if (annotations != null) {
_annotations = annotations;
if (_annotations._parent != null) throw new RuntimeException();
_annotations._parent = this;
}
if (modifiers != null) {
_modifiers = modifiers;
if (_modifiers._parent != null) throw new RuntimeException();
_modifiers._parent = this;
}
if (referenceKind != null) {
_referenceKind = referenceKind;
if (_referenceKind._parent != null) throw new RuntimeException();
_referenceKind._parent = this;
}
if (typeWithMulti != null) {
_typeWithMulti = typeWithMulti;
if (_typeWithMulti._parent != null) throw new RuntimeException();
_typeWithMulti._parent = this;
}
if (hash != null) {
_hash = new EmfaticTokenNode(hash);
if (_hash._parent != null) throw new RuntimeException();
_hash._parent = this;
}
if (oppositeName != null) {
_oppositeName = new EmfaticTokenNode(oppositeName);
if (_oppositeName._parent != null) throw new RuntimeException();
_oppositeName._parent = this;
}
if (name != null) {
_name = new EmfaticTokenNode(name);
if (_name._parent != null) throw new RuntimeException();
_name._parent = this;
}
if (semi != null) {
_semi = new EmfaticTokenNode(semi);
if (_semi._parent != null) throw new RuntimeException();
_semi._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);
}
}