| 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 OptNegatedModifier extends EmfaticASTNode { |
| |
| |
| private EmfaticTokenNode _bang; |
| private Modifier _modifier; |
| |
| public EmfaticTokenNode getBang() { |
| return _bang; |
| } |
| public Modifier getModifier() { |
| return _modifier; |
| } |
| |
| |
| /** |
| * @return the number of children of this ASTNode |
| */ |
| public int getChildCount() { |
| int count = 0; |
| if (_bang != null) count++; |
| if (_modifier != 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 ((_bang != null) && (++count == index)) return _bang; |
| if ((_modifier != null) && (++count == index)) return _modifier; |
| |
| throw new IndexOutOfBoundsException(); |
| } |
| |
| /** |
| * Construct a new OptNegatedModifier. |
| */ |
| public OptNegatedModifier( |
| TokenInfo bang, |
| Modifier modifier |
| ) { |
| super(); |
| |
| if (bang != null) { |
| _bang = new EmfaticTokenNode(bang); |
| if (_bang._parent != null) throw new RuntimeException(); |
| _bang._parent = this; |
| } |
| if (modifier != null) { |
| _modifier = modifier; |
| if (_modifier._parent != null) throw new RuntimeException(); |
| _modifier._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); |
| } |
| |
| } |