01: //
02: // Generated by JTB 1.2.1
03: //
04:
05: package oscript.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: public class NodeSequence implements NodeListInterface {
14: public NodeSequence(int n) {
15: nodes = new Vector(n);
16: }
17:
18: public NodeSequence(Node firstNode) {
19: nodes = new Vector();
20: addNode(firstNode);
21: }
22:
23: public void addNode(Node n) {
24: nodes.addElement(n);
25: }
26:
27: public Node elementAt(int i) {
28: return (Node) nodes.elementAt(i);
29: }
30:
31: public Enumeration elements() {
32: return nodes.elements();
33: }
34:
35: public int size() {
36: return nodes.size();
37: }
38:
39: public void accept(oscript.visitor.Visitor v) {
40: v.visit(this );
41: }
42:
43: public Object accept(oscript.visitor.ObjectVisitor v, Object argu) {
44: return v.visit(this , argu);
45: }
46:
47: public Vector nodes;
48: }
|