blob: dc4d7d9def45f183e8a6a28ecaddcd70ecc16e0c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2006 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.gymnast.generator.core.ast;
import org.eclipse.gymnast.runtime.core.ast.ASTNode;
import antlr.Token;
/**
*
* @generated by Gymnast from gymnast.ast on Aug 15, 2004 2:28:15 PM
*/
public class OptionsSection extends GymnastASTNode {
public static final String KW_OPTIONS = "options";
private GymnastTokenNode _options_KW;
private GymnastTokenNode _lcurly;
private OptionList _optionList;
private GymnastTokenNode _rcurly;
public GymnastTokenNode getOptions_KW() {
return _options_KW;
}
public GymnastTokenNode getLcurly() {
return _lcurly;
}
public OptionList getOptionList() {
return _optionList;
}
public GymnastTokenNode getRcurly() {
return _rcurly;
}
/**
* @return the number of children of this ASTNode
*/
public int getChildCount() {
int count = 0;
if (_options_KW != null) count++;
if (_lcurly != null) count++;
if (_optionList != null) count++;
if (_rcurly != 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 ((_options_KW != null) && (++count == index)) return _options_KW;
if ((_lcurly != null) && (++count == index)) return _lcurly;
if ((_optionList != null) && (++count == index)) return _optionList;
if ((_rcurly != null) && (++count == index)) return _rcurly;
throw new IndexOutOfBoundsException();
}
/**
* Construct a new OptionsSection.
*/
public OptionsSection(
Token options_KW,
Token lcurly,
OptionList optionList,
Token rcurly
) {
super();
if (options_KW != null) {
_options_KW = new GymnastTokenNode(options_KW);
if (_options_KW._parent != null) throw new RuntimeException();
_options_KW._parent = this;
}
if (lcurly != null) {
_lcurly = new GymnastTokenNode(lcurly);
if (_lcurly._parent != null) throw new RuntimeException();
_lcurly._parent = this;
}
if (optionList != null) {
_optionList = optionList;
if (_optionList._parent != null) throw new RuntimeException();
_optionList._parent = this;
}
if (rcurly != null) {
_rcurly = new GymnastTokenNode(rcurly);
if (_rcurly._parent != null) throw new RuntimeException();
_rcurly._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(GymnastASTNodeVisitor visitor) {
boolean visitChildren = visitor.beginVisit(this);
if (visitChildren) visitChildren(visitor);
visitor.endVisit(this);
}
}