01: //
02: // Generated by JTB 1.2.2
03: //
04:
05: package xtc.lang.javacc.syntaxtree;
06:
07: import java.util.*;
08:
09: /**
10: * Represents a sequence of nodes nested within a choice, list,
11: * optional list, or optional, e.g. ( A B )+ or [ C D E ].
12: */
13: @SuppressWarnings("unchecked")
14: public class NodeSequence implements NodeListInterface {
15: public NodeSequence(int n) {
16: nodes = new Vector(n);
17: }
18:
19: public NodeSequence(Node firstNode) {
20: nodes = new Vector();
21: addNode(firstNode);
22: }
23:
24: public void addNode(Node n) {
25: nodes.addElement(n);
26: }
27:
28: public Node elementAt(int i) {
29: return (Node) nodes.elementAt(i);
30: }
31:
32: public Enumeration elements() {
33: return nodes.elements();
34: }
35:
36: public int size() {
37: return nodes.size();
38: }
39:
40: public void accept(xtc.lang.javacc.visitor.Visitor v) {
41: v.visit(this );
42: }
43:
44: public Object accept(xtc.lang.javacc.visitor.ObjectVisitor v,
45: Object argu) {
46: return v.visit(this , argu);
47: }
48:
49: public Vector nodes;
50: }
|