001//
002// Generated by JTB 1.1.2
003//
004
005package jtb.cparser.syntaxtree;
006
007import java.util.*;
008
009/**
010 * Represents a sequence of nodes nested within a choice, list,
011 * optional list, or optional, e.g. ( A B )+ or [ C D E ]
012 */
013public class NodeSequence implements NodeListInterface {
014  static final long serialVersionUID = 20050923L;
015
016   public NodeSequence(int n) {
017      nodes = new Vector<Node>(n);
018   }
019
020   public NodeSequence(Node firstNode) {
021      nodes = new Vector<Node>();
022      addNode(firstNode);
023   }
024
025   public void addNode(Node n) {
026      nodes.addElement(n);
027   }
028
029   public Node elementAt(int i)  { return nodes.elementAt(i); }
030   public Enumeration<Node> elements() { return nodes.elements(); }
031   public int size()             { return nodes.size(); }
032   public void accept(jtb.cparser.visitor.Visitor v) {
033      v.visit(this);
034   }
035
036   public Vector<Node> nodes;
037}